mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Update web-platform-tests to revision e2eb25aaa6dd3c512b172588f3400f9c25a410c3
This commit is contained in:
parent
3d4a416c6b
commit
8b66216ed2
484 changed files with 1945 additions and 1089 deletions
|
@ -0,0 +1,32 @@
|
|||
<!doctype html>
|
||||
<title>url whitespace consumption</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style>
|
||||
|
||||
.foo {}
|
||||
|
||||
</style>
|
||||
|
||||
<meta name=author title="Tab Atkins-Bittner">
|
||||
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-ident-like-token">
|
||||
|
||||
<script>
|
||||
|
||||
function roundTripUrl(input) {
|
||||
const rule = document.styleSheets[0].cssRules[0].style;
|
||||
const fallback = 'url("fallback")';
|
||||
rule.setProperty("background-image", fallback);
|
||||
rule.setProperty("background-image", input);
|
||||
const value = rule.getPropertyValue("background-image");
|
||||
if(value == fallback) return false;
|
||||
return value;
|
||||
}
|
||||
|
||||
test(()=>{
|
||||
assert_equals(roundTripUrl('url("foo")'), 'url("foo")');
|
||||
assert_equals(roundTripUrl('url( "foo")'), 'url("foo")');
|
||||
assert_equals(roundTripUrl('url("foo" )'), 'url("foo")');
|
||||
}, "whitespace is optional between url( token and the string token");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue