forked from mirrors/gecko-dev
Automatic update from web-platform-tests
Add 'no url function' support in css image-set
Currently, if the url of an image-set option is specified as a string
without the 'url()' function notation, parsing fails.
Based on the spec, the url can be just a string.
Spec definition:
"The syntax for image-set() is:
<image-set()> = image-set( <image-set-option># )
<image-set-option> = [ <image> | <string> ]
[ <resolution> || type(<string>) ]
Each <string> inside image-set() represents a <url>."
https://w3c.github.io/csswg-drafts/css-images-4/#image-set-notation
With this change Chrome will match the spec as well as Firefox for
both standard and '-webkit-' prefixed syntax.
Safari does not allow empty strings for standard syntax, and does not
allow strings for '-webkit-' prefixed syntax because of [1] and fixed
in [2].
The issue observed in Safari of "showing the missing image icon" is
not observed in Chrome.
[1] https://bugs.webkit.org/show_bug.cgi?id=206909
[2] bfc08b19e2
R=futhark, masonf, pdr, nrosenthal
Bug: 1400901
Change-Id: Iaf7e4b3128153664f3d311384b77b025d27bbf6e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4179000
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Traian Captan <tcaptan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1095212}
--
wpt-commits: 8b30abf7576afc14a61cc7e1e8679d9be6eea86e
wpt-pr: 38071
108 lines
3.3 KiB
HTML
108 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>CSS UI Level 4: parsing cursor with valid values</title>
|
|
<link rel="author" title="Eric Willigers" href="mailto:ericwilligers@chromium.org">
|
|
<link rel="help" href="https://drafts.csswg.org/css-ui-4/#cursor">
|
|
<meta name="assert" content="cursor supports the full required grammar.">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/css/support/parsing-testcommon.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
test_valid_value("cursor", "auto");
|
|
test_valid_value("cursor", "default");
|
|
test_valid_value("cursor", "none");
|
|
test_valid_value("cursor", "context-menu");
|
|
test_valid_value("cursor", "help");
|
|
test_valid_value("cursor", "pointer");
|
|
test_valid_value("cursor", "progress");
|
|
test_valid_value("cursor", "wait");
|
|
test_valid_value("cursor", "cell");
|
|
test_valid_value("cursor", "crosshair");
|
|
test_valid_value("cursor", "text");
|
|
test_valid_value("cursor", "vertical-text");
|
|
test_valid_value("cursor", "alias");
|
|
test_valid_value("cursor", "copy");
|
|
test_valid_value("cursor", "move");
|
|
test_valid_value("cursor", "no-drop");
|
|
test_valid_value("cursor", "not-allowed");
|
|
test_valid_value("cursor", "grab");
|
|
test_valid_value("cursor", "grabbing");
|
|
test_valid_value("cursor", "e-resize");
|
|
test_valid_value("cursor", "n-resize");
|
|
test_valid_value("cursor", "ne-resize");
|
|
test_valid_value("cursor", "nw-resize");
|
|
test_valid_value("cursor", "s-resize");
|
|
test_valid_value("cursor", "se-resize");
|
|
test_valid_value("cursor", "sw-resize");
|
|
test_valid_value("cursor", "w-resize");
|
|
test_valid_value("cursor", "ew-resize");
|
|
test_valid_value("cursor", "ns-resize");
|
|
test_valid_value("cursor", "nesw-resize");
|
|
test_valid_value("cursor", "nwse-resize");
|
|
test_valid_value("cursor", "col-resize");
|
|
test_valid_value("cursor", "row-resize");
|
|
test_valid_value("cursor", "all-scroll");
|
|
test_valid_value("cursor", "zoom-in");
|
|
test_valid_value("cursor", "zoom-out");
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'url("https://example.com/"), alias',
|
|
[
|
|
'url("https://example.com/"), alias',
|
|
'url(https://example.com/), alias'
|
|
]
|
|
);
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'url("https://example.com/") 1 calc(2 + 0), copy',
|
|
[
|
|
'url("https://example.com/") 1 calc(2), copy',
|
|
'url("https://example.com/") 1 2, copy',
|
|
'url(https://example.com/) 1 2, copy'
|
|
]
|
|
);
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'url("https://example.com/"), url("https://example.com/") 3 -4, move',
|
|
[
|
|
'url("https://example.com/"), url("https://example.com/") 3 -4, move',
|
|
'url(https://example.com/), url(https://example.com/) 3 -4, move'
|
|
]
|
|
);
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'url("https://example.com/") 5 6, grab',
|
|
[
|
|
'url("https://example.com/") 5 6, grab',
|
|
'url(https://example.com/) 5 6, grab'
|
|
]
|
|
);
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'image-set("https://example.com/" 1x) 5 6, grab',
|
|
[
|
|
'image-set(url("https://example.com/") 1x) 5 6, grab',
|
|
'image-set(url(https://example.com/) 1x) 5 6, grab'
|
|
]
|
|
);
|
|
|
|
test_valid_value(
|
|
"cursor",
|
|
'image-set("https://example.com/" 1x, "https://example.com/highres" 2x) 5 6, grab',
|
|
[
|
|
'image-set(url("https://example.com/") 1x, url("https://example.com/highres") 2x) 5 6, grab',
|
|
'image-set(url(https://example.com/) 1x, url(https://example.com/highres) 2x) 5 6, grab'
|
|
]
|
|
);
|
|
</script>
|
|
</body>
|
|
</html>
|