Closed Bug 1494100 Opened 6 years ago Closed 6 years ago

Implement "contain:size" property for ColumnSetWrapperFrame

Categories

(Core :: Layout: Columns, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

This is a spin-off from bug 1421105 Part 4 to reduce the scope of the original bug. See [1] for my previous (failed) attempt, and those comments for the right direction. [1] https://phabricator.services.mozilla.com/D5211

The functions move to ColumnUtils will be used by ColumnSetWrapperFrame
to implement GetPrefISize() and GetMinISize().

Also, I verify locally that non-unified build is still working by
s/UNIFIED_SOURCES/SOURCES/ in layout/generic/moz.build.

If column-span is enabled, nsColumnSetFrame becomes an inner frame under
ColumnSetWrapperFrame, so it cannot perceive the contain property.

This patch doesn't change the logic but make the logic easier to
simplify once we start eliminating column-span pref.

Depends on D29614

This patch replicates some of the logic that calculates intrinsic size
from nsColumnSetFrame because when column-width is non-auto or
"contain:size" is used, they have a priority, and no column box's
intrinsic size is required.

nsColumnSetFrame inherits all the column styles from
ColumnSetWrapperFrame (in ua.css), so when column box's intrinsic size
is required, we can still defer the calculation to nsColumnSetFrame.

Note it may be worth to reuse nsBlockFrame's mPrefWidth and mMinWidth to
cache intrinsic size for ColumnSetWrapperFrame, but this can be done
separately.

Depends on D29615

I morph this bug for implementing "contain:size" because I'm not sure what needs to be done to implement contain:layout in ColumnSetWrapperFrame, and I don't see any IsContainLayout() in nsColumnSetFrame.

Assignee: nobody → aethanyc
No longer blocks: css-contain-layout
Status: NEW → ASSIGNED
Summary: Implement "contain" property for ColumnSetWrapperFrame → Implement "contain:size" property for ColumnSetWrapperFrame

(In reply to Ting-Yu Lin [:TYLin] (UTC-7) from comment #4)

I morph this bug for implementing "contain:size" because I'm not sure what needs to be done to implement contain:layout in ColumnSetWrapperFrame, and I don't see any IsContainLayout() in nsColumnSetFrame.

I think the main per-frame-class contain:layout functionality is to behave as if you have no baseline. And ColumnSetWrapperFrame probably gets that for free by virtue of inheriting nsBlockFrame's Reflow method and baseline getters.

Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/e77c2a2c5d82 Part 1 - Create ColumnUtils, and extract utility functions in nsColumnSetFrame into it. r=dholbert https://hg.mozilla.org/integration/autoland/rev/93fd1b5a5a02 Part 2 - Check column-span pref before checking the size containment in nsColumnSetFrame. r=dholbert https://hg.mozilla.org/integration/autoland/rev/6cc70607d8af Part 3 - Implement "contain:size" for ColumnSetWrapperFrame. r=dholbert
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Regressions: 1550729
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16883 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: