Repository navigation
Commit f35c9d5
fix(lint): condition the negative-z message on the stacking context
Review nit, confirmed on rendered pixels rather than accepted on report.
The message asserted unconditionally that a negative z-index "is silently
dropped". That is false whenever any ancestor forms a stacking context, which
is a broad class of ordinary authoring.
Measured at 0.8.72 on one frame carrying the same `z-index: -1` band under six
different triggers:
isolation:isolate PRESENT, full coverage
transform PRESENT, full coverage
opacity below 1 PRESENT, full coverage
filter PRESENT, full coverage
contain:paint PRESENT, full coverage
will-change PRESENT, full coverage
no stacking context ABSENT, zero coverage <- the #4366 shape
That is ordinary CSS painting order: a negative-z child paints above its
stacking context root's own background, so only the root case is hidden. The
reviewer named `isolation: isolate`; the mechanism is any stacking context.
This rule matches CSS TEXT and does not resolve the cascade, so it cannot know
whether an ancestor forms one and will fire on both shapes. The message is
therefore now CONDITIONAL rather than an assertion of absence — an
unconditional claim is false for every isolated case, and a lint message that
overclaims is how authors learn to disregard the rule.
The measurement also produced a better `fixHint`: giving the parent a stacking
context is a real remedy and was not previously offered, only DOM reordering
was.
Two tests pin the correction; restoring the unconditional wording fails exactly
those two.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>1 parent b806b2b commit f35c9d5
2 files changed
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2205 | 2205 | | |
2206 | 2206 | | |
2207 | 2207 | | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
2208 | 2239 | | |
2209 | 2240 | | |
2210 | 2241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
| 301 | + | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
306 | 309 | | |
307 | 310 | | |
308 | 311 | | |
| |||
705 | 708 | | |
706 | 709 | | |
707 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
708 | 727 | | |
709 | 728 | | |
710 | 729 | | |
| |||
0 commit comments