w3c / publ-cg

EPUB 3 Community Group Repository
Other
44 stars 16 forks source link

linking to ranges (sometimes extensive) #59

Open RachelComerford opened 6 years ago

RachelComerford commented 6 years ago

From BISG survey

dauwhe commented 6 years ago

What is the desired behavior?

One could use the CSS [target] pseudo-class and a wrapper element around the range in question (if possible). Clicking on a link to the range could then result in a background color or other highlighting of the entire range.

If the range is not expressible as a node (for example, the 2nd half of one paragraph + the 1st half of the next paragraph), then things get more complex. It's gonna be a while until we have overlapping markup in ebooks :)

JayPanoz commented 6 years ago

One could use the CSS [target] pseudo-class and a wrapper element around the range in question (if possible)

I’ve had feedback from @danielweck about this in ReadiumCSS. Emphasis mine.

Problem: several EPUB reading systems (including Readium(1), iBooks iOS/OSX, Edge) seem to interfere with URL anchor / fragment identifier, thereby breaking CSS :target pseudo-class. This is something I have been keen to get right in Readium2, where the navigation logic (link activation) is also "hijacked" by some kind of reading system logic, especially in Electron as we listen to DOM click event, as well as higher-level / platform-specific navigation events via a WebView API (which allows us to capture the annoying window.location programmatic redirects that InDesign uses, among other things).

So I’m not particularly optimistic about this option.