зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1388625 part 2. During a stylo restyle, update the style of the anonymous cols in a colgroup, if any. r=heycam
MozReview-Commit-ID: 4H2NzhCyygU --HG-- extra : rebase_source : 88f0802f507478c97b4b971ba13348c44f212f31
This commit is contained in:
Родитель
fbecdd2153
Коммит
dd203db270
|
@ -188,6 +188,15 @@ nsTableColGroupFrame::AppendFrames(ChildListID aListID,
|
|||
col = nextCol;
|
||||
}
|
||||
|
||||
// Our next colframe should be an eColContent. We've removed all the
|
||||
// eColAnonymousColGroup colframes, eColAnonymousCol colframes always follow
|
||||
// eColContent ones, and eColAnonymousCell colframes only appear in an
|
||||
// eColGroupAnonymousCell colgroup, which never gets AppendFrames() called on
|
||||
// it.
|
||||
MOZ_ASSERT(!col || col->GetColType() == eColContent,
|
||||
"What's going on with our columns?");
|
||||
RemoveStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
|
||||
const nsFrameList::Slice& newFrames =
|
||||
mFrames.AppendFrames(this, aFrameList);
|
||||
InsertColsReflow(GetStartColumnIndex() + mColCount, newFrames);
|
||||
|
@ -221,6 +230,15 @@ nsTableColGroupFrame::InsertFrames(ChildListID aListID,
|
|||
col = nextCol;
|
||||
}
|
||||
|
||||
// Our next colframe should be an eColContent. We've removed all the
|
||||
// eColAnonymousColGroup colframes, eColAnonymousCol colframes always follow
|
||||
// eColContent ones, and eColAnonymousCell colframes only appear in an
|
||||
// eColGroupAnonymousCell colgroup, which never gets InsertFrames() called on
|
||||
// it.
|
||||
MOZ_ASSERT(!col || col->GetColType() == eColContent,
|
||||
"What's going on with our columns?");
|
||||
RemoveStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
|
||||
NS_ASSERTION(!aPrevFrame || aPrevFrame == aPrevFrame->LastContinuation(),
|
||||
"Prev frame should be last in continuation chain");
|
||||
NS_ASSERTION(!aPrevFrame || !GetNextColumn(aPrevFrame) ||
|
||||
|
@ -484,6 +502,30 @@ nsTableColGroupFrame::InvalidateFrameWithRect(const nsRect& aRect,
|
|||
GetParent()->InvalidateFrameWithRect(aRect + GetPosition(), aDisplayItemKey);
|
||||
}
|
||||
|
||||
void
|
||||
nsTableColGroupFrame::AppendDirectlyOwnedAnonBoxes(
|
||||
nsTArray<OwnedAnonBox>& aResult)
|
||||
{
|
||||
nsTableColFrame* col = GetFirstColumn();
|
||||
if (!col) {
|
||||
// No columns, nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
if (col->GetColType() == eColContent) {
|
||||
// We have actual columns; no anon boxes here.
|
||||
return;
|
||||
}
|
||||
|
||||
for ( ; col; col = col->GetNextCol()) {
|
||||
MOZ_ASSERT(col->GetColType() != eColContent,
|
||||
"We should not have any real columns after anonymous ones");
|
||||
MOZ_ASSERT(col->GetColType() != eColAnonymousCol,
|
||||
"We shouldn't have spanning anonymous columns");
|
||||
aResult.AppendElement(OwnedAnonBox(col));
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_FRAME_DUMP
|
||||
nsresult
|
||||
nsTableColGroupFrame::GetFrameName(nsAString& aResult) const
|
||||
|
|
|
@ -202,6 +202,9 @@ public:
|
|||
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
|
||||
virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
|
||||
|
||||
// Return any anonymous columns we contain.
|
||||
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
|
||||
|
||||
protected:
|
||||
explicit nsTableColGroupFrame(nsStyleContext* aContext);
|
||||
|
||||
|
|
|
@ -700,6 +700,7 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType)
|
|||
void
|
||||
nsTableFrame::AppendAnonymousColFrames(int32_t aNumColsToAdd)
|
||||
{
|
||||
MOZ_ASSERT(aNumColsToAdd > 0, "We should be adding _something_.");
|
||||
// get the last col group frame
|
||||
nsTableColGroupFrame* colGroupFrame =
|
||||
static_cast<nsTableColGroupFrame*>(mColGroups.LastChild());
|
||||
|
@ -732,6 +733,7 @@ nsTableFrame::AppendAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
|||
{
|
||||
NS_PRECONDITION(aColGroupFrame, "null frame");
|
||||
NS_PRECONDITION(aColType != eColAnonymousCol, "Shouldn't happen");
|
||||
MOZ_ASSERT(aNumColsToAdd > 0, "We should be adding _something_.");
|
||||
|
||||
nsIPresShell *shell = PresContext()->PresShell();
|
||||
|
||||
|
@ -741,6 +743,8 @@ nsTableFrame::AppendAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
|||
int32_t startIndex = mColFrames.Length();
|
||||
int32_t lastIndex = startIndex + aNumColsToAdd - 1;
|
||||
|
||||
// aColGroupFrame will need to handle restyling these cols we're about to add.
|
||||
aColGroupFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
|
||||
for (int32_t childX = startIndex; childX <= lastIndex; childX++) {
|
||||
nsIContent* iContent;
|
||||
RefPtr<nsStyleContext> styleContext;
|
||||
|
|
Загрузка…
Ссылка в новой задаче