mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Bug 1672640 part 3: Adjust GetNaturalBaselineBOffset implementations to bail (report no baseline) if the frame has 'contain:layout'. r=TYLin, a=RyanVM
Some of our GetNaturalBaselineBOffset implementations already have this; others don't. But they all should have it, or else a caller might improperly query their baseline and use it for layout despite the frame having 'contain:layout'. Without this patch, the rest of this patch-stack makes us fail WPT test contain-layout-suppress-baseline-002.html because we improperly honor the baseline for the 'contain:layout' buttons at the top of the test. Differential Revision: https://phabricator.services.mozilla.com/D121938
This commit is contained in:
parent
3988a4192d
commit
459c813004
@ -334,6 +334,10 @@ bool nsHTMLButtonControlFrame::GetVerticalAlignBaseline(
|
||||
bool nsHTMLButtonControlFrame::GetNaturalBaselineBOffset(
|
||||
mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const {
|
||||
if (StyleDisplay()->IsContainLayout()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsIFrame* inner = mFrames.FirstChild();
|
||||
if (MOZ_UNLIKELY(inner->GetWritingMode().IsOrthogonalTo(aWM))) {
|
||||
return false;
|
||||
|
@ -575,14 +575,14 @@ nscoord nsBlockFrame::GetLogicalBaseline(WritingMode aWM) const {
|
||||
bool nsBlockFrame::GetNaturalBaselineBOffset(
|
||||
mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const {
|
||||
if (aBaselineGroup == BaselineSharingGroup::First) {
|
||||
return nsLayoutUtils::GetFirstLineBaseline(aWM, this, aBaseline);
|
||||
}
|
||||
|
||||
if (StyleDisplay()->IsContainLayout()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aBaselineGroup == BaselineSharingGroup::First) {
|
||||
return nsLayoutUtils::GetFirstLineBaseline(aWM, this, aBaseline);
|
||||
}
|
||||
|
||||
for (ConstReverseLineIterator line = LinesRBegin(), line_end = LinesREnd();
|
||||
line != line_end; ++line) {
|
||||
if (line->IsBlock()) {
|
||||
|
@ -173,7 +173,8 @@ class nsFlexContainerFrame final : public nsContainerFrame {
|
||||
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
|
||||
BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const override {
|
||||
if (HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) {
|
||||
if (StyleDisplay()->IsContainLayout() ||
|
||||
HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) {
|
||||
return false;
|
||||
}
|
||||
*aBaseline = aBaselineGroup == BaselineSharingGroup::First
|
||||
|
@ -143,7 +143,8 @@ class nsGridContainerFrame final : public nsContainerFrame {
|
||||
bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
|
||||
BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const override {
|
||||
if (HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) {
|
||||
if (StyleDisplay()->IsContainLayout() ||
|
||||
HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) {
|
||||
return false;
|
||||
}
|
||||
return GetBBaseline(aBaselineGroup, aBaseline);
|
||||
|
@ -3641,6 +3641,10 @@ nscoord nsTableFrame::GetLogicalBaseline(WritingMode aWM) const {
|
||||
bool nsTableFrame::GetNaturalBaselineBOffset(
|
||||
WritingMode aWM, BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aBaseline) const {
|
||||
if (StyleDisplay()->IsContainLayout()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
RowGroupArray orderedRowGroups;
|
||||
OrderRowGroups(orderedRowGroups);
|
||||
// XXX not sure if this should be the size of the containing block instead.
|
||||
|
Loading…
x
Reference in New Issue
Block a user