mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #17259 - jyc:new-CSSStyleSheet, r=emilio
Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes do not require tests because I'm pushing to find out what test results this changes; this is part of a series of PRs to fix bug #17182 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17259) <!-- Reviewable:end -->
This commit is contained in:
commit
7e493529f0
5 changed files with 13 additions and 248 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -553998,7 +553998,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"cssom/style-sheet-interfaces-001.html": [
|
||||
"15509e87505d5a22d4f6dbbffcc90c24fcee642a",
|
||||
"e77ec7de74baa901cc15a3b90d2b29125c282562",
|
||||
"testharness"
|
||||
],
|
||||
"cssom/style-sheet-interfaces-002.html": [
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue