-
Notifications
You must be signed in to change notification settings - Fork 60
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
Remove element restrictions from remote resource locations #1943
Conversation
rearrange the notes
The issue was discussed in a meeting on 2021-12-03 List of resolutions:
View the transcript1. Custom elements and remote resources (issue epub-specs#1913)See github issue epub-specs#1913. Dave Cramer: first few issues are about remote resources. See github pull request epub-specs#1949. See github pull request epub-specs#1943. Dave Cramer: all of our previous conclusions are complicated by custom elements in HTML. Matt Garrish: right, there are 2 PRs, this one tries to find language that still works with our past intent, the other PR more specifically address the existence of custom elements. Dave Cramer: i made a test book for this, it worked in Apple and ADE, Kindle previewer failed because it doesn't support js, didn't work in Thorium. Ivan Herman: what you tested tells me that custom elements are here, it would be foolish of us to try to restrict them. They are part of the element that we have to deal with.
Matt Garrish: the simpler solution might be just to say that RS should not render remote resources in iframes. Dave Cramer: worried that people would then work around that by using a custom element to effectively make an iframe. Matt Garrish: there's more awareness of how to handle that at the RS level than at checking, because you have the DOM. Brady Duga: when it comes to scripting, it kind of the wild west. It'll be impossible to test whether scripts are being used to do something malicious. Ivan Herman: to be clear, custom elements mostly means scripting. As soon as RS allows scripting, any restriction on custom elements is meaningless. The real restriction is on scripting. Dave Cramer: there are 2 types of custom elements. First inherents from existing HTML element (i.e. "is" attribute). This type doesn't work in webkit, and will probably be limited in epub world..
Dave Cramer: I would warn everyone to be wary of custom elements, because it's easy to miss things related to a11y. HTML elements take care of a lot of that thinking for you. Ivan Herman: that's not really our fight, leave for WHAT WG. Dan Lazin: we use custom elements quite a bit in my day job, and there are more a11y friendly ways of doing it, but yes, beware. |
Although there's a security advantage in saying where remote resources can be used, rather than relying solely on media type to allow them (which people periodically try to fake to get through epubcheck), this PR undoes our earlier change because I don't see a simple way to account for custom elements or dynamic writing of content generally.
Trying to be overly-restrictive always has a way of coming back and biting us, too, when some new technique comes along that we haven't accounted for, so this is probably the better long-term option.
I also moved up the notes that were after the examples, as it was a weird place for them (usually we put examples last). I also removed the note formatting from the one that says the rules apply to both CMT and foreign resource types as it is more of a normative statement than an informative one.
Fixes #1913
Preview | Diff