diff options
5 files changed, 13 insertions, 248 deletions
diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index bf4266e1875..bbce33f3d52 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -111,6 +111,7 @@ impl HTMLStyleElement { win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap(); *self.stylesheet.borrow_mut() = Some(sheet); + self.cssom_stylesheet.set(None); doc.invalidate_stylesheets(); } diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json index 85498461e09..bb4ad32115b 100644 --- a/tests/wpt/metadata/MANIFEST.json +++ b/tests/wpt/metadata/MANIFEST.json @@ -553998,7 +553998,7 @@ "testharness" ], "cssom/style-sheet-interfaces-001.html": [ - "15509e87505d5a22d4f6dbbffcc90c24fcee642a", + "e77ec7de74baa901cc15a3b90d2b29125c282562", "testharness" ], "cssom/style-sheet-interfaces-002.html": [ diff --git a/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/semantics.html.ini b/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/semantics.html.ini deleted file mode 100644 index 804d84f3514..00000000000 --- a/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/semantics.html.ini +++ /dev/null @@ -1,29 +0,0 @@ -[semantics.html] - type: testharness - [@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in standards mode] - expected: FAIL - - [@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in standards mode] - expected: FAIL - - [@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in standards mode] - expected: FAIL - - [@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in quirks mode] - expected: FAIL - - [@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in quirks mode] - expected: FAIL - - [@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in quirks mode] - expected: FAIL - - [@namespace x 'http://www.w3.org/XML/1998/namespace'; [x|lang='A' i\] <div {http://www.w3.org/XML/1998/namespace}lang="a"> in XML] - expected: FAIL - - [@namespace x 'a'; [x|foo='' i\] <div {A}foo=""> in XML] - expected: FAIL - - [@namespace x 'A'; [x|foo='' i\] <div {a}foo=""> in XML] - expected: FAIL - diff --git a/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/syntax.html.ini b/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/syntax.html.ini deleted file mode 100644 index 3b4aa0649a8..00000000000 --- a/tests/wpt/metadata/selectors/attribute-selectors/attribute-case/syntax.html.ini +++ /dev/null @@ -1,218 +0,0 @@ -[syntax.html] - type: testharness - [[foo='BAR'\] /* sanity check (valid) */ in standards mode] - expected: FAIL - - [[foo='bar' i\] in standards mode] - expected: FAIL - - [[foo='bar' I\] in standards mode] - expected: FAIL - - [[foo=bar i\] in standards mode] - expected: FAIL - - [[foo="bar" i\] in standards mode] - expected: FAIL - - [[foo='bar'i\] in standards mode] - expected: FAIL - - [[foo='bar'i \] in standards mode] - expected: FAIL - - [[foo='bar' i \] in standards mode] - expected: FAIL - - [[foo='bar' /**/ i\] in standards mode] - expected: FAIL - - [[foo='bar' i /**/ \] in standards mode] - expected: FAIL - - [[foo='bar'/**/i/**/\] in standards mode] - expected: FAIL - - [[foo=bar/**/i\] in standards mode] - expected: FAIL - - [[foo='bar'\ti\t\] /* \\t */ in standards mode] - expected: FAIL - - [[foo='bar'\ni\n\] /* \\n */ in standards mode] - expected: FAIL - - [[foo='bar'\ri\r\] /* \\r */ in standards mode] - expected: FAIL - - [[foo='bar' \\i\] in standards mode] - expected: FAIL - - [[foo='bar' \\69\] in standards mode] - expected: FAIL - - [[foo~='bar' i\] in standards mode] - expected: FAIL - - [[foo^='bar' i\] in standards mode] - expected: FAIL - - [[foo$='bar' i\] in standards mode] - expected: FAIL - - [[foo*='bar' i\] in standards mode] - expected: FAIL - - [[foo|='bar' i\] in standards mode] - expected: FAIL - - [[|foo='bar' i\] in standards mode] - expected: FAIL - - [[*|foo='bar' i\] in standards mode] - expected: FAIL - - [[foo='BAR'\] /* sanity check (valid) */ in quirks mode] - expected: FAIL - - [[foo='bar' i\] in quirks mode] - expected: FAIL - - [[foo='bar' I\] in quirks mode] - expected: FAIL - - [[foo=bar i\] in quirks mode] - expected: FAIL - - [[foo="bar" i\] in quirks mode] - expected: FAIL - - [[foo='bar'i\] in quirks mode] - expected: FAIL - - [[foo='bar'i \] in quirks mode] - expected: FAIL - - [[foo='bar' i \] in quirks mode] - expected: FAIL - - [[foo='bar' /**/ i\] in quirks mode] - expected: FAIL - - [[foo='bar' i /**/ \] in quirks mode] - expected: FAIL - - [[foo='bar'/**/i/**/\] in quirks mode] - expected: FAIL - - [[foo=bar/**/i\] in quirks mode] - expected: FAIL - - [[foo='bar'\ti\t\] /* \\t */ in quirks mode] - expected: FAIL - - [[foo='bar'\ni\n\] /* \\n */ in quirks mode] - expected: FAIL - - [[foo='bar'\ri\r\] /* \\r */ in quirks mode] - expected: FAIL - - [[foo='bar' \\i\] in quirks mode] - expected: FAIL - - [[foo='bar' \\69\] in quirks mode] - expected: FAIL - - [[foo~='bar' i\] in quirks mode] - expected: FAIL - - [[foo^='bar' i\] in quirks mode] - expected: FAIL - - [[foo$='bar' i\] in quirks mode] - expected: FAIL - - [[foo*='bar' i\] in quirks mode] - expected: FAIL - - [[foo|='bar' i\] in quirks mode] - expected: FAIL - - [[|foo='bar' i\] in quirks mode] - expected: FAIL - - [[*|foo='bar' i\] in quirks mode] - expected: FAIL - - [[foo='BAR'\] /* sanity check (valid) */ in XML] - expected: FAIL - - [[foo='bar' i\] in XML] - expected: FAIL - - [[foo='bar' I\] in XML] - expected: FAIL - - [[foo=bar i\] in XML] - expected: FAIL - - [[foo="bar" i\] in XML] - expected: FAIL - - [[foo='bar'i\] in XML] - expected: FAIL - - [[foo='bar'i \] in XML] - expected: FAIL - - [[foo='bar' i \] in XML] - expected: FAIL - - [[foo='bar' /**/ i\] in XML] - expected: FAIL - - [[foo='bar' i /**/ \] in XML] - expected: FAIL - - [[foo='bar'/**/i/**/\] in XML] - expected: FAIL - - [[foo=bar/**/i\] in XML] - expected: FAIL - - [[foo='bar'\ti\t\] /* \\t */ in XML] - expected: FAIL - - [[foo='bar'\ni\n\] /* \\n */ in XML] - expected: FAIL - - [[foo='bar'\ri\r\] /* \\r */ in XML] - expected: FAIL - - [[foo='bar' \\i\] in XML] - expected: FAIL - - [[foo='bar' \\69\] in XML] - expected: FAIL - - [[foo~='bar' i\] in XML] - expected: FAIL - - [[foo^='bar' i\] in XML] - expected: FAIL - - [[foo$='bar' i\] in XML] - expected: FAIL - - [[foo*='bar' i\] in XML] - expected: FAIL - - [[foo|='bar' i\] in XML] - expected: FAIL - - [[|foo='bar' i\] in XML] - expected: FAIL - - [[*|foo='bar' i\] in XML] - expected: FAIL - diff --git a/tests/wpt/web-platform-tests/cssom/style-sheet-interfaces-001.html b/tests/wpt/web-platform-tests/cssom/style-sheet-interfaces-001.html index 3f4956cb3ad..fb1fde86eff 100644 --- a/tests/wpt/web-platform-tests/cssom/style-sheet-interfaces-001.html +++ b/tests/wpt/web-platform-tests/cssom/style-sheet-interfaces-001.html @@ -61,6 +61,17 @@ assert: [ "styleElement.sheet exists", "styleElement.sheet is a CSSStyleSheet", "linkElement.sheet exists", "linkElement.sheet is a CSSStyleSheet"] }); + test(function () { + var style = document.createElement("style"); + document.querySelector("head").appendChild(style); + var sheet1 = style.sheet; + assert_equals(sheet1.cssRules.length, 0); + style.appendChild(document.createTextNode("a { color: green; }")); + assert_equals(style.sheet.cssRules.length, 1); + }, "sheet_property_updates", + { help: "https://www.w3.org/TR/cssom-1/#the-linkstyle-interface", + assert: "The sheet property on LinkStyle should always return the current associated style sheet." }); + test(function() { assert_own_property(styleSheet, "ownerRule"); assert_own_property(styleSheet, "cssRules"); |