From 83d9aa16f4fc0823805b7e001e6d713279c526d4 Mon Sep 17 00:00:00 2001 From: Ting-Yu Lin Date: Mon, 5 Aug 2019 17:39:19 +0000 Subject: [PATCH] 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 --- layout/generic/BlockReflowInput.cpp | 37 +++++-------------- layout/generic/BlockReflowInput.h | 4 -- layout/generic/crashtests/crashtests.list | 3 +- layout/generic/nsBlockFrame.cpp | 10 ----- .../bugs/563584-6-columns-ref-enabled.html | 8 ---- .../reftests/bugs/563584-6-columns-ref.html | 7 ++-- layout/reftests/bugs/reftest.list | 6 +-- layout/reftests/pagination/reftest.list | 6 +-- modules/libpref/init/all.js | 3 -- 9 files changed, 18 insertions(+), 66 deletions(-) delete mode 100644 layout/reftests/bugs/563584-6-columns-ref-enabled.html diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index 57dfb6899e24..27726f5f1e1d 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -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; } diff --git a/layout/generic/BlockReflowInput.h b/layout/generic/BlockReflowInput.h index 305422e963ef..05826cb3cb37 100644 --- a/layout/generic/BlockReflowInput.h +++ b/layout/generic/BlockReflowInput.h @@ -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; }; diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index cc028c426f40..4c410a29760a 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -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 diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index a9ad3468bd88..9ad93552f6b2 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -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); } diff --git a/layout/reftests/bugs/563584-6-columns-ref-enabled.html b/layout/reftests/bugs/563584-6-columns-ref-enabled.html deleted file mode 100644 index 56ecf414f79d..000000000000 --- a/layout/reftests/bugs/563584-6-columns-ref-enabled.html +++ /dev/null @@ -1,8 +0,0 @@ - -Testcase for float breaking - -
-
-
-
-
diff --git a/layout/reftests/bugs/563584-6-columns-ref.html b/layout/reftests/bugs/563584-6-columns-ref.html index 328f91bbe342..56ecf414f79d 100644 --- a/layout/reftests/bugs/563584-6-columns-ref.html +++ b/layout/reftests/bugs/563584-6-columns-ref.html @@ -2,6 +2,7 @@ Testcase for float breaking
-
-
- +
+
+
+
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 0912b0a46272..5ad34ed8837b 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -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 diff --git a/layout/reftests/pagination/reftest.list b/layout/reftests/pagination/reftest.list index 40aa997e3891..6b395fc953a9 100644 --- a/layout/reftests/pagination/reftest.list +++ b/layout/reftests/pagination/reftest.list @@ -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 diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index f9e5b3be7734..47535a5edccf 100755 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -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);