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
Support :scope pseudo-class #18790
Support :scope pseudo-class #18790
Changes from all commits
ab46a0b
ba44d18
0564a1e
4667e81
dd0366c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1530,6 +1530,7 @@ pub unsafe extern "C" fn Servo_SelectorList_Matches( | |
None, | ||
element.owner_document_quirks_mode(), | ||
); | ||
context.scope_element = Some(element.opaque()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix this too in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I... just tried... but I don't know how to fix it there... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems that |
||
|
||
selectors::matching::matches_selector_list(selectors, &element, &mut context) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<meta charset="UTF-8"> | ||
<title>Selectors Level 4: :scope without scoping</title> | ||
<link rel="author" title="Xidorn Quan" href="mailto:me@upsuper.org"> | ||
<link rel="author" title="Mozilla" href="https://www.mozilla.org"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need a |
||
<link rel="help" href="https://drafts.csswg.org/selectors-4/#scope-pseudo"> | ||
<link rel="match" href="../reference/ref-filled-green-100px-square.xht"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
:scope > body > div { | ||
background: green; | ||
} | ||
</style> | ||
<body> | ||
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p> | ||
<div></div> | ||
</body> | ||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can hoist the whole definition of
ctx
up if you want. Anyway, r=me