Repository navigation
Commit ba16551
committed
fix(css): read the value-time property guards by the same name
The declaration printer reads the unescaped name; the guards that decide
what a value may be rewritten to still read the source's spelling, so an
escaped name misses every table they look it up in.
`z-index` is the one that changes what a page renders rather than only
what it costs: `1.0` is not an `<integer>`, so `z-index:1.0` is a
declaration the engine drops — and `\7a -index:1.0` was normalized to `1`,
which turns it into one the engine applies. The others are the same missing
lookup with smaller stakes: a family list, a colour-only property, the
`-webkit-tap-highlight-color` special case.
Reading the unescaped name costs an `indexOf` on a short string; the guard
this is asked of most already memoizes its answer on the declaration.
Reported by CodeRabbit on this PR, and reproduced before fixing.1 parent caf4d77 commit ba16551
4 files changed
Lines changed: 49 additions & 8 deletions
File tree
- lib/css
- test/configCases/css/escaped-property-names
- __snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
323 | 327 | | |
324 | 328 | | |
325 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
326 | 332 | | |
327 | 333 | | |
328 | 334 | | |
| |||
332 | 338 | | |
333 | 339 | | |
334 | 340 | | |
335 | | - | |
| 341 | + | |
336 | 342 | | |
337 | 343 | | |
338 | 344 | | |
| |||
344 | 350 | | |
345 | 351 | | |
346 | 352 | | |
347 | | - | |
| 353 | + | |
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
| |||
377 | 383 | | |
378 | 384 | | |
379 | 385 | | |
380 | | - | |
| 386 | + | |
381 | 387 | | |
382 | 388 | | |
383 | 389 | | |
| |||
1299 | 1305 | | |
1300 | 1306 | | |
1301 | 1307 | | |
1302 | | - | |
| 1308 | + | |
| 1309 | + | |
1303 | 1310 | | |
1304 | 1311 | | |
1305 | 1312 | | |
| |||
1327 | 1334 | | |
1328 | 1335 | | |
1329 | 1336 | | |
1330 | | - | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1331 | 1340 | | |
1332 | 1341 | | |
1333 | 1342 | | |
| |||
1399 | 1408 | | |
1400 | 1409 | | |
1401 | 1410 | | |
1402 | | - | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1403 | 1414 | | |
1404 | 1415 | | |
1405 | 1416 | | |
| |||
1414 | 1425 | | |
1415 | 1426 | | |
1416 | 1427 | | |
1417 | | - | |
| 1428 | + | |
1418 | 1429 | | |
1419 | 1430 | | |
1420 | 1431 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments