mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 70df598b894bfa4a7122720608a3110cb25ceb42
This commit is contained in:
parent
7f495fdd61
commit
4334a9c855
111 changed files with 3428 additions and 315 deletions
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence.")
|
||||
// 'inputArguments' property is a string, not a sequence.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': Invalid argument types.")
|
||||
// 'non-sense-type' is not a proper name of CSS properties.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ try {
|
|||
registerPaint('foo', class { paint() { } });
|
||||
registerPaint('foo', class { paint() { } });
|
||||
} catch(ex) {
|
||||
if (ex.name == "NotSupportedError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': A class with name:'foo' is already registered.")
|
||||
// 'foo' gets registered twice.
|
||||
if (ex.name == 'InvalidModificationError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ var testsPassed = false;
|
|||
try {
|
||||
registerPaint('', class { });
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The empty string is not a valid name.")
|
||||
// The empty string is not a valid name.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The provided value cannot be converted to a sequence.")
|
||||
// 'inputProperties' property is 42, not a sequence<DOMString>.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ try {
|
|||
a.prototype = undefined;
|
||||
registerPaint('foo5', a);
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' object on the class does not exist.")
|
||||
// The prototype object is undefined, not an object.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,8 @@ try {
|
|||
b.prototype = 42;
|
||||
registerPaint('foo6', b);
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'prototype' property on the class is not an object.")
|
||||
// The prototype object is 42, not an object.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,8 @@ var testsPassed = false;
|
|||
try {
|
||||
registerPaint('foo7', class { });
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype does not exist.")
|
||||
// 'paint' property doesn't exist on the prototype chain.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype is not a function.")
|
||||
// 'paint' property's value is 42, not a function.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,8 @@ try {
|
|||
}
|
||||
});
|
||||
} catch(ex) {
|
||||
if (ex.name == "TypeError" && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': cannot convert to dictionary.")
|
||||
// 'contextOptions' property is 42, not a dictionary.
|
||||
if (ex.name == 'TypeError')
|
||||
testsPassed = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(-50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(-100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(-50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: ltr; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(-100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: left;"></div>
|
||||
<div id=abs style="transform: translateX(100%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: right;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(0%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: center;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(50%);"></div>
|
||||
</div>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="help" href="https://drafts.csswg.org/css2/visudet.html#abs-non-replaced-width" />
|
||||
<link rel="match" href="../../reference/ref-filled-green-100px-square-only.html">
|
||||
<meta name="assert" content="Tests the static position of inline-level absolute-positioned elements, with combinations of float, direction, and text-align." />
|
||||
<style>
|
||||
#container { position: relative; background: red; width: 100px; height: 100px; }
|
||||
#container > div { background: green; }
|
||||
#inflow { height: 50px; }
|
||||
#float { float: left; width: 50px; height: 50px; }
|
||||
#abs { display: inline; position: absolute; width: 50px; height: 50px; }
|
||||
</style>
|
||||
<p>Test passes if there is a filled green square.</p>
|
||||
<div id=container style="direction: rtl; text-align: left;">
|
||||
<div id=inflow></div>
|
||||
<div id=float style="float: right;"></div>
|
||||
<div id=abs style="transform: translateX(100%);"></div>
|
||||
</div>
|
|
@ -228,6 +228,41 @@ promise_test(() => {
|
|||
});
|
||||
}, 'Re-attaching shadow host with adopted stylesheets work');
|
||||
|
||||
test(() => {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(":host { color: red; }");
|
||||
const host = document.createElement("div");
|
||||
let sr = host.attachShadow({mode: "open"});
|
||||
sr.adoptedStyleSheets = [sheet];
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies when connected");
|
||||
sheet.replaceSync(":host { color: blue; }");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 255)", "Style update applies when connected");
|
||||
}, 'Attaching a shadow root that already has adopted stylesheets work');
|
||||
|
||||
test(() => {
|
||||
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(":host([red]) { color: red; } :host(.blue) { color: blue; }");
|
||||
const host = document.createElement("div");
|
||||
host.toggleAttribute("red");
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "No style applies yet");
|
||||
|
||||
let sr = host.attachShadow({mode: "open"});
|
||||
sr.adoptedStyleSheets = [sheet];
|
||||
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies after adding style");
|
||||
document.body.removeChild(host);
|
||||
document.body.appendChild(host);
|
||||
assert_equals(getComputedStyle(host).color, "rgb(255, 0, 0)", "Style applies after reattachment");
|
||||
host.toggleAttribute("red");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 0)", "Attribute updates to the element after reattachment apply");
|
||||
host.classList.toggle("blue");
|
||||
assert_equals(getComputedStyle(host).color, "rgb(0, 0, 255)", "Class updates to the element after reattachment apply");
|
||||
|
||||
}, "Re-attaching shadow host and updating attributes work");
|
||||
|
||||
promise_test(() => {
|
||||
const plainSheet = new CSSStyleSheet();
|
||||
const redStyleSheetPromise = plainSheet.replace(redStyleTexts[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue