Skip to content

Commit be7f7a5

Browse files
lilleschromium-wpt-export-bot
authored andcommitted
Check for element dependent components in DOMMatrix constructor
We should throw a SyntaxError for lengths which are not absolute. The DOMMatrix spec pre-dates (or ignores) sign() and sibling-index(), but we should also throw for numbers that rely on relative lengths or tree counts. This CL fixes the issue for tree counting functions, but only adds tests for relative lengths inside sign(). Bug: 415838619 Change-Id: I56250ee63db207414247e3b246dbbc3d862117c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6517597 Reviewed-by: Daniil Sakhapov Commit-Queue: Rune Lillesveen Cr-Commit-Position: refs/heads/main@{#1456995}
1 parent 8f5178c commit be7f7a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

css/geometry/DOMMatrix-001.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@
113113
['translateX (5px)',
114114
'scale(2 2) translateX(5) translateY(5)',
115115
'scale(2, 2), translateX(5) ,translateY(5)',
116+
'scale(sign(1em))',
117+
'scale(sibling-index())',
116118
'translateX(5em)',
117119
'translateX(5ex)',
118120
'translateX(5ch)',
@@ -130,10 +132,14 @@
130132
'translateX(5vmin)',
131133
'translateX(5vmax)',
132134
'translateX(5%)',
135+
'translateX(calc(10px * sign(1em - 10px)))',
136+
'translateX(calc(10px * sibling-index()))',
133137
'rotate(5)',
134138
'rotate(5, 5, 5)',
135139
'rotate(5, 5px, 5px)',
136140
'rotate(5deg, 5px, 5px)',
141+
'rotate(calc(5deg * sign(1em - 10px)))',
142+
'rotate(calc(5deg * sibling-index()))',
137143
' ',
138144
'/**/',
139145
'\0',

0 commit comments

Comments
 (0)