Closed Bug 1636358 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 23473 - Reland: "[FlexNG] Make ComputeMinMaxSizes cache more precise."

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Ian Kilpatrick <ikilpatrick@chromium.org> wrote:

Reland: "[FlexNG] Make ComputeMinMaxSizes cache more precise."

This is a reland of 044aeb3ed3364905cc185d67eb947c7ca3c13741

The initial patch was reverted due to an MSAN failure. This was caused
by MinMaxSizesResult::depends_on_percentage_block_size not being
initialized within the NGFieldsetLayoutAlgorithm.

This reland always initialises depends_on_percentage_block_size to false.

This also adds some documentation not present in the initial patch.

Original change's description:

Previously our cache was imprecise, we recalculate our min/max sizes
when we didn't strictly need to, as we didn't know if we'd have a
%-block-size replaced element beneath us.

This patch changes ComputeMinMaxSizes to return a MinMaxSizesResult
(instead of just MinMaxSizes). This contains an additional bit of
information to indicate if this sub-tree depended on the %-block-size
given to it.

For most things, this will return false. For legacy layout roots we
always assume that they have children which depend on the %-block-size
(and why we initialize:
intrinsic_logical_widths_depends_on_percentage_block_size_ to true).

Along with this change, the cache changes in the following way:

  • We store an addition bit of information on LayoutBox to store the bit
    of information from ComputeMinMaxSizes.
  • We calculate the %-block-size for our children up-front, this means
    each of the algorithms don't have to do this.
  • With these changes, the cache can now hit, when the %-block-size
    given to us changes.

\o/

Bug: 845235
Change-Id: I6c7e79c5ad787291ba2eeb4d1eebb5437f1934fb

Reviewed-on: https://chromium-review.googlesource.com/2189620
WPT-Export-Revision: 0f0b38fe5d146f227ac4e402d4b37f6136c9f1c4

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

CI Results

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

Total 2 tests

Status Summary

Firefox

PASS: 2

Chrome

PASS: 2

Safari

FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d8a478f5229 [wpt PR 23473] - Reland: "[FlexNG] Make ComputeMinMaxSizes cache more precise.", a=testonly
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/803e71597e6b [wpt PR 23473] - Reland: "[FlexNG] Make ComputeMinMaxSizes cache more precise.", a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.