Closed Bug 1307806 Opened 10 years ago Closed 10 years ago

[css-grid][css-flexbox][css-align] Implement nsLayoutUtils::GetFirstLineBaseline for flex/grid containers.

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
OS: Unspecified → All
Priority: -- → P2
Hardware: Unspecified → All
Blocks: 1306894
Attached patch fix (obsolete) — — Splinter Review
(don't worry about the test failures, they are unrelated)
Attachment #8798166 - Flags: review?(dholbert)
BTW, we should probably add something to nsLayoutUtils::GetLastLineBaseline as well eventually, but I don't think it matters for now. Grid items that are grid containers are handled specially in the Grid code for now, and Flexbox layout doesn't implement last-baseline.
* yet. :-)
Comment on attachment 8798166 [details] [diff] [review] fix Review of attachment 8798166 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsLayoutUtils.cpp @@ +6212,5 @@ > + fType == nsGkAtoms::gridContainerFrame) { > + aResult->mBStart = 0; > + aResult->mBaseline = aFrame->GetLogicalBaseline(aWM); > + aResult->mBEnd = aFrame->BSize(aWM); > + return true; This looks identical to the contents of the "if (fType == nsGkAtoms::tableWrapperFrame)" case further up in this method. Should we just share that existing code here, and just broaden its "if" check a bit?
(Also: can we include tests for this change?)
Attached patch fix — — Splinter Review
Hopefully bug 1306894 will be fixed soon enough so we'll get a test that way. ;-) BTW, I asked Brad if he could take a look at that one - it seems like we should already have a baseline value somewhere in Flexbox layout that we can to store for that method to return, right?
Attachment #8798166 - Attachment is obsolete: true
Attachment #8798166 - Flags: review?(dholbert)
Attachment #8798207 - Flags: review?(dholbert)
Comment on attachment 8798207 [details] [diff] [review] fix Review of attachment 8798207 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! (Yeah, the flex container's baseline gets set (not-entirely-correctly) here: > aDesiredSize.SetBlockStartAscent(flexContainerAscent); https://dxr.mozilla.org/mozilla-central/source/layout/generic/nsFlexContainerFrame.cpp#4217 We could cache that on the frame in a member-variable, if that tends to match what we do elsewhere for storing baselines.)
Attachment #8798207 - Flags: review?(dholbert) → review+
Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/32aa05912bbb [css-grid][css-flexbox][css-align] Implement nsLayoutUtils::GetFirstLineBaseline for flex/grid containers. r=dholbert
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: