-
Notifications
You must be signed in to change notification settings - Fork 379
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
[Shadow]: url fragment identifiers should be followed into ShadowDOM (bugzilla: 23161) #66
Comments
I do not have a strong opinion. This is a typical situation where pros and cons conflict.
Which is preferred? Any opinions? |
Isn't the point of the shadowDOM to abstract away the inner workings of the component/element? Allowing fragment identifiers to penetrate the shadowDOM seems to violate that. Fragment id's are used to either scroll to a portion of a document (doesn't seem to fit the desired use case here), or to represent a particular state of a page. ID's are supposed to be unique across a document, they are not expected to be unique across all shadow boundaries, thus should element A and element B each have id X in their shadow tree, there would be no way of telling the document X of A but not X of B, no? |
The point about non-uniqueness is pretty strong; I think do not allow (option 2) makes the most sense in that regard. |
Indeed, we can have multiple shadow DOMs that contain same IDs. We don't want to be conflating all those elements. Having said that, there is something to be desired here about deep-linking into shadow DOM. We probably need some sort of nesting syntax for identifiers to do that though. e.g. |
I'm pretty sure that people will prefer [option 2] at the first glance because [option 1] violates an encapsulation. As Ryosuke suggested, it would be nice to have an alternative way to link into Shadow DOM. Any ideas are welcome. |
therefore if an web author wants to route (navigate, scroll to) some hash ID into So option 2 sounds good to me. |
IMO, I prefer option 1. I am aware that this is a minor opinion. |
This seems like a thing (same with event retargating) that developers want to be able to control on a per- For closed shadow trees we obviously cannot do this, but for open ones both might make sense. You probably want this if you use shadow trees for templating, but don't want it for controls. |
+1. That sounds a good idea. |
Does someone has a strong opinion how we should resolve this issue? Looks this issue has not gotten much attention so far. |
When proposing to close an issue, it helps if you state the resolution. Are you saying the resolution should be that for v1 fragment identifiers will not go beyond the document tree? So either open or closed shadow trees with matching IDs will not be navigated to? |
My bad. I should have clarified it.
Yes. I meant this behavior. Fragment identifiers in shadow trees will not be leaked at all. We have two options here: The current behavior is A). The proposed idea is B). |
We're fine with going with (A) and potentially revisiting new API surface in v2. |
Closing this. If someone wants this they will need to create a new issue with a clear proposal. |
As discussed on WICG/webcomponents#66 and whatwg/html#1192, the user agent should not use an element that has an ID exactly equal to decoded fragid or an anchor element with a name attribute exactly equal to fragid if the element inside a shadow tree as the indicated part of the document. WebKit nightly builds and Google Chrome Canary both passes the test.
As discussed on WICG/webcomponents#66 and whatwg/html#1192, the user agent should not use an element that has an ID exactly equal to decoded fragid or an anchor element with a name attribute exactly equal to fragid if the element inside a shadow tree as the indicated part of the document. WebKit nightly builds and Google Chrome Canary both passes the test.
…tform-tests#2953) As discussed on WICG/webcomponents#66 and whatwg/html#1192, the user agent should not use an element that has an ID exactly equal to decoded fragid or an anchor element with a name attribute exactly equal to fragid if the element inside a shadow tree as the indicated part of the document. WebKit nightly builds and Google Chrome Canary both passes the test.
…tform-tests#2953) As discussed on WICG/webcomponents#66 and whatwg/html#1192, the user agent should not use an element that has an ID exactly equal to decoded fragid or an anchor element with a name attribute exactly equal to fragid if the element inside a shadow tree as the indicated part of the document. WebKit nightly builds and Google Chrome Canary both passes the test.
Title: [Shadow]: url fragment identifiers should be followed into ShadowDOM (bugzilla: 23161)
Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23161
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23161#c0
Steve Orvell wrote on 2013-09-05 02:16:51 +0000.
Given the following:
In this case, the #footer resource should be navigated to (page scrolls to it) even though it is inside a shadowRoot. There is one url for a page and it must be shared by all the shadowRoots.
Since id's are scoped inside ShadowDOM, there may be a lot of duplicates page-wide. So, which one should be followed? The answer here is to do what browsers do now in this case: navigate to the first fragment identifier.
The text was updated successfully, but these errors were encountered: