Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 is 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/c/chromium/src/+/3620574 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/main@{#999325}
- Loading branch information