-
Notifications
You must be signed in to change notification settings - Fork 100
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
EPUB3 "popup" footnotes #270
base: develop
Are you sure you want to change the base?
Conversation
if (sourceIDREF === ("#" + targetID)) { | ||
|
||
target.hide(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: do we preserve the visibility of footnote content (DOM fragment), so that CFI bookmarks / annotations work as usual? I think yes. To be discussed.
The "popup" footnotes will be implement in the next version of shared-js ? Specificly in the app Ios/Android context. |
$elements.each(function(i) { | ||
|
||
if ($elements[i].localName !== "a" | ||
&& $elements[i].localName !== "aside") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The limitation to aside
elements seems very artificial. Is this defined in the EPUB specification? Should the match be based solely on the epub:type
value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so I can tell that at least, iBooks is matching aside
, div
, and p
since they offer two different options to authors as regards hiding the footnote in the normal reading flow (a.k.a. main body):
- hiding when
aside
is used; - not hiding it when either
div
orp
are used.
See note @ the bottom of https://help.apple.com/itc/booksassetguide/#/itccf8ecf5c8.
You can be sure a large portion of eprdctn knows about that.
On another amusing note, they expect authors to set the direction inline in case of RTL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but if I remember correctly, your example used aside
+ epub:type=footnotes
(plural), with nested div
+ epub:type=footnote
(singular). So I modified your example by swapping the div
and aside
elements so that it would work correctly in Readium (this code). Perhaps it was a typo at your end? Or was it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that was intentional → div + epub:type="footnote"
was there to have the footnote displayed at the end of the XHTML file. If it were aside + epub:type="footnote"
then iBooks would hide it from the body of the XHTML file.
Disclaimer: there’s been a lot of a11y issues with popup footnotes in iBooks e.g. screen reader can’t access the contents so others may have used aside
+ nested div
as well – that + voice over has very weird behaviors in multicol e.g. alt
not being read for images when they happen to be laid out at the top of a column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks for the clarification :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And ref to part of their logic if needed: https://gist.github.com/dvschultz/9caba7f9058596451744#file-cfi-js-L1202-L1294
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ why only asides
are hidden and not others: https://github.com/FriendsOfEpub/WillThatBeOverriden/blob/master/ReadingSystems/iBooks/OS%20X/user_stylesheet_flowable.css.tmpl#L232-L234
|
||
if (epubType == "noteref" && $element[0].localName === "a") { | ||
sources.push($element); | ||
} else if ((epubType == "footnote" || epubType == "note" || epubType == "rearnote") && $element[0].localName === "aside") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment about aside
restriction.
See description in the viewer PR: Waffle connects to readium/readium-js-viewer#505