Bug 280307
Summary: | Regression in Safari 18: all: revert-layer breaks due to style changes on parent elements | ||
---|---|---|---|
Product: | WebKit | Reporter: | Devon Govett <govett> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, bfulgham, koivisto, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 18 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=283942 |
Devon Govett
This is a very strange bug that started occurring in Safari 18 on both macOS and iOS. It appears to be related to cascade layers. See the reproduction here: https://codepen.io/devongovett/pen/gOJOVGo
Hovering over the outer element causes the color of the text to change, and unexpectedly, the width of the inner element collapses to zero. This appears to be due to the `all: revert-layer` rule applied to the inner element, which should simply revert to the previous cascade layer. The width should not be affected by the color change on the parent element.
This resulted in regressions to Adobe's component library, which relies on cascade layers. revert-layer is used to ensure external styles outside a layer do not apply. This worked correctly in previous versions of Safari, and works fine in Chrome and Firefox as well.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
@Devon - it seems that Safari Technology Preview 203 already matches with Chrome Canary 131 and Firefox Nightly 132 and does not collapse like Safari 18.1 Beta do. Can you test this as well on your end?
Devon Govett
Thanks! Yes, I can verify that it is broken in both 18.0 (20619.1.26.31.6) and 18.1 in macOS 15.1 Developer Beta 5 (20619.2.3.1), but works in Safari Tech Preview 203 (20620.1.6).
Any idea how much farther ahead tech preview is than 18.1? Any chance whatever fixed this could make it into the shipping version?
Alexey Proskuryakov
STP is not necessarily ahead of these Safari builds. This is an important data point, but it does not prove in itself that the issue is already fixed.
Radar WebKit Bug Importer
<rdar://problem/136976934>
Simon Fraser (smfr)
Could you convert https://codepen.io/devongovett/pen/gOJOVGo into a self-describing test? We can't tell if this is fixed.
Devon Govett
Sure, I updated it to have more description. Let me know if you're still not sure.
Simon Fraser (smfr)
The test passes in Safari Tech Preview 203, so I think this is fixed.
Devon Govett
Looks like this reproduction is fixed in Safari 18.2 beta, but there is still another broken case. I reported that as a separate issue here: https://bugs.webkit.org/show_bug.cgi?id=283942