Closed
Bug 1021572
Opened 10 years ago
Closed 7 years ago
<style scoped> elements in shadow trees do not work
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
INVALID
People
(Reporter: heycam, Assigned: heycam)
References
Details
Attachments
(7 files)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
If a <style scoped> is a child of a ShadowRoot, We don't stick the ElementIsStyleScopeRoot flag on the ShadowRoot, so we don't apply its rules to the elements within the shadow tree.
Assignee | ||
Comment 1•10 years ago
|
||
One question (probably not the only one!): if we have: ShadowRoot | +--span | +--<style scoped> :scope span { ... } </style> should that rule match? The thing we'd want to match :scope against is the ShadowRoot, but that's not an element. Naively it seems like the rule should match, but on the other hand, :scope should be the same as *:scope, and * is not going to match a ShadowRoot.
Assignee | ||
Comment 2•10 years ago
|
||
Let's handle most of the remaining <style scoped>-in-shadow-trees issues here.
Summary: <style scoped> children of ShadowRoot don't work → <style scoped> elements in shadow trees do not work
Assignee | ||
Comment 3•10 years ago
|
||
![]() |
||
Comment 13•10 years ago
|
||
Cameron explicitly told me this was non-urgent. If it _is_ urgent, I can try to get to it tomorrow...
![]() |
||
Comment 15•10 years ago
|
||
Comment on attachment 8440484 [details] [diff] [review] Part 1: Allow ShadowRoots to be <style scoped> scope nodes. >+++ b/content/base/public/nsINode.h >@@ -1333,21 +1334,22 @@ private: >+ // Set if the node is in the scope of a scoped style sheet; this flag is > // only accurate for elements bound to a document "or shadow roots of shadow trees attached to them"? >+ void SetIsInStyleScope(bool aValue) { >+ void SetIsInStyleScope() { >+ void ClearIsInStyleScope() { Can we still assert that we're an element-or-shadowroot in those three? >+++ b/content/base/src/nsStyleLinkElement.cpp >+UpdateIsInStyleScopeFlagOnSubtree(FragmentOrElement* aScope) So this is somewhat preexisting but... When doing ClearIsInStyleScope on an element, don't we need to check its shadow tree as well to see whether it needs the same treatment? Followup probably ok here, since it _is_ preexisting. r=me
Attachment #8440484 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 16•10 years ago
|
||
Comment on attachment 8440485 [details] [diff] [review] Part 2: Give nsBindingManager::WalkRules an argument to control whether rules in <style scoped> style sheets are walked. Hmm. Why false in FileRules?
![]() |
||
Updated•10 years ago
|
Flags: needinfo?(cam)
![]() |
||
Comment 17•10 years ago
|
||
Comment on attachment 8440486 [details] [diff] [review] Part 3: Factor out utility function that gathers rule processors for <style scoped> style sheets. r=me
Attachment #8440486 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 18•10 years ago
|
||
Comment on attachment 8440487 [details] [diff] [review] Part 4: Create separate rule processors for <style scoped> elements in shadow trees. r=me
Attachment #8440487 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 19•10 years ago
|
||
Comment on attachment 8440488 [details] [diff] [review] Part 5: Walk <style scoped> sheets from bindings. r=me
Attachment #8440488 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 20•10 years ago
|
||
Comment on attachment 8440489 [details] [diff] [review] Part 6: Push ShadowRoot style scopes at points during frame construction & restyling where we've recursed down to the ShadowRoot's children. There's a bunch of copy/paste here. Can we add a constructor to AutoAncestorPusher, or a subclass of it, that takes an nsIContent* or nsINode* and does all that stuff? r=me with that Also, watch out for conflicts in the CSSFC code with bug 907396.
Attachment #8440489 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 21•10 years ago
|
||
Comment on attachment 8440490 [details] [diff] [review] Part 7: Tests. r=me
Attachment #8440490 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 22•10 years ago
|
||
Comment on attachment 8440485 [details] [diff] [review] Part 2: Give nsBindingManager::WalkRules an argument to control whether rules in <style scoped> style sheets are walked. Dropping review request pending comment 16 getting answered.
Attachment #8440485 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 23•7 years ago
|
||
<style scoped> is gone.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(cam)
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•