Closed
Bug 933125
Opened 12 years ago
Closed 7 years ago
make scoped style sheets work in anonymous content
Categories
(Core :: CSS Parsing and Computation, defect, P4)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: heycam, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
|
10.58 KB,
patch
|
bzbarsky
:
review-
mrbkap
:
feedback-
|
Details | Diff | Splinter Review |
Scoped style sheets should work in non-native anonymous content, both <style scoped> elements from the outside applying to elements in the shadow tree, and <style scoped> elements within the shadow tree applying to its siblings and any descendent real and non-native anonymous content.
| Reporter | ||
Comment 1•12 years ago
|
||
Followup from bug 926717.
| Reporter | ||
Updated•12 years ago
|
Priority: -- → P3
| Reporter | ||
Comment 2•12 years ago
|
||
Mostly works, but the layout/reftests/scoped-style/scoped-style-xbl-005.xhtml test doesn't. Looks like Element::BindToTree isn't called for the <span> element that is in the deeper shadow tree, so my SetIsElementInStyleScope call in there isn't getting hit.
Assignee: nobody → cam
Status: NEW → ASSIGNED
| Reporter | ||
Updated•12 years ago
|
Priority: P3 → P4
| Reporter | ||
Comment 3•12 years ago
|
||
Attachment #825135 -
Attachment is obsolete: true
Attachment #825624 -
Flags: review?(bzbarsky)
| Reporter | ||
Comment 4•12 years ago
|
||
(In reply to Cameron McCormack (:heycam) from comment #2)
> Looks like Element::BindToTree isn't called for the <span> element that is in the
> deeper shadow tree
I was wrong about that bit.
| Reporter | ||
Comment 5•12 years ago
|
||
Hmm, got a couple of oranges for one of the added reftests, but not on all platforms:
https://tbpl.mozilla.org/?tree=Try&rev=074eea814efc
Comment 6•12 years ago
|
||
Comment on attachment 825624 [details] [diff] [review]
patch
>+ FlattenedChildIterator it(aElement);
Hmm. So in cases when the <style> is a kid of an anonymous element, this will iterate too many things. But I'm not sure we have a sane way to iterate the set of things we _really_ want here. Blake, do we?
Also, we should raise a web components spec issue about how <style> in anonymous content interacts with document.styleSheets (ideally it doesn't show up there, I'd think; add tests for this?).
> HasScopedStyleSheetChild(nsIContent* aContent)
Again, using FlattenedChildIterator is a bit weird here. If this incorrectly reports "true" is that ok?
> UpdateIsElementInStyleScopeFlagOnSubtree
And the same worries about FlattenedChildIterator here.
At the very least all of this stuff needs extensive comments explaining why the non-intuitive FlattenedChildIterator uses make sense and what assumptions make them OK, and perhaps some asserts of these assumptions if that's possible.
Attachment #825624 -
Flags: review?(bzbarsky)
Attachment #825624 -
Flags: review-
Attachment #825624 -
Flags: feedback?(mrbkap)
| Reporter | ||
Comment 7•12 years ago
|
||
Hmm, when you say it will iterate too many things, which additional things is it going to be iterating that we don't want?
Comment 8•12 years ago
|
||
Consider this DOM:
<div><span></span></div>
Say the <div> has a binding attached that has:
<content>
<p>
<style scoped></style>
<children></children>
</p>
</content>
The FlattenedChildIterator on <p> will see the <span> as a child of <p>. But it seems pretty wrong to me for the <style scoped> there to apply to that <span>....
And from the other direction:
<div><style scoped></style></div>
and the binding:
<content>
<p>
<span>Some stuff</span>
<children></children>
</p>
</content>
I don't think we want the <p> to be treated as a style scope for the <style> in this case.
Comment 9•12 years ago
|
||
Or I guess to actually answer comment 7, it'll iterate DOM kids of the bound element whose insertion point is under the element whose flattened children we're iterating.
Comment 10•12 years ago
|
||
Comment on attachment 825624 [details] [diff] [review]
patch
After talking to dglazkov on IRC, it seems like nobody has really thought about what this means, so we probably should hold off on it until we figure that out...
Attachment #825624 -
Flags: feedback?(mrbkap) → feedback-
| Reporter | ||
Comment 11•12 years ago
|
||
OK let's leave it for now.
Assignee: cam → nobody
Status: ASSIGNED → NEW
Comment 13•7 years ago
|
||
Per bug 1345702 comment 2 we're removing scoped style sheets.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•