Bug 1451169 - Reduce indirection for PseudoParentData::mPseudoType. r=xidorn
MozReview-Commit-ID: CiXGCKrpfCB
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9380,92 +9380,92 @@ nsCSSFrameConstructor::ShouldHaveSpecial
const nsCSSFrameConstructor::PseudoParentData
nsCSSFrameConstructor::sPseudoParentData[eParentTypeCount] = {
{ // Cell
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRow),
&nsCSSFrameConstructor::ConstructTableCell),
- &nsCSSAnonBoxes::tableCell
+ nsCSSAnonBoxes::tableCell
},
{ // Row
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRowGroup),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
- &nsCSSAnonBoxes::tableRow
+ nsCSSAnonBoxes::tableRow
},
{ // Row group
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
&nsCSSFrameConstructor::ConstructTableRowOrRowGroup),
- &nsCSSAnonBoxes::tableRowGroup
+ nsCSSAnonBoxes::tableRowGroup
},
{ // Column group
FCDATA_DECL(FCDATA_IS_TABLE_PART | FCDATA_SKIP_FRAMESET |
FCDATA_DISALLOW_OUT_OF_FLOW | FCDATA_USE_CHILD_ITEMS |
FCDATA_SKIP_ABSPOS_PUSH |
// Not FCDATA_IS_WRAPPER_ANON_BOX, because we don't need to
// restyle these: they have non-inheriting styles.
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable),
NS_NewTableColGroupFrame),
- &nsCSSAnonBoxes::tableColGroup
+ nsCSSAnonBoxes::tableColGroup
},
{ // Table
FULL_CTOR_FCDATA(FCDATA_SKIP_FRAMESET | FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX,
&nsCSSFrameConstructor::ConstructTable),
- &nsCSSAnonBoxes::table
+ nsCSSAnonBoxes::table
},
{ // Ruby
FCDATA_DECL(FCDATA_IS_LINE_PARTICIPANT |
FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_SKIP_FRAMESET,
NS_NewRubyFrame),
- &nsCSSAnonBoxes::ruby
+ nsCSSAnonBoxes::ruby
},
{ // Ruby Base
FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_LINE_PARTICIPANT |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyBaseContainer) |
FCDATA_SKIP_FRAMESET,
NS_NewRubyBaseFrame),
- &nsCSSAnonBoxes::rubyBase
+ nsCSSAnonBoxes::rubyBase
},
{ // Ruby Base Container
FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_LINE_PARTICIPANT |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby) |
FCDATA_SKIP_FRAMESET,
NS_NewRubyBaseContainerFrame),
- &nsCSSAnonBoxes::rubyBaseContainer
+ nsCSSAnonBoxes::rubyBaseContainer
},
{ // Ruby Text
FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_LINE_PARTICIPANT |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRubyTextContainer) |
FCDATA_SKIP_FRAMESET,
NS_NewRubyTextFrame),
- &nsCSSAnonBoxes::rubyText
+ nsCSSAnonBoxes::rubyText
},
{ // Ruby Text Container
FCDATA_DECL(FCDATA_USE_CHILD_ITEMS |
FCDATA_IS_WRAPPER_ANON_BOX |
FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeRuby) |
FCDATA_SKIP_FRAMESET,
NS_NewRubyTextContainerFrame),
- &nsCSSAnonBoxes::rubyTextContainer
+ nsCSSAnonBoxes::rubyTextContainer
}
};
void
nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems(
nsFrameConstructorState& aState,
FrameConstructionItemList& aItems,
nsIFrame* aParentFrame)
@@ -10027,17 +10027,17 @@ nsCSSFrameConstructor::CreateNeededPseud
void
nsCSSFrameConstructor::WrapItemsInPseudoParent(nsIContent* aParentContent,
ComputedStyle* aParentStyle,
ParentType aWrapperType,
FCItemIterator& aIter,
const FCItemIterator& aEndIter)
{
const PseudoParentData& pseudoData = sPseudoParentData[aWrapperType];
- nsAtom* pseudoType = *pseudoData.mPseudoType;
+ nsICSSAnonBoxPseudo* pseudoType = pseudoData.mPseudoType;
StyleDisplay parentDisplay = aParentStyle->StyleDisplay()->mDisplay;
if (pseudoType == nsCSSAnonBoxes::table &&
(parentDisplay == StyleDisplay::Inline ||
parentDisplay == StyleDisplay::RubyBase ||
parentDisplay == StyleDisplay::RubyText)) {
pseudoType = nsCSSAnonBoxes::inlineTable;
}
@@ -10116,24 +10116,24 @@ nsCSSFrameConstructor::CreateNeededPseud
return;
}
NS_ASSERTION(firstDisplay == StyleDisplay::RubyTextContainer,
"Child of ruby frame should either a rbc or a rtc");
const PseudoParentData& pseudoData =
sPseudoParentData[eTypeRubyBaseContainer];
already_AddRefed<ComputedStyle> pseudoStyle = mPresShell->StyleSet()->
- ResolveInheritingAnonymousBoxStyle(*pseudoData.mPseudoType,
+ ResolveInheritingAnonymousBoxStyle(pseudoData.mPseudoType,
aParentFrame->Style());
FrameConstructionItem* newItem =
new (this) FrameConstructionItem(&pseudoData.mFCData,
// Use the content of the parent frame
aParentFrame->GetContent(),
// Tag type
- *pseudoData.mPseudoType,
+ pseudoData.mPseudoType,
// Use the namespace of the rtc frame
iter.item().mNameSpaceID,
// no pending binding
nullptr,
pseudoStyle,
true, nullptr);
newItem->mIsAllInline = true;
newItem->mChildItems.SetParentHasNoXBLChildren(true);
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -777,17 +777,17 @@ private:
#define FCDATA_FOR_DISPLAY(_display, _fcdata) \
{ _fcdata }
#endif
/* Structure that has a FrameConstructionData and style pseudo-type
for a table pseudo-frame */
struct PseudoParentData {
const FrameConstructionData mFCData;
- nsICSSAnonBoxPseudo* const* mPseudoType;
+ nsICSSAnonBoxPseudo* const mPseudoType;
};
/* Array of such structures that we use to properly construct table
pseudo-frames as needed */
static const PseudoParentData sPseudoParentData[eParentTypeCount];
/* A function that takes an integer, content, style, and array of
FrameConstructionDataByInts and finds the appropriate frame construction
data to use and returns it. This can return null if none of the integers