-
Notifications
You must be signed in to change notification settings - Fork 43
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 / Rephrase "4.3 Determine if Fragment Id is needed" #244
Comments
The example given is meant as a warning that the UA shouldn't just blindly tack the text onto an existing fragment id. Generating the fallback id automatically is indeed difficult to do well. This (non-normative) section is admittedly less prescriptive than event the surrounding sections. I think it boils down to: when generating a text directive, strip out the fragment-id unless you're sure it's what the user wants. (though it seems in Chrome we didn't follow our own advice...) I think there's some potentially useful heuristics that might work reasonably. E.g. look at the first ancestor that's a section-like element ( |
Always no id seems more predictable and avoids issues. We don't know how sites use the |
I think this is up to individual UAs to decide how to best do - but I'll reword this section as a reminder that the existing fragment should likely be removed when generating a new text directive link. |
Was just reminded of #75 - it seems useful to start a search from an element-id if one is given, rather than only using it as a fallback. This allows the UA to generate a unique directive in the presence of highly repetitive text by including a nearby id (e.g. see https://crbug.com/1507811 for an example). I'll try to address these issues together. |
From how I understand the mentioned section, the User Agent may arbitrarily provide a fallback element-id in case the document changed and the text directive is not found on the page anymore. However, there is an example which should explain which fallback id is appropriate and which isn't.
It is unclear to me how that should work. Given that a page may have element-ids for every HTML element (as an extreme case), how should the User Agent decide which id to use as a fallback? Should it be an element which is in the same viewport (then the link would depend on the resolution / size of the window at creation time)? Or should it be the next id when traversing backwards?
To me this imposes the risk that an id is picked which is misleading and unless specified in more detail I would propose to remove this section from the spec.
CC @zcorpan
The text was updated successfully, but these errors were encountered: