diff options
Diffstat (limited to '')
-rw-r--r-- | www/firefox/files/patch-bug1404324 | 299 |
1 files changed, 0 insertions, 299 deletions
diff --git a/www/firefox/files/patch-bug1404324 b/www/firefox/files/patch-bug1404324 deleted file mode 100644 index afcbc3efb2ec..000000000000 --- a/www/firefox/files/patch-bug1404324 +++ /dev/null @@ -1,299 +0,0 @@ -commit 5647dde295f4 -Author: Emilio Cobos Álvarez <emilio@crisal.io> -Date: Wed Oct 4 11:36:20 2017 +0200 - - Bug 1404324 - Use the placeholder state to remove out-of-flows that aren't real descendants of the destruction root. r=bz, a=ritu - - Using the style of the frame can mess things up when we reparent them due to - ::first-line before removing them. - - MozReview-Commit-ID: 3Dt0wF2XRAH - - --HG-- - extra : source : 5a034cdb513208dd19adf0babf30ee734968a78f - extra : histedit_source : 4cd958939c5a76e013695e931d721454268a0dc7%2C96bdeda302c567493c7db5105f306595d25332e1 ---- - layout/base/nsCSSFrameConstructor.cpp | 8 +++--- - layout/base/nsLayoutUtils.cpp | 46 +++------------------------------ - layout/generic/nsPlaceholderFrame.cpp | 27 ++++++++++++++++--- - layout/generic/nsPlaceholderFrame.h | 21 ++++++++------- - layout/style/crashtests/1404324-1.html | 12 +++++++++ - layout/style/crashtests/1404324-2.html | 10 +++++++ - layout/style/crashtests/1404324-3.html | 14 ++++++++++ - layout/style/crashtests/crashtests.list | 3 +++ - 8 files changed, 83 insertions(+), 58 deletions(-) - -diff --git layout/base/nsCSSFrameConstructor.cpp layout/base/nsCSSFrameConstructor.cpp -index c840416fd6a7..99b1211b399b 100644 ---- layout/base/nsCSSFrameConstructor.cpp -+++ layout/base/nsCSSFrameConstructor.cpp -@@ -1260,8 +1260,10 @@ nsFrameConstructorState::GetOutOfFlowFrameItems(nsIFrame* aNewFrame, - if (disp->mTopLayer != NS_STYLE_TOP_LAYER_NONE) { - *aPlaceholderType = PLACEHOLDER_FOR_TOPLAYER; - if (disp->mPosition == NS_STYLE_POSITION_FIXED) { -+ *aPlaceholderType |= PLACEHOLDER_FOR_FIXEDPOS; - return &mTopLayerFixedItems; - } -+ *aPlaceholderType |= PLACEHOLDER_FOR_ABSPOS; - return &mTopLayerAbsoluteItems; - } - if (disp->mPosition == NS_STYLE_POSITION_ABSOLUTE) { -@@ -1303,11 +1305,11 @@ nsFrameConstructorState::ConstructBackdropFrameFor(nsIContent* aContent, - nsAbsoluteItems* frameItems = GetOutOfFlowFrameItems(backdropFrame, - true, true, false, - &placeholderType); -- MOZ_ASSERT(placeholderType == PLACEHOLDER_FOR_TOPLAYER); -+ MOZ_ASSERT(placeholderType & PLACEHOLDER_FOR_TOPLAYER); - - nsIFrame* placeholder = nsCSSFrameConstructor:: - CreatePlaceholderFrameFor(mPresShell, aContent, backdropFrame, -- frame, nullptr, PLACEHOLDER_FOR_TOPLAYER); -+ frame, nullptr, placeholderType); - nsFrameList temp(placeholder, placeholder); - frame->SetInitialChildList(nsIFrame::kBackdropList, temp); - -@@ -1361,7 +1363,7 @@ nsFrameConstructorState::AddChild(nsIFrame* aNewFrame, - // Add the placeholder frame to the flow - aFrameItems.AddChild(placeholderFrame); - -- if (placeholderType == PLACEHOLDER_FOR_TOPLAYER) { -+ if (placeholderType & PLACEHOLDER_FOR_TOPLAYER) { - ConstructBackdropFrameFor(aContent, aNewFrame); - } - } -diff --git layout/base/nsLayoutUtils.cpp layout/base/nsLayoutUtils.cpp -index cb010c0a1a80..94ead9830c25 100644 ---- layout/base/nsLayoutUtils.cpp -+++ layout/base/nsLayoutUtils.cpp -@@ -1525,6 +1525,8 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) - { - nsIFrame::ChildListID id = nsIFrame::kPrincipalList; - -+ MOZ_DIAGNOSTIC_ASSERT(!(aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)); -+ - if (aChildFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) { - nsIFrame* pif = aChildFrame->GetPrevInFlow(); - if (pif->GetParent() == aChildFrame->GetParent()) { -@@ -1533,35 +1535,6 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) - else { - id = nsIFrame::kOverflowContainersList; - } -- } -- // See if the frame is moved out of the flow -- else if (aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) { -- // Look at the style information to tell -- const nsStyleDisplay* disp = aChildFrame->StyleDisplay(); -- -- if (NS_STYLE_POSITION_ABSOLUTE == disp->mPosition) { -- id = nsIFrame::kAbsoluteList; -- } else if (NS_STYLE_POSITION_FIXED == disp->mPosition) { -- if (nsLayoutUtils::IsReallyFixedPos(aChildFrame)) { -- id = nsIFrame::kFixedList; -- } else { -- id = nsIFrame::kAbsoluteList; -- } --#ifdef MOZ_XUL -- } else if (StyleDisplay::MozPopup == disp->mDisplay) { -- // Out-of-flows that are DISPLAY_POPUP must be kids of the root popup set --#ifdef DEBUG -- nsIFrame* parent = aChildFrame->GetParent(); -- NS_ASSERTION(parent && parent->IsPopupSetFrame(), "Unexpected parent"); --#endif // DEBUG -- -- id = nsIFrame::kPopupList; --#endif // MOZ_XUL -- } else { -- NS_ASSERTION(aChildFrame->IsFloating(), "not a floated frame"); -- id = nsIFrame::kFloatList; -- } -- - } else { - LayoutFrameType childType = aChildFrame->Type(); - if (LayoutFrameType::MenuPopup == childType) { -@@ -1596,19 +1569,8 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) - nsContainerFrame* parent = aChildFrame->GetParent(); - bool found = parent->GetChildList(id).ContainsFrame(aChildFrame); - if (!found) { -- if (!(aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) { -- found = parent->GetChildList(nsIFrame::kOverflowList) -- .ContainsFrame(aChildFrame); -- } -- else if (aChildFrame->IsFloating()) { -- found = parent->GetChildList(nsIFrame::kOverflowOutOfFlowList) -- .ContainsFrame(aChildFrame); -- if (!found) { -- found = parent->GetChildList(nsIFrame::kPushedFloatsList) -- .ContainsFrame(aChildFrame); -- } -- } -- // else it's positioned and should have been on the 'id' child list. -+ found = parent->GetChildList(nsIFrame::kOverflowList) -+ .ContainsFrame(aChildFrame); - NS_POSTCONDITION(found, "not in child list"); - } - #endif -diff --git layout/generic/nsPlaceholderFrame.cpp layout/generic/nsPlaceholderFrame.cpp -index 7da2582ae526..4b2e1bf84b36 100644 ---- layout/generic/nsPlaceholderFrame.cpp -+++ layout/generic/nsPlaceholderFrame.cpp -@@ -25,9 +25,9 @@ using namespace mozilla::gfx; - - nsIFrame* - NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, -- nsFrameState aTypeBit) -+ nsFrameState aTypeBits) - { -- return new (aPresShell) nsPlaceholderFrame(aContext, aTypeBit); -+ return new (aPresShell) nsPlaceholderFrame(aContext, aTypeBits); - } - - NS_IMPL_FRAMEARENA_HELPERS(nsPlaceholderFrame) -@@ -155,6 +155,26 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext, - NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize); - } - -+static nsIFrame::ChildListID -+ChildListIDForOutOfFlow(nsFrameState aPlaceholderState, nsIFrame* aChild) -+{ -+ if (aPlaceholderState & PLACEHOLDER_FOR_FLOAT) { -+ return nsIFrame::kFloatList; -+ } -+ if (aPlaceholderState & PLACEHOLDER_FOR_POPUP) { -+ return nsIFrame::kPopupList; -+ } -+ if (aPlaceholderState & PLACEHOLDER_FOR_FIXEDPOS) { -+ return nsLayoutUtils::IsReallyFixedPos(aChild) -+ ? nsIFrame::kFixedList : nsIFrame::kAbsoluteList; -+ } -+ if (aPlaceholderState & PLACEHOLDER_FOR_ABSPOS) { -+ return nsIFrame::kAbsoluteList; -+ } -+ MOZ_DIAGNOSTIC_ASSERT(false, "unknown list"); -+ return nsIFrame::kFloatList; -+} -+ - void - nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot) - { -@@ -162,12 +182,13 @@ nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot) - if (oof) { - mOutOfFlowFrame = nullptr; - oof->DeleteProperty(nsIFrame::PlaceholderFrameProperty()); -+ - // If aDestructRoot is not an ancestor of the out-of-flow frame, - // then call RemoveFrame on it here. - // Also destroy it here if it's a popup frame. (Bug 96291) - if ((GetStateBits() & PLACEHOLDER_FOR_POPUP) || - !nsLayoutUtils::IsProperAncestorFrame(aDestructRoot, oof)) { -- ChildListID listId = nsLayoutUtils::GetChildListNameFor(oof); -+ ChildListID listId = ChildListIDForOutOfFlow(GetStateBits(), oof); - nsFrameManager* fm = PresContext()->GetPresShell()->FrameManager(); - fm->RemoveFrame(listId, oof); - } -diff --git layout/generic/nsPlaceholderFrame.h layout/generic/nsPlaceholderFrame.h -index e270c76cdd31..2af9b4ccbc93 100644 ---- layout/generic/nsPlaceholderFrame.h -+++ layout/generic/nsPlaceholderFrame.h -@@ -40,7 +40,7 @@ - - nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext, -- nsFrameState aTypeBit); -+ nsFrameState aTypeBits); - - #define PLACEHOLDER_TYPE_MASK (PLACEHOLDER_FOR_FLOAT | \ - PLACEHOLDER_FOR_ABSPOS | \ -@@ -65,18 +65,19 @@ public: - */ - friend nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext, -- nsFrameState aTypeBit); -- nsPlaceholderFrame(nsStyleContext* aContext, nsFrameState aTypeBit) -+ nsFrameState aTypeBits); -+ nsPlaceholderFrame(nsStyleContext* aContext, nsFrameState aTypeBits) - : nsFrame(aContext, kClassID) - , mOutOfFlowFrame(nullptr) - { -- NS_PRECONDITION(aTypeBit == PLACEHOLDER_FOR_FLOAT || -- aTypeBit == PLACEHOLDER_FOR_ABSPOS || -- aTypeBit == PLACEHOLDER_FOR_FIXEDPOS || -- aTypeBit == PLACEHOLDER_FOR_POPUP || -- aTypeBit == PLACEHOLDER_FOR_TOPLAYER, -- "Unexpected type bit"); -- AddStateBits(aTypeBit); -+ MOZ_ASSERT(aTypeBits == PLACEHOLDER_FOR_FLOAT || -+ aTypeBits == PLACEHOLDER_FOR_ABSPOS || -+ aTypeBits == PLACEHOLDER_FOR_FIXEDPOS || -+ aTypeBits == PLACEHOLDER_FOR_POPUP || -+ aTypeBits == (PLACEHOLDER_FOR_TOPLAYER | PLACEHOLDER_FOR_ABSPOS) || -+ aTypeBits == (PLACEHOLDER_FOR_TOPLAYER | PLACEHOLDER_FOR_FIXEDPOS), -+ "Unexpected type bit"); -+ AddStateBits(aTypeBits); - } - - // Get/Set the associated out of flow frame -diff --git layout/style/crashtests/1404324-1.html layout/style/crashtests/1404324-1.html -new file mode 100644 -index 000000000000..574a5437cb1b ---- /dev/null -+++ layout/style/crashtests/1404324-1.html -@@ -0,0 +1,12 @@ -+<style></style> -+<script> -+document.documentElement.className = 'c1' -+o1 = document.createElement('form') -+o2 = document.createElement('e') -+o1.className = 'c2' -+document.documentElement.appendChild(o1) -+document.documentElement.appendChild(o2) -+document.styleSheets[0].insertRule('.c1:first-line, .c2 { position:fixed', 0); -+document.documentElement.getBoundingClientRect() -+document.styleSheets[0].cssRules[0].style.position = 'relative' -+</script> -diff --git layout/style/crashtests/1404324-2.html layout/style/crashtests/1404324-2.html -new file mode 100644 -index 000000000000..797347d5c058 ---- /dev/null -+++ layout/style/crashtests/1404324-2.html -@@ -0,0 +1,10 @@ -+<style> -+ del, *::first-line { -+ position: absolute; -+ } -+</style> -+<del></del> -+<script> -+ document.documentElement.offsetTop; -+ document.styleSheets[0].cssRules[0].style.position = 'sticky' -+</script> -diff --git layout/style/crashtests/1404324-3.html layout/style/crashtests/1404324-3.html -new file mode 100644 -index 000000000000..3b06f12a2bf6 ---- /dev/null -+++ layout/style/crashtests/1404324-3.html -@@ -0,0 +1,14 @@ -+<style> -+del { -+ position: absolute; -+} -+ -+body::first-line { -+ color: red; -+} -+</style> -+<del></del> -+<script> -+ document.documentElement.offsetTop; -+ document.styleSheets[0].cssRules[0].style.position = 'sticky' -+</script> -diff --git layout/style/crashtests/crashtests.list layout/style/crashtests/crashtests.list -index be9a46c52bfa..5eaba6935ee2 100644 ---- layout/style/crashtests/crashtests.list -+++ layout/style/crashtests/crashtests.list -@@ -238,3 +238,6 @@ load 1403615.html - load 1387481-1.html - load 1387499.html - load 1391577.html -+asserts-if(stylo,1) load 1404324-1.html # bug 1405605 -+load 1404324-2.html -+load 1404324-3.html |