Closed Bug 1003294 Opened 10 years ago Closed 7 years ago

[WebComponents] Inconsistent rendering with scoped style in shadow dom

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: yor, Assigned: wchen)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 2 obsolete files)

25 bytes, text/css
Details
24 bytes, text/css
Details
673 bytes, text/html
Details
Attached file demo.html (obsolete) —
When using imported scoped stylesheet inside template, elements inside shadow dom sometimes aren't rendered correctly.

This does not happen with inline styles.

Sample code attached with video showing inconsistent rendering on repeat page refresh.
Attached file blue.css
Attached file red.css
Attached file Video (obsolete) —
Attachment #8414610 - Attachment is obsolete: true
Attachment #8414605 - Attachment is obsolete: true
Attached file demo.html
(In reply to Olli Pettay [:smaug] from comment #5)
> Is the plan even to support <style scoped>?
> See also
> https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/R1x18ZLS5qQ

The same behavior is observed without "scoped".
Blocks: 1008187
As far as I know we already have scoped stylesheets implemented.
Also, as I've mentioned before, we observed the same behavior even without scoped.
I've got a fix for this locally. The problem here is related to @import not working in ShadowRoot due the style sheet not being put into the document.
Assignee: nobody → wchen
It seems that Bug 997173 is on the same problem. Is there anyone can confirm whether I  	
mark that as duplicate?
(In reply to SUN Haitao from comment #11)
> It seems that Bug 997173 is on the same problem. Is there anyone can confirm
> whether I  	
> mark that as duplicate?

Yup.  It's the same problem.

William, any idea when the fix will be ready?
William told me that one of the patches in bug 992521 will fix this issue.
Not sure the patches in that bug will make <style scoped> as a child of ShadowTree work as you'd expect.  Various bits of the scoped style sheet code expects the scope to be an Element (the ElementIsStyleScopeRoot flag is on Element, the array on TreeMatchContext is an array of Elements, etc.).
(But that might not be the exact issue here.)  Patches in bug 1017798 should help with some aspects of scoped style interacting with shadow trees.
Depends on: 1017798
The testcases in this and Bug 997173 both work fine on my box now. Could this be closed?
Seems like this is fixed now (and createShadowRoot isn't what we're going to implement).
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: