CSSStyleSheet-constructable.html

FAILExpected11 of 32 subtests pass1,115 ms

Details

Test
/css/cssom/CSSStyleSheet-constructable.html
Harness
OK

Subtests

StatusSubtestMessage
PASSdocument.adoptedStyleSheets should initially have length 0.
FAILnew CSSStyleSheet produces empty CSSStyleSheet
assert_equals: expected 2 but got 0
assert_equals: expected 2 but got 0
PASStitle can be set in the CSSStyleSheet constructor
FAILCSSStyleSheet.replace produces Promise<CSSStyleSheet>
assert_equals: expected 2 but got 0
assert_equals: expected 2 but got 0
FAILConstructed style sheets can be applied on document
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 255, 255)"
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 255, 255)"
FAILConstructed style sheets can be applied on shadow root
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 255, 255)"
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 255, 255)"
FAILRe-attaching shadow host with adopted stylesheets work
assert_equals: Style applies connected expected "rgb(0, 128, 0)" but got "rgb(255, 255, 255)"
assert_equals: Style applies connected expected "rgb(0, 128, 0)" but got "rgb(255, 255, 255)"
FAILAttaching a shadow root that already has adopted stylesheets work
assert_equals: Style applies when connected expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: Style applies when connected expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
FAILRe-attaching shadow host and updating attributes work
assert_equals: Style applies after adding style expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: Style applies after adding style expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
PASSChanges to constructed stylesheets through CSSOM is reflected
FAILConstructed stylesheet can be used and modified in multiple TreeScopes
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
FAILStylesheets constructed on the main Document cannot be used in iframes
assert_throws_dom: function "() => { iframe.contentDocument.adoptedStyleSheets = [redStyleSheet]; }" did not throw
assert_throws_dom: function "() => { iframe.contentDocument.adoptedStyleSheets = [redStyleSheet]; }" did not throw
FAILStylesheet constructed on iframe cannot be used in the main Document
assert_equals: expected "rgb(0, 0, 0)" but got ""
assert_equals: expected "rgb(0, 0, 0)" but got ""
FAILAdding non-constructed stylesheet to AdoptedStyleSheets is not allowed when the owner document of the stylesheet is in the same document tree as the AdoptedStyleSheets
assert_throws_dom: function "() => { document.adoptedStyleSheets = [nonConstructedStyleSheet]; }" did not throw
assert_throws_dom: function "() => { document.adoptedStyleSheets = [nonConstructedStyleSheet]; }" did not throw
FAILAdding non-constructed stylesheet to AdoptedStyleSheets is not allowed when the owner document of the stylesheet and the AdoptedStyleSheets are in different document trees
iframeDiv.classList.add is not a function
iframeDiv.classList.add is not a function
PASSCSSStyleSheet.replaceSync replaces stylesheet text synchronously
FAILCSSStyleSheet.replaceSync correctly updates the style of its adopters synchronously
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
FAILAdopted sheets are ordered after non-adopted sheets in the shadow root
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
FAILAdopted sheets are ordered after non-adopted sheets in the document
assert_equals: non-adopted styles should be ordered before adopted styles expected "rgb(255, 0, 0)" but got "rgb(255, 255, 255)"
assert_equals: non-adopted styles should be ordered before adopted styles expected "rgb(255, 0, 0)" but got "rgb(255, 255, 255)"
PASSInserting an @import rule through insertRule on a constructed stylesheet throws an exception
FAILCSSStyleSheet.replaceSync should not trigger any loads from @import rules
assert_equals: There should be only one entry for the import URL expected 1 but got 0
assert_equals: There should be only one entry for the import URL expected 1 but got 0
FAILCSSStyleSheet.replace allows, but ignores, import rule inside
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 0, 0)"
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 0, 0)"
FAILCSSStyleSheet.replace ignores @import rule but still loads other rules
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 0, 0)"
assert_equals: expected "rgb(0, 0, 0)" but got "rgb(255, 0, 0)"
PASSCSSStyleSheet.replaceSync allows, but ignores, import rule inside
PASSCSSStyleSheet.replace does not reject on failed imports
PASSCloning a shadow host will not clone shadow root, and also adoptedStyleSheets
FAILImporting a shadow host will not copy shadow root, and also adoptedStyleSheets
iframe.contentDocument.importNode is not a function
iframe.contentDocument.importNode is not a function
FAILAdopting a shadow host will empty adoptedStyleSheets if adopting to a different document
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
FAILAdopting a shadow host's ancestor will empty adoptedStyleSheets if adopting to a different document
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
assert_equals: expected "rgb(255, 0, 0)" but got "rgb(0, 0, 0)"
PASSForcing a style update after adding an adopted stylesheet on a disconnected shadow root should not crash.
PASSModifying an adopted stylesheet on a disconnected shadow root should not crash.
PASSConstructing a sheet with the default base URL uses the constructor document's base URL for CSS rules