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

Document selectors with pseudo classes generate incorrect styles #4885

Closed
dfreedm opened this issue Oct 17, 2017 · 2 comments
Closed

Document selectors with pseudo classes generate incorrect styles #4885

dfreedm opened this issue Oct 17, 2017 · 2 comments

Comments

@dfreedm
Copy link
Member

dfreedm commented Oct 17, 2017

Selectors of the form
html:not([foo]) *
will generate
html:not([foo]):not(.style-scope).not([style-scope]) *
instead of
html:not([foo]) *:not(.style-scope):not([style-scope])

@dfreedm
Copy link
Member Author

dfreedm commented Oct 17, 2017

Looks like _transformDocumentSelector incorrectly assumes the lack of a /deep/ or ::content selector means the whole selector can be treated as a simple selector, whereas the problem case is a complex selector. The simple selector transformer attempts to add the scoping classes before the first pseudo class, which in this case is the :not([foo]).

The easiest approach is to remove this code path and treat all document selectors as complex. This will make a selector that more closely matches the expected output:
html:not(.style-scope):not([style-scope]):not([foo]) *:not(.style-scope):not([style-scope])

dfreedm added a commit that referenced this issue Oct 17, 2017
Checking for `/deep/` and `::shadow` is not enough

Fixes #4885
@dfreedm dfreedm closed this as completed Oct 17, 2017
@dfreedm
Copy link
Member Author

dfreedm commented Oct 17, 2017

Fixed in #4886

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

No branches or pull requests

1 participant