Implement ::backdrop
pseudo-element parsing
#103
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Notes
Github.com sets it's root-level CSS variables using a selector that includes a
::backdrop
pseudo selector. It's not quite this, but it's morally equivalent tohtml, html ::backdrop
. And the presence of::backdrop
causes the entire selector to fail to parse meaning that the variables never apply and styling is way off.Changing the selector to
html, html ::non-existent-selector
causes the styles to fail to apply in Chrome too. So I think the strict parsing is correct per the spec. So I believe the only way to make this work is to implement parsing for::backdrop
. I don't think we support creating a backdrop in a current Servo, but if we did support then we probably would support matching styles against it, so enabling the selector seems reasonable to me.Feedback wanted
I wasn't sure if it should be a
Lazy
pseudo-element. ButLazy
is documented as being for regular but rarely used pseudo-elements which seemed to fit, whereasPreComputed
is documented as being only for internal pseudo-elements which didn't seem to fit.