Closed Bug 1767601 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 33929 - Avoiding writing layout-modified ComputedStyle back to Node

Categories

(Core :: Layout: Tables, task, P4)

task

Tracking

()

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 33929 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/33929
Details from upstream follow.

Anders Hartvoll Ruud <andruud@chromium.org> wrote:

Avoiding writing layout-modified ComputedStyle back to Node

The base-computed-style-optimization expects that the cached base
style (as produced by StyleResolver) is the same style we would get
if we produced the style from scratch. However, this assumption does
not hold for certain legacy LayoutObjects, where the ComputedStyle
is modified outside of style recalc, during DidStyleChange,.

Writing that modified ComputedStyle back to the Node also a
correctness issue: we end up with the wrong output from
getComputedStyle.

This CL changes non-TextAutoSizer calls of
SetModifiedStyleOutsideStyleRecalc (writes ComputedStyle back to
Node), to just SetStyle (does not write ComputedStyle back to Node).

In order to ensure that we don't skip a critical DidStyleChange call,
we force ApplyStyleChanges::kYes during Element::RecalcOwnStyle, if
the LayoutObject::SetStyle happens on a relevant legacy LayoutObject
under the conditions that would require a style-fixup in
DidStyleChange. Duplicating those conditions there is not ideal, but
that problem will automatically go away once the legacy code is
removed.

Fixed: 1307976
Change-Id: I8461c9d53e6e316f1bcd8a0002640b56b4cf0f87
Reviewed-on: https://chromium-review.googlesource.com/3620574
WPT-Export-Revision: 62383a4355272f308785debc8085587b606d34bf

Component: web-platform-tests → Layout: Tables
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Safari on GitHub CI

Total 2 tests and 5 subtests

Status Summary

Safari

OK : 2
PASS: 5
FAIL: 1

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9c8214c594b8
[wpt PR 33929] - Avoiding writing layout-modified ComputedStyle back to Node, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.