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 @@ + +