Skip to content

Commit

Permalink
Backed out 3 changesets (bug 63895)
Browse files Browse the repository at this point in the history
Backed out changeset ceafe92c7716 (bug 63895)
Backed out changeset 0199299ac111 (bug 63895)
Backed out changeset d78110a5cffa (bug 63895)

--HG--
extra : rebase_source : 76d8a63672dfdb000ff6db5d362231ed6e90c1bc
  • Loading branch information
sethfowler committed Mar 7, 2014
1 parent 9d3664f commit 026e40d
Show file tree
Hide file tree
Showing 37 changed files with 36 additions and 1,440 deletions.
115 changes: 30 additions & 85 deletions layout/base/nsCSSFrameConstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1984,64 +1984,27 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState,
return newFrame;
}

static void
MakeTablePartAbsoluteContainingBlockIfNeeded(nsFrameConstructorState& aState,
const nsStyleDisplay* aDisplay,
nsFrameConstructorSaveState& aAbsSaveState,
nsIFrame* aFrame)
{
// If we're positioned, then we need to become an absolute containing block
// for any absolutely positioned children and register for post-reflow fixup.
//
// Note that usually if a frame type can be an absolute containing block, we
// always set NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN, whether it actually is or not.
// However, in this case flag serves the additional purpose of indicating that
// the frame was registered with its table frame. This allows us to avoid the
// overhead of unregistering the frame in most cases.
if (aDisplay->IsRelativelyPositionedStyle() ||
aDisplay->IsAbsolutelyPositionedStyle() ||
aDisplay->HasTransform(aFrame)) {
aFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
aState.PushAbsoluteContainingBlock(aFrame, aFrame, aAbsSaveState);
nsTableFrame::RegisterPositionedTablePart(aFrame);
}
}

nsIFrame*
nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aDisplay,
nsFrameItems& aFrameItems)
nsCSSFrameConstructor::ConstructTableRow(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aDisplay,
nsFrameItems& aFrameItems)
{
NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW_GROUP ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP ||
aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
NS_PRECONDITION(aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW,
"Unexpected call");
MOZ_ASSERT(aItem.mStyleContext->StyleDisplay() == aDisplay,
"Display style doesn't match style context");
nsIContent* const content = aItem.mContent;
nsStyleContext* const styleContext = aItem.mStyleContext;
const uint32_t nameSpaceID = aItem.mNameSpaceID;

nsIFrame* newFrame;
if (aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW) {
if (kNameSpaceID_MathML == nameSpaceID)
newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext);
else
newFrame = NS_NewTableRowFrame(mPresShell, styleContext);
} else {
newFrame = NS_NewTableRowGroupFrame(mPresShell, styleContext);
}
if (kNameSpaceID_MathML == nameSpaceID)
newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext);
else
newFrame = NS_NewTableRowFrame(mPresShell, styleContext);

InitAndRestoreFrame(aState, content, aParentFrame, newFrame);

nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
absoluteSaveState,
newFrame);

nsFrameItems childItems;
NS_ASSERTION(aItem.mAnonChildren.IsEmpty(),
"nsIAnonymousContentCreator::CreateAnonymousContent "
Expand Down Expand Up @@ -2144,11 +2107,6 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState,

InitAndRestoreFrame(aState, content, newFrame, cellInnerFrame);

nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(aState, aDisplay,
absoluteSaveState,
newFrame);

nsFrameItems childItems;
NS_ASSERTION(aItem.mAnonChildren.IsEmpty(),
"nsIAnonymousContentCreator::CreateAnonymousContent "
Expand Down Expand Up @@ -4435,17 +4393,20 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableCaptionFrame) },
{ NS_STYLE_DISPLAY_TABLE_ROW_GROUP,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
{ NS_STYLE_DISPLAY_TABLE_HEADER_GROUP,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
{ NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame) },
{ NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP,
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_DISALLOW_OUT_OF_FLOW |
FCDATA_SKIP_ABSPOS_PUSH |
Expand All @@ -4458,7 +4419,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
{ NS_STYLE_DISPLAY_TABLE_ROW,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup) },
&nsCSSFrameConstructor::ConstructTableRow) },
{ NS_STYLE_DISPLAY_TABLE_CELL,
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
Expand Down Expand Up @@ -8032,16 +7993,8 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
nullptr);
state.mCreatingExtraFrames = true;

nsStyleContext* const headerFooterStyleContext = rowGroupFrame->StyleContext();
headerFooterFrame = static_cast<nsTableRowGroupFrame*>
(NS_NewTableRowGroupFrame(aPresShell, headerFooterStyleContext));

nsFrameConstructorSaveState absoluteSaveState;
MakeTablePartAbsoluteContainingBlockIfNeeded(state,
headerFooterStyleContext->StyleDisplay(),
absoluteSaveState,
headerFooterFrame);

(NS_NewTableRowGroupFrame(aPresShell, rowGroupFrame->StyleContext()));
nsIContent* headerFooter = rowGroupFrame->GetContent();
headerFooterFrame->Init(headerFooter, newFrame, nullptr);
ProcessChildren(state, headerFooter, rowGroupFrame->StyleContext(),
Expand Down Expand Up @@ -8118,16 +8071,10 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
} else if (nsGkAtoms::tableRowGroupFrame == frameType) {
newFrame = NS_NewTableRowGroupFrame(shell, styleContext);
newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}
} else if (nsGkAtoms::tableRowFrame == frameType) {
newFrame = NS_NewTableRowFrame(shell, styleContext);

newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}

// Create a continuing frame for each table cell frame
nsFrameItems newChildList;
Expand All @@ -8152,9 +8099,6 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext,
newFrame = NS_NewTableCellFrame(shell, styleContext, IsBorderCollapse(aParentFrame));

newFrame->Init(content, aParentFrame, aFrame);
if (newFrame->GetStateBits() & NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN) {
nsTableFrame::RegisterPositionedTablePart(newFrame);
}

// Create a continuing area frame
nsIFrame* blockFrame = aFrame->GetFirstPrincipalChild();
Expand Down Expand Up @@ -8855,14 +8799,15 @@ nsCSSFrameConstructor::sPseudoParentData[eParentTypeCount] = {
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
&nsCSSFrameConstructor::ConstructTableRow),
&nsCSSAnonBoxes::tableRow
},
{ // Row group
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_USE_CHILD_ITEMS |
FCDATA_SKIP_ABSPOS_PUSH |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableRowGroupFrame),
&nsCSSAnonBoxes::tableRowGroup
},
{ // Column group
Expand Down
12 changes: 6 additions & 6 deletions layout/base/nsCSSFrameConstructor.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,13 +383,13 @@ class nsCSSFrameConstructor : public nsFrameManager
nsFrameItems& aFrameItems);

/**
* FrameConstructionData callback for constructing table rows and row groups.
* FrameConstructionData callback used for constructing table rows.
*/
nsIFrame* ConstructTableRowOrRowGroup(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aStyleDisplay,
nsFrameItems& aFrameItems);
nsIFrame* ConstructTableRow(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
nsIFrame* aParentFrame,
const nsStyleDisplay* aStyleDisplay,
nsFrameItems& aFrameItems);

/**
* FrameConstructionData callback used for constructing table columns.
Expand Down
27 changes: 0 additions & 27 deletions layout/generic/nsFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5118,39 +5118,12 @@ nsIFrame::GetOverflowAreas() const
nsRect(nsPoint(0, 0), GetSize()));
}

nsOverflowAreas
nsIFrame::GetOverflowAreasRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows) {
return nsOverflowAreas(preTransformOverflows->VisualOverflow(),
preTransformOverflows->ScrollableOverflow());
}
}
return nsOverflowAreas(GetVisualOverflowRect(),
GetScrollableOverflowRect());
}

nsRect
nsIFrame::GetScrollableOverflowRectRelativeToParent() const
{
return GetScrollableOverflowRect() + mRect.TopLeft();
}

nsRect
nsIFrame::GetScrollableOverflowRectRelativeToSelf() const
{
if (IsTransformed()) {
nsOverflowAreas* preTransformOverflows = static_cast<nsOverflowAreas*>
(Properties().Get(PreTransformOverflowAreasProperty()));
if (preTransformOverflows)
return preTransformOverflows->ScrollableOverflow();
}
return GetScrollableOverflowRect();
}

nsRect
nsIFrame::GetVisualOverflowRectRelativeToSelf() const
{
Expand Down
18 changes: 0 additions & 18 deletions layout/generic/nsIFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -2274,15 +2274,6 @@ class nsIFrame : public nsQueryFrame

nsOverflowAreas GetOverflowAreas() const;

/**
* Same as GetOverflowAreas, except in this frame's coordinate
* system (before transforms are applied).
*
* @return the overflow areas relative to this frame, before any CSS transforms have
* been applied, i.e. in this frame's coordinate system
*/
nsOverflowAreas GetOverflowAreasRelativeToSelf() const;

/**
* Same as GetScrollableOverflowRect, except relative to the parent
* frame.
Expand All @@ -2292,15 +2283,6 @@ class nsIFrame : public nsQueryFrame
*/
nsRect GetScrollableOverflowRectRelativeToParent() const;

/**
* Same as GetScrollableOverflowRect, except in this frame's coordinate
* system (before transforms are applied).
*
* @return the rect relative to this frame, before any CSS transforms have
* been applied, i.e. in this frame's coordinate system
*/
nsRect GetScrollableOverflowRectRelativeToSelf() const;

/**
* Like GetVisualOverflowRect, except in this frame's
* coordinate system (before transforms are applied).
Expand Down
20 changes: 0 additions & 20 deletions layout/reftests/abs-pos/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,6 @@ fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azur
== table-1.html table-1-ref.html
== table-2.html table-2-ref.html
== table-3.html table-3-ref.html
== table-cell-1.html table-internal-1-ref.html
== table-cell-2.html table-internal-2-ref.html
== table-cell-3.html table-internal-3-ref.html
== table-cell-4.html table-internal-4-ref.html
== table-row-1.html table-internal-1-ref.html
== table-row-2.html table-internal-2-ref.html
== table-row-3.html table-internal-3-ref.html
== table-row-4.html table-internal-4-ref.html
== table-row-group-1.html table-internal-1-ref.html
== table-row-group-2.html table-internal-2-ref.html
== table-row-group-3.html table-internal-3-ref.html
== table-row-group-4.html table-internal-4-ref.html
== table-header-group-1.html table-internal-1-ref.html
== table-header-group-2.html table-internal-2-ref.html
== table-header-group-3.html table-internal-3-ref.html
== table-header-group-4.html table-internal-4-ref.html
== table-footer-group-1.html table-internal-1-ref.html
== table-footer-group-2.html table-internal-2-ref.html
== table-footer-group-3.html table-internal-3-ref.html
== table-footer-group-4.html table-internal-4-ref.html
== continuation-positioned-inline-1.html continuation-positioned-inline-ref.html
== continuation-positioned-inline-2.html continuation-positioned-inline-ref.html
== scrollframe-1.html scrollframe-1-ref.html
Expand Down
36 changes: 0 additions & 36 deletions layout/reftests/abs-pos/table-cell-1.html

This file was deleted.

38 changes: 0 additions & 38 deletions layout/reftests/abs-pos/table-cell-2.html

This file was deleted.

Loading

0 comments on commit 026e40d

Please sign in to comment.