Skip to content

Commit

Permalink
Bug 1623347 [wpt PR 22318] - [css-variables] Custom props with invali…
Browse files Browse the repository at this point in the history
…d var() should behave as 'unset', a=testonly

Automatic update from web-platform-tests
[css-variables] Custom props with invalid var() should behave as 'unset'

We currently have a (WPT-enforced) bug where custom properties that
reference guaranteed-invalid values [1] behave themselves as guaranteed-
invalid. This is not correct per spec, which requires the custom
property to behave as 'unset' in this case. This was clarified in [2],
although the spec has described this behavior long before that.

Unfortunately Firefox has the same issue. Safari on the other hand, does
implement it correctly.

[1] https://drafts.csswg.org/css-variables/#guaranteed-invalid
[2] w3c/csswg-drafts#4075

Bug: 980930
Change-Id: I84a0da3aad6b72b574009d560eb868632769098a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108026
Commit-Queue: Anders Hartvoll Ruud <andruudchromium.org>
Reviewed-by: Xiaocheng Hu <xiaochenghchromium.org>
Cr-Commit-Position: refs/heads/master{#751636}

--

wpt-commits: fc793094912b67b45a94d101819bffb9b9307710
wpt-pr: 22318

UltraBlame original commit: aaae9e1c209687addde4400f03ab390667307b15
  • Loading branch information
marco-c committed Mar 23, 2020
1 parent db9af61 commit f7c824e
Show file tree
Hide file tree
Showing 3 changed files with 1,918 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,18 @@
<
style
>
body
#
parent
{
-
-
var1
:
inherited
;
}
#
child
{
-
-
Expand All @@ -115,6 +126,15 @@
width
)
;
-
-
var1
:
env
(
nonexistent
)
;
}
<
/
Expand All @@ -128,6 +148,30 @@
body
>
<
div
id
=
"
parent
"
>
<
div
id
=
"
child
"
>
<
/
div
>
<
/
div
>
<
script
>
test
Expand All @@ -144,9 +188,7 @@
.
getComputedStyle
(
document
.
body
child
)
;
assert_equals
Expand All @@ -165,6 +207,64 @@
)
;
}
'
env
(
)
is
substituted
into
a
custom
property
'
)
;
test
(
(
)
=
>
{
const
style
=
window
.
getComputedStyle
(
child
)
;
assert_equals
(
style
.
getPropertyValue
(
"
-
-
var1
"
)
"
inherited
"
)
;
}
'
Substitution
of
unrecognized
env
(
)
causes
unset
'
)
;
<
Expand Down
Loading

0 comments on commit f7c824e

Please sign in to comment.