Closed Bug 1413119 Opened 7 years ago Closed 7 years ago

Fix stylo-only failure of shadow DOM web platform test shadow-dom/untriaged/styles/test-005.html

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: ben.tian, Unassigned)

References

Details

(Whiteboard: [stylo])

The following web platform test fails in stylo only https://w3c-test.org/shadow-dom/untriaged/styles/test-005.html with error message: assert_equals: CSS styles declared in shadow tree must be applied to the element in the same shadow tree expected 0 but got 27 @https://w3c-test.org/shadow-dom/untriaged/styles/test-005.html:56:5 unit/<@https://w3c-test.org/shadow-dom/resources/shadow-dom-utils.js:66:13 Test.prototype.step@https://w3c-test.org/resources/testharness.js:1489:20 test@https://w3c-test.org/resources/testharness.js:511:9 @https://w3c-test.org/shadow-dom/untriaged/styles/test-005.html:26:1 -- Note pref "dom.webcomponents.enabled" as true is required to run the above test.
So the reason this is failing is because of: http://searchfox.org/mozilla-central/rev/1c4901d060e3953e41088c038b62a0c026c1e1fb/dom/xbl/nsXBLPrototypeResources.cpp#119 `shell` is null there, because it's a non-rendered (yet) iframe. Indeed tweaking the test like: diff --git a/shadow-dom/untriaged/styles/test-005.html b/shadow-dom/untriaged/styles/test-005.html index 0debdec5fc..aa10fc50ee 100644 --- a/shadow-dom/untriaged/styles/test-005.html +++ b/shadow-dom/untriaged/styles/test-005.html @@ -38,6 +38,8 @@ test(unit(function (ctx) { //Shadow root to play with var s = host.attachShadow({mode: 'open'}); + d.body.offsetTop; + var style = d.createElement('style'); style.innerHTML ='.invis {display:none}'; s.appendChild(style); Makes it pass. Now, the deeper issue here is what should happen when shadow roots are in a non-rendered document (in the sense of, what do media queries evaluate to, and such)...
status-firefox57=wontfix unless someone thinks this bug should block 57
Priority: -- → P3
Whiteboard: [stylo]
I fixed this a while ago.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.