Skip to content

Commit

Permalink
Bug 1858468 - Don't compute custom properties twice inside links. r=d…
Browse files Browse the repository at this point in the history
…shin

This matches the behavior of other browsers (in fact, I filed [1] about
it long time ago).

This avoids a bunch of overhead in some speedometer subtests. Makes me a
bit sad because I still think our approach is slightly more correct per
spec, but not worth the performance cost.

[1]: w3c/csswg-drafts#2263

Differential Revision: https://phabricator.services.mozilla.com/D190705

UltraBlame original commit: e136cc9893278df1df3e3b997b9e6756122b9c44
  • Loading branch information
marco-c committed Oct 17, 2023
1 parent 9c4aec9 commit 8e9ef3f
Show file tree
Hide file tree
Showing 5 changed files with 440 additions and 225 deletions.
33 changes: 33 additions & 0 deletions layout/reftests/css-visited/variables-visited-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<
!
doctype
html
>
<
style
>
a
{
color
:
green
;
}
<
/
style
>
<
a
href
=
"
"
>
Which
color
?
<
/
a
>
59 changes: 59 additions & 0 deletions layout/reftests/css-visited/variables-visited.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<
!
doctype
html
>
<
style
>
a
{
-
-
foo
:
green
;
}
:
visited
{
-
-
foo
:
red
;
color
:
var
(
-
-
foo
)
;
}
<
/
style
>
<
a
href
=
"
visited
-
page
.
html
"
>
Which
color
?
<
/
a
>
34 changes: 34 additions & 0 deletions layout/style/test/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,40 @@ css
-
visited
/
variables
-
visited
-
ref
.
html
"
"
/
layout
/
reftests
/
css
-
visited
/
variables
-
visited
.
html
"
"
/
layout
/
reftests
/
css
-
visited
/
visited
-
inherit
Expand Down
16 changes: 16 additions & 0 deletions layout/style/test/test_visited_reftests.html
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,22 @@
.
svg
"
"
=
=
variables
-
visited
.
html
variables
-
visited
-
ref
.
html
"
]
;
/
Expand Down
Loading

0 comments on commit 8e9ef3f

Please sign in to comment.