-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not work on Bookwalker's web reader on Safari #773
Comments
Hi! Thanks for reporting this. I suspect this has to do with the fact that Safari runs in a separate mode ( I'd like to investigate but when I open books on bookwalker.jp I don't see the highlight feature. I guess I need to create an account? |
I managed to reproduce this and I think what is happening is as follows:
The Safari implementation sort of makes sense. You can't select that text so it won't give you that caret position and it appears to walk up the tree to find the first element whose text you can select. I suppose we could try something where, if:
Temporarily apply a rule to drop the However, the third condition there is hard to check efficiently, and adding rules and forcing a restyle is not very performant. I'll have to think about this some more. |
Unfortunately Chrome doesn't have the same behaviour as Safari so I can't easily write an automated test for this since we don't run automated tests in Safari at the moment. Manual test case: https://jsbin.com/takayijibe/edit?html,css,js,output |
What's more, Safari doesn't necessarily return an ancestor of the node it should. In the bookwalker.jp case it appears to return the next sibling (with class So I think this needs a different approach where we:
In my testing that appears to work. |
Here's what it looks like on Firefox when it is working normally:
Screen.Recording.2021-09-24.at.8.51.25.AM-1.mov
And here's what it looks like on Safari:
Screen.Recording.2021-09-24.at.8.50.32.AM-1.mov
This is from bookwalker.jp 's web reader for their light novels, where when you highlight words on the viewer and the popup comes out for you to write any notes or highlights. The words on the popup are usually detectable on Firefox so I wanted to try it on Safari but it doesn't work.
The text was updated successfully, but these errors were encountered: