[wpt-sync] Sync PR 42425 - Avoid CustomStyleForAltText during ResolveStyle
Categories
(Core :: Layout: Generated Content, Lists, and Counters, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox121 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 42425 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/42425
Details from upstream follow.
Anders Hartvoll Ruud <andruud@chromium.org> wrote:
Avoid CustomStyleForAltText during ResolveStyle
During HTMLImageElement::AdjustStyle, we do something very shady:
we poke into the UA shadow and mutate the inline style of some
of the elements in there. This causes style to be marked dirty
during style recalc, which is not a desirable situation.
The behavior would normally trigger a DCHECK, but it is currently
suppressed with by AllowMarkStyleDirtyFromRecalcScope.Marking style dirty deeper in the current subtree works (sort of),
because we'll eventually reach those elements during the current
style recalc process anyway, so ultimately the dirtiness is
cleared. However, StyleResolver::ResolveStyle can also be called
outside of style recalc. For example, when producing styles
for kFirstLineInherited, we call ResolveStyle during layout.
In this case, there is no greater style recalc process ongoing,
so the dirtiness isn't cleared, and we trigger DCHECKs
(Issue 1486128).This CL avoids the issue by reintroducing InputTypeView::
CustomStyleForLayoutObject, and making ImageInputType use that
mechanism instead of AdjustStyle. (Effectively a partial revert
of CL:4110875). This avoids the crash by relying on another bug:
when producing kFirstLineInherited styles, we ignore custom styles,
i.e. CustomStyleForLayoutObject never gets called (but AdjustStyle
does).Bug: 953707
Change-Id: I4ec71ed2b23fe494d06ee80d71990040a94e9f98
Fixed: 1486128
Reviewed-on: https://chromium-review.googlesource.com/4921811
WPT-Export-Revision: 95f0e2ba6bca1ac68ab78783cf171b703e12dad8
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 3•2 years ago
|
||
Comment 4•2 years ago
|
||
| bugherder | ||
Description
•