mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1571135 - Remove the preference that controls breaking floats inside columns. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D40587 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a343bb4dd9
commit
83d9aa16f4
@ -26,9 +26,6 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::layout;
|
||||
|
||||
static bool sFloatFragmentsInsideColumnEnabled;
|
||||
static bool sFloatFragmentsInsideColumnPrefCached;
|
||||
|
||||
BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
|
||||
nsPresContext* aPresContext,
|
||||
nsBlockFrame* aFrame, bool aBStartMarginRoot,
|
||||
@ -46,15 +43,6 @@ BlockReflowInput::BlockReflowInput(const ReflowInput& aReflowInput,
|
||||
mLineNumber(0),
|
||||
mFloatBreakType(StyleClear::None),
|
||||
mConsumedBSize(aConsumedBSize) {
|
||||
if (!sFloatFragmentsInsideColumnPrefCached) {
|
||||
sFloatFragmentsInsideColumnPrefCached = true;
|
||||
Preferences::AddBoolVarCache(
|
||||
&sFloatFragmentsInsideColumnEnabled,
|
||||
"layout.float-fragments-inside-column.enabled");
|
||||
}
|
||||
mFlags.mFloatFragmentsInsideColumnEnabled =
|
||||
sFloatFragmentsInsideColumnEnabled;
|
||||
|
||||
WritingMode wm = aReflowInput.GetWritingMode();
|
||||
mFlags.mIsFirstInflow = !aFrame->GetPrevInFlow();
|
||||
mFlags.mIsOverflowContainer = IS_TRUE_OVERFLOW_CONTAINER(aFrame);
|
||||
@ -918,23 +906,16 @@ bool BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat) {
|
||||
mBlock->ReflowFloat(*this, adjustedAvailableSpace, aFloat, floatMargin,
|
||||
floatOffsets, pushedDown, reflowStatus);
|
||||
}
|
||||
if (aFloat->GetPrevInFlow()) floatMargin.BStart(wm) = 0;
|
||||
if (reflowStatus.IsIncomplete()) floatMargin.BEnd(wm) = 0;
|
||||
if (aFloat->GetPrevInFlow()) {
|
||||
floatMargin.BStart(wm) = 0;
|
||||
}
|
||||
if (reflowStatus.IsIncomplete()) {
|
||||
floatMargin.BEnd(wm) = 0;
|
||||
}
|
||||
|
||||
// In the case that we're in columns and not splitting floats, we need
|
||||
// to check here that the float's height fit, and if it didn't, bail.
|
||||
// (controlled by the pref "layout.float-fragments-inside-column.enabled")
|
||||
//
|
||||
// Likewise, if none of the float fit, and it needs to be pushed in
|
||||
// its entirety to the next page (IsTruncated() or IsInlineBreakBefore()),
|
||||
// we need to do the same.
|
||||
if ((ContentBSize() != NS_UNCONSTRAINEDSIZE &&
|
||||
!mFlags.mFloatFragmentsInsideColumnEnabled &&
|
||||
adjustedAvailableSpace.BSize(wm) == NS_UNCONSTRAINEDSIZE &&
|
||||
!mustPlaceFloat &&
|
||||
aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
|
||||
ContentBEnd() - floatPos.B(wm)) ||
|
||||
reflowStatus.IsTruncated() || reflowStatus.IsInlineBreakBefore()) {
|
||||
// If none of the float fit, and it needs to be pushed in its entirety to the
|
||||
// next page, we need to bail.
|
||||
if (reflowStatus.IsTruncated() || reflowStatus.IsInlineBreakBefore()) {
|
||||
PushFloatPastBreak(aFloat);
|
||||
return false;
|
||||
}
|
||||
|
@ -39,7 +39,6 @@ class BlockReflowInput {
|
||||
mIsLineLayoutEmpty(false),
|
||||
mIsOverflowContainer(false),
|
||||
mIsFloatListInBlockPropertyTable(false),
|
||||
mFloatFragmentsInsideColumnEnabled(false),
|
||||
mCanHaveOverflowMarkers(false) {}
|
||||
|
||||
// Set in the BlockReflowInput constructor when the frame being reflowed has
|
||||
@ -101,9 +100,6 @@ class BlockReflowInput {
|
||||
// Set when our mPushedFloats list is stored on the block's property table.
|
||||
bool mIsFloatListInBlockPropertyTable : 1;
|
||||
|
||||
// Set when the pref layout.float-fragments-inside-column.enabled is true.
|
||||
bool mFloatFragmentsInsideColumnEnabled : 1;
|
||||
|
||||
// Set when we need text-overflow or -webkit-line-clamp processing.
|
||||
bool mCanHaveOverflowMarkers : 1;
|
||||
};
|
||||
|
@ -436,8 +436,7 @@ load 594808-1.html
|
||||
load 595435-1.xhtml
|
||||
load 595740-1.html
|
||||
load 597240-1.xhtml
|
||||
pref(layout.float-fragments-inside-column.enabled,true) load 600100.xhtml
|
||||
pref(layout.float-fragments-inside-column.enabled,false) load 600100.xhtml
|
||||
load 600100.xhtml
|
||||
load 603490-1.html
|
||||
load 603510-1.html
|
||||
load 604314-1.html
|
||||
|
@ -6340,16 +6340,6 @@ LogicalRect nsBlockFrame::AdjustFloatAvailableSpace(
|
||||
? NS_UNCONSTRAINEDSIZE
|
||||
: std::max(0, aState.ContentBEnd() - aState.mBCoord);
|
||||
|
||||
if (availBSize != NS_UNCONSTRAINEDSIZE &&
|
||||
!aState.mFlags.mFloatFragmentsInsideColumnEnabled &&
|
||||
nsLayoutUtils::GetClosestFrameOfType(this, LayoutFrameType::ColumnSet)) {
|
||||
// Tell the float it has unrestricted block-size, so it won't break.
|
||||
// If the float doesn't actually fit in the column it will fail to be
|
||||
// placed, and either move to the block-start of the next column or just
|
||||
// overflow.
|
||||
availBSize = NS_UNCONSTRAINEDSIZE;
|
||||
}
|
||||
|
||||
return LogicalRect(wm, aState.ContentIStart(), aState.ContentBStart(),
|
||||
availISize, availBSize);
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Testcase for float breaking</title>
|
||||
<body style="margin: 0">
|
||||
<div style="position: absolute; top: 0; left: 0; width: 150px; height: 100px; background: blue"></div>
|
||||
<div style="position: absolute; top: 100px; left: 0; width: 75px; height: 125px; background: aqua"></div>
|
||||
<div style="position: absolute; top: 100px; left: 75px; width: 100px; height: 125px; background: fuchsia"></div>
|
||||
<div style="position: absolute; top: 0px; left: 200px; width: 75px; height: 75px; background: aqua"></div>
|
||||
<div style="position: absolute; top: 0; left: 275px; width: 100px; height: 225px; background: fuchsia"></div>
|
@ -2,6 +2,7 @@
|
||||
<title>Testcase for float breaking</title>
|
||||
<body style="margin: 0">
|
||||
<div style="position: absolute; top: 0; left: 0; width: 150px; height: 100px; background: blue"></div>
|
||||
<div style="position: absolute; top: 100px; left: 0; width: 75px; height: 200px; background: aqua"></div>
|
||||
<div style="position: absolute; top: 0; left: 200px; width: 100px; height: 350px; background: fuchsia"></div>
|
||||
|
||||
<div style="position: absolute; top: 100px; left: 0; width: 75px; height: 125px; background: aqua"></div>
|
||||
<div style="position: absolute; top: 100px; left: 75px; width: 100px; height: 125px; background: fuchsia"></div>
|
||||
<div style="position: absolute; top: 0px; left: 200px; width: 75px; height: 75px; background: aqua"></div>
|
||||
<div style="position: absolute; top: 0; left: 275px; width: 100px; height: 225px; background: fuchsia"></div>
|
||||
|
@ -755,8 +755,7 @@ fuzzy-if(skiaContent,0-2,0-3) == 385870-2.html 385870-2-ref.html
|
||||
== 386014-1c.html 386014-1-ref.html
|
||||
== 386065-1.html 386065-1-ref.html
|
||||
== 386065-2.html about:blank
|
||||
test-pref(layout.float-fragments-inside-column.enabled,false) fails == 386147-1.html 386147-1-ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,true) == 386147-1.html 386147-1-ref.html
|
||||
== 386147-1.html 386147-1-ref.html
|
||||
== 386310-1a.html 386310-1-ref.html
|
||||
== 386310-1b.html 386310-1-ref.html
|
||||
== 386310-1c.html 386310-1-ref.html
|
||||
@ -1526,8 +1525,7 @@ fuzzy-if(Android,0-2,0-48) == 563584-2.html 563584-2-ref.html
|
||||
fuzzy-if(Android,0-4,0-180) == 563584-3.html 563584-3-ref.html
|
||||
fuzzy-if(Android,0-4,0-180) == 563584-4.html 563584-4-ref.html
|
||||
fuzzy-if(Android,0-2,0-48) == 563584-5.html 563584-5-ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,false) == 563584-6-columns.html 563584-6-columns-ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,true) == 563584-6-columns.html 563584-6-columns-ref-enabled.html
|
||||
== 563584-6-columns.html 563584-6-columns-ref.html
|
||||
fuzzy-if(Android,0-2,0-48) == 563584-6-printing.html 563584-6-printing-ref.html
|
||||
fuzzy-if(Android,0-2,0-48) == 563584-7.html 563584-7-ref.html
|
||||
# FIXME: It would be nice to have variants of these -8 tests for the
|
||||
|
@ -34,11 +34,9 @@ fails == border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml
|
||||
== content-inserted-008.xhtml content-inserted-001.ref.xhtml
|
||||
== content-inserted-009.xhtml content-inserted-002.ref.xhtml
|
||||
== dynamic-abspos-overflow-01-cols.xhtml dynamic-abspos-overflow-01-cols.ref.xhtml
|
||||
test-pref(layout.float-fragments-inside-column.enabled,false) fails == float-clear-000.html float-clear-000.ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,true) == float-clear-000.html float-clear-000.ref.html
|
||||
== float-clear-000.html float-clear-000.ref.html
|
||||
fails == float-clear-001.html float-clear-000.ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,false) fails == float-clear-002.html float-clear-000.ref.html
|
||||
test-pref(layout.float-fragments-inside-column.enabled,true) == float-clear-002.html float-clear-000.ref.html
|
||||
== float-clear-002.html float-clear-000.ref.html
|
||||
fails == float-clear-003.html float-clear-000.ref.html
|
||||
== float-clear-000-print.html float-clear-000-print.ref.html
|
||||
== float-clear-001-print.html float-clear-000-print.ref.html
|
||||
|
@ -2828,9 +2828,6 @@ pref("layout.display-list.rebuild-frame-limit", 500);
|
||||
// pref to control whether layout warnings that are hit quite often are enabled
|
||||
pref("layout.spammy_warnings.enabled", false);
|
||||
|
||||
// Should we fragment floats inside CSS column layout?
|
||||
pref("layout.float-fragments-inside-column.enabled", true);
|
||||
|
||||
// The number of frames times the frame rate is the time required to
|
||||
// pass without painting used to guess that we'll not paint again soon
|
||||
pref("layout.idle_period.required_quiescent_frames", 2);
|
||||
|
Loading…
Reference in New Issue
Block a user