Skip to content
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

:target selector does not work on page load #469

Closed
aeosynth opened this issue Apr 8, 2014 · 4 comments
Closed

:target selector does not work on page load #469

aeosynth opened this issue Apr 8, 2014 · 4 comments
Labels

Comments

@aeosynth
Copy link

aeosynth commented Apr 8, 2014

http://jsbin.com/voruhaxo/1#foo

'foo' is not highlighted on page load. without polymer, this works

@ebidel
Copy link
Contributor

ebidel commented Apr 12, 2014

If you click the links in the Shadow DOM, they don't work as navigational targets (e.g. the hash doesn't update) so CSS :target should also not work.

Background: When this came talking to the spec folks, the argument was that ids are scoped to ShadowDOM so they don't make sense as navigation targets.

@ebidel
Copy link
Contributor

ebidel commented Apr 12, 2014

BTW, if you want something like deep linking, you'll have to use JS. Example:
https://github.com/GoogleChrome/chromium-dashboard/blob/master/static/elements/chromedash-metrics.html#L60

@ebidel ebidel added the wontfix label Apr 12, 2014
@ebidel ebidel closed this as completed Apr 12, 2014
@aeosynth
Copy link
Author

then this is a bug the other way - after page load, the :target selector works on shadow dom

@ebidel
Copy link
Contributor

ebidel commented Apr 13, 2014

http://jsbin.com/voruhaxo/6/quiet

What I see is that clicking the link in the Shadow DOM does make the navigational jump to the anchor target (outside of the SD). Clicking a link outside the SD does not make the jump to a target that's inside the SD. This makes sense from the scoping/encapsulation standpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants