diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 66b93177ede1..b0c8e94c6f8c 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -3329,7 +3329,8 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState, if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO || columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) { columnSetFrame = - NS_NewColumnSetFrame(mPresShell, fieldsetContentStyle, nsFrameState(0)); + NS_NewColumnSetFrame(mPresShell, fieldsetContentStyle, + nsFrameState(NS_FRAME_OWNS_ANON_BOXES)); InitAndRestoreFrame(aState, content, parent, columnSetFrame); innerSC = mPresShell->StyleSet()-> ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::columnContent, @@ -3978,7 +3979,8 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO || columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) { columnSetFrame = - NS_NewColumnSetFrame(mPresShell, outerSC, nsFrameState(0)); + NS_NewColumnSetFrame(mPresShell, outerSC, + nsFrameState(NS_FRAME_OWNS_ANON_BOXES)); InitAndRestoreFrame(aState, content, container, columnSetFrame); innerSC = mPresShell->StyleSet()-> ResolveInheritingAnonymousBoxStyle(nsCSSAnonBoxes::columnContent, @@ -12041,7 +12043,8 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState, if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO || columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) { nsContainerFrame* columnSetFrame = - NS_NewColumnSetFrame(mPresShell, aStyleContext, nsFrameState(0)); + NS_NewColumnSetFrame(mPresShell, aStyleContext, + nsFrameState(NS_FRAME_OWNS_ANON_BOXES)); InitAndRestoreFrame(aState, aContent, aParentFrame, columnSetFrame); blockStyle = mPresShell->StyleSet()-> diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 7809f72605b1..dadcbda4ad44 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -1139,6 +1139,26 @@ nsColumnSetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, } } +void +nsColumnSetFrame::DoUpdateStyleOfOwnedAnonBoxes( + mozilla::ServoStyleSet& aStyleSet, + nsStyleChangeList& aChangeList, + nsChangeHint aHintForThisFrame) +{ + // Everything in mFrames is continuations of the first thing in mFrames. + nsIFrame* column = mFrames.FirstChild(); + + // We might not have any columns, apparently? + if (!column) { + return; + } + + MOZ_ASSERT(column->StyleContext()->GetPseudo() == + nsCSSAnonBoxes::columnContent, + "What sort of child is this?"); + UpdateStyleOfChildAnonBox(column, aStyleSet, aChangeList, aHintForThisFrame); +} + #ifdef DEBUG void nsColumnSetFrame::SetInitialChildList(ChildListID aListID, diff --git a/layout/generic/nsColumnSetFrame.h b/layout/generic/nsColumnSetFrame.h index db44183d624b..1d324d282229 100644 --- a/layout/generic/nsColumnSetFrame.h +++ b/layout/generic/nsColumnSetFrame.h @@ -83,6 +83,13 @@ public: */ void DrainOverflowColumns(); + /** + * Update the style on our column-content frames. + */ + void DoUpdateStyleOfOwnedAnonBoxes(mozilla::ServoStyleSet& aStyleSet, + nsStyleChangeList& aChangeList, + nsChangeHint aHintForThisFrame) override; + #ifdef DEBUG_FRAME_DUMP virtual nsresult GetFrameName(nsAString& aResult) const override { return MakeFrameName(NS_LITERAL_STRING("ColumnSet"), aResult); diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 4c6511dda5b0..723c75c201f3 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -10069,6 +10069,8 @@ nsFrame::UpdateStyleOfChildAnonBox(nsIFrame* aChildFrame, "This should only be used for children!"); MOZ_ASSERT(aChildFrame->GetContent() == GetContent(), "What content node is it a frame for?"); + MOZ_ASSERT(!aChildFrame->GetPrevContinuation(), + "Only first continuations should end up here"); // We could force the caller to pass in the pseudo, since some callers know it // statically... But this API is a bit nicer. diff --git a/layout/reftests/columns/dynamic-text-indent-1-ref.html b/layout/reftests/columns/dynamic-text-indent-1-ref.html new file mode 100644 index 000000000000..9d96ce96de48 --- /dev/null +++ b/layout/reftests/columns/dynamic-text-indent-1-ref.html @@ -0,0 +1,4 @@ + +
+ This is some text that is too long and it will overflow. +
diff --git a/layout/reftests/columns/dynamic-text-indent-1.html b/layout/reftests/columns/dynamic-text-indent-1.html new file mode 100644 index 000000000000..dc4f4f53004c --- /dev/null +++ b/layout/reftests/columns/dynamic-text-indent-1.html @@ -0,0 +1,14 @@ + + +
+ This is some text that is too long and it will overflow. +
+ + diff --git a/layout/reftests/columns/dynamic-text-indent-2-ref.html b/layout/reftests/columns/dynamic-text-indent-2-ref.html new file mode 100644 index 000000000000..1b9669771709 --- /dev/null +++ b/layout/reftests/columns/dynamic-text-indent-2-ref.html @@ -0,0 +1,4 @@ + +
+ This is some text that is too long and it will overflow. +
diff --git a/layout/reftests/columns/dynamic-text-indent-2.html b/layout/reftests/columns/dynamic-text-indent-2.html new file mode 100644 index 000000000000..a36b8d1bc0c7 --- /dev/null +++ b/layout/reftests/columns/dynamic-text-indent-2.html @@ -0,0 +1,14 @@ + + +
+ This is some text that is too long and it will overflow. +
+ + diff --git a/layout/reftests/columns/reftest-stylo.list b/layout/reftests/columns/reftest-stylo.list index 363260f83e57..6eda06e41748 100644 --- a/layout/reftests/columns/reftest-stylo.list +++ b/layout/reftests/columns/reftest-stylo.list @@ -37,3 +37,5 @@ fails == column-balancing-nested-001.html column-balancing-nested-001.html == positioning-transforms-bug1112501.html positioning-transforms-bug1112501.html == fieldset-columns-001.html fieldset-columns-001.html == dynamic-change-with-overflow-1.html dynamic-change-with-overflow-1.html +== dynamic-text-indent-1.html dynamic-text-indent-1.html +== dynamic-text-indent-2.html dynamic-text-indent-2.html diff --git a/layout/reftests/columns/reftest.list b/layout/reftests/columns/reftest.list index 25c973cca3bd..945c33b96646 100644 --- a/layout/reftests/columns/reftest.list +++ b/layout/reftests/columns/reftest.list @@ -36,3 +36,5 @@ HTTP(..) == columnfill-auto-3.html columnfill-auto-2-ref.html == positioning-transforms-bug1112501.html positioning-transforms-bug1112501-ref.html fuzzy-if(browserIsRemote&&winWidget,140,276) == fieldset-columns-001.html fieldset-columns-001-ref.html == dynamic-change-with-overflow-1.html dynamic-change-with-overflow-1-ref.html +== dynamic-text-indent-1.html dynamic-text-indent-1-ref.html +== dynamic-text-indent-2.html dynamic-text-indent-2-ref.html