Closed Bug 1702190 Opened 5 years ago Closed 3 years ago

[wpt-sync] Sync PR 28312 - Avoid calling RecalcLayoutOverflow() in Document::UpdateStyle() always

Categories

(Core :: Layout: Scrolling and Overflow, task, P4)

task

Tracking

()

RESOLVED INVALID

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

b'Manuel Rego Casasnovas <rego@igalia.com>' wrote:

Avoid calling RecalcLayoutOverflow() in Document::UpdateStyle() always

We can avoid calling RecalcLayoutOverflow() in Document::UpdateStyle()
if the tree is marked as needing layout, as the layout itself
will compute it.
However we cannot reuse the cached LayoutResult if the element needs
to recalc layout overflow.

This adds new tests that do two different things:

  • Add/remove an element to the DOM. Which causes the tree to be marked
    as needing layout.
  • Change a transform. Which marks things for layout overflow recalc.

So when Document::UpdateStyle() is called, we skip the call
to RecalcLayoutOverflow() (because it's marked for layout),
and then during layout we don't reuse the cached layout result
(because it's marked for recalc layout overflow),
otherwise we would get wrong results.

TEST=external/wpt/css/css-overflow/scrollable-overflow-transform-dynamic-004.html
TEST=external/wpt/css/css-overflow/scrollable-overflow-transform-dynamic-005.html

Change-Id: I6784339b37c142c724ae553be1ca1fd9bd77b234
Reviewed-on: https://chromium-review.googlesource.com/2795105
WPT-Export-Revision: 4b3f058adaf22534dfe20cc543ff96b591217720

Component: web-platform-tests → Layout: Scrolling and Overflow
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.