mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-22 23:27:30 +09:00
Issue #2135 - Bug 1329877: Optimize AncestorFilter usage in lazy frame construction
This commit is contained in:
parent
7b395189ac
commit
7924a2f60d
3 changed files with 112 additions and 33 deletions
|
|
@ -796,21 +796,23 @@ public:
|
||||||
|
|
||||||
nsCOMArray<nsIContent> mGeneratedTextNodesWithInitializer;
|
nsCOMArray<nsIContent> mGeneratedTextNodesWithInitializer;
|
||||||
|
|
||||||
TreeMatchContext mTreeMatchContext;
|
TreeMatchContext& mTreeMatchContext;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
// Use the passed-in history state.
|
// Use the passed-in history state.
|
||||||
nsFrameConstructorState(
|
nsFrameConstructorState(
|
||||||
nsIPresShell* aPresShell,
|
nsIPresShell* aPresShell,
|
||||||
|
TreeMatchContext& aTreeMatchContext,
|
||||||
nsContainerFrame* aFixedContainingBlock,
|
nsContainerFrame* aFixedContainingBlock,
|
||||||
nsContainerFrame* aAbsoluteContainingBlock,
|
nsContainerFrame* aAbsoluteContainingBlock,
|
||||||
nsContainerFrame* aFloatContainingBlock,
|
nsContainerFrame* aFloatContainingBlock,
|
||||||
already_AddRefed<nsILayoutHistoryState> aHistoryState);
|
already_AddRefed<nsILayoutHistoryState> aHistoryState);
|
||||||
// Get the history state from the pres context's pres shell.
|
// Get the history state from the pres context's pres shell.
|
||||||
nsFrameConstructorState(nsIPresShell* aPresShell,
|
nsFrameConstructorState(nsIPresShell* aPresShell,
|
||||||
nsContainerFrame* aFixedContainingBlock,
|
TreeMatchContext& aTreeMatchContext,
|
||||||
nsContainerFrame* aAbsoluteContainingBlock,
|
nsContainerFrame* aFixedContainingBlock,
|
||||||
nsContainerFrame* aFloatContainingBlock);
|
nsContainerFrame* aAbsoluteContainingBlock,
|
||||||
|
nsContainerFrame* aFloatContainingBlock);
|
||||||
|
|
||||||
~nsFrameConstructorState();
|
~nsFrameConstructorState();
|
||||||
|
|
||||||
|
|
@ -963,6 +965,7 @@ protected:
|
||||||
|
|
||||||
nsFrameConstructorState::nsFrameConstructorState(
|
nsFrameConstructorState::nsFrameConstructorState(
|
||||||
nsIPresShell* aPresShell,
|
nsIPresShell* aPresShell,
|
||||||
|
TreeMatchContext& aTreeMatchContext,
|
||||||
nsContainerFrame* aFixedContainingBlock,
|
nsContainerFrame* aFixedContainingBlock,
|
||||||
nsContainerFrame* aAbsoluteContainingBlock,
|
nsContainerFrame* aAbsoluteContainingBlock,
|
||||||
nsContainerFrame* aFloatContainingBlock,
|
nsContainerFrame* aFloatContainingBlock,
|
||||||
|
|
@ -989,8 +992,7 @@ nsFrameConstructorState::nsFrameConstructorState(
|
||||||
mFixedPosIsAbsPos(aFixedContainingBlock == aAbsoluteContainingBlock),
|
mFixedPosIsAbsPos(aFixedContainingBlock == aAbsoluteContainingBlock),
|
||||||
mHavePendingPopupgroup(false),
|
mHavePendingPopupgroup(false),
|
||||||
mCreatingExtraFrames(false),
|
mCreatingExtraFrames(false),
|
||||||
mTreeMatchContext(true, nsRuleWalker::eRelevantLinkUnvisited,
|
mTreeMatchContext(aTreeMatchContext),
|
||||||
aPresShell->GetDocument()),
|
|
||||||
mCurrentPendingBindingInsertionPoint(nullptr)
|
mCurrentPendingBindingInsertionPoint(nullptr)
|
||||||
{
|
{
|
||||||
#ifdef MOZ_XUL
|
#ifdef MOZ_XUL
|
||||||
|
|
@ -1003,10 +1005,13 @@ nsFrameConstructorState::nsFrameConstructorState(
|
||||||
}
|
}
|
||||||
|
|
||||||
nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell,
|
nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell,
|
||||||
|
TreeMatchContext& aTreeMatchContext,
|
||||||
nsContainerFrame* aFixedContainingBlock,
|
nsContainerFrame* aFixedContainingBlock,
|
||||||
nsContainerFrame* aAbsoluteContainingBlock,
|
nsContainerFrame* aAbsoluteContainingBlock,
|
||||||
nsContainerFrame* aFloatContainingBlock)
|
nsContainerFrame* aFloatContainingBlock)
|
||||||
: nsFrameConstructorState(aPresShell, aFixedContainingBlock,
|
: nsFrameConstructorState(aPresShell,
|
||||||
|
aTreeMatchContext,
|
||||||
|
aFixedContainingBlock,
|
||||||
aAbsoluteContainingBlock,
|
aAbsoluteContainingBlock,
|
||||||
aFloatContainingBlock,
|
aFloatContainingBlock,
|
||||||
aPresShell->GetDocument()->GetLayoutHistoryState())
|
aPresShell->GetDocument()->GetLayoutHistoryState())
|
||||||
|
|
@ -2417,13 +2422,15 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
|
||||||
|
|
||||||
NS_ASSERTION(mDocElementContainingBlock, "Should have parent by now");
|
NS_ASSERTION(mDocElementContainingBlock, "Should have parent by now");
|
||||||
|
|
||||||
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
// Initialize the ancestor filter with null for now; we'll push
|
||||||
|
// aDocElement once we finish resolving style for it.
|
||||||
|
matchContext.InitAncestors(nullptr);
|
||||||
nsFrameConstructorState state(mPresShell,
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
matchContext,
|
||||||
GetAbsoluteContainingBlock(mDocElementContainingBlock, FIXED_POS),
|
GetAbsoluteContainingBlock(mDocElementContainingBlock, FIXED_POS),
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr, do_AddRef(aFrameState));
|
nullptr, do_AddRef(aFrameState));
|
||||||
// Initialize the ancestor filter with null for now; we'll push
|
|
||||||
// aDocElement once we finish resolving style for it.
|
|
||||||
state.mTreeMatchContext.InitAncestors(nullptr);
|
|
||||||
|
|
||||||
// XXXbz why, exactly?
|
// XXXbz why, exactly?
|
||||||
if (!mTempFrameTreeState)
|
if (!mTempFrameTreeState)
|
||||||
|
|
@ -2856,7 +2863,8 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
|
||||||
RefPtr<nsStyleContext> rootPseudoStyle;
|
RefPtr<nsStyleContext> rootPseudoStyle;
|
||||||
// we must create a state because if the scrollbars are GFX it needs the
|
// we must create a state because if the scrollbars are GFX it needs the
|
||||||
// state to build the scrollbar frames.
|
// state to build the scrollbar frames.
|
||||||
nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr);
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
nsFrameConstructorState state(mPresShell, matchContext, nullptr, nullptr, nullptr);
|
||||||
|
|
||||||
// Start off with the viewport as parent; we'll adjust it as needed.
|
// Start off with the viewport as parent; we'll adjust it as needed.
|
||||||
nsContainerFrame* parentFrame = viewportFrame;
|
nsContainerFrame* parentFrame = viewportFrame;
|
||||||
|
|
@ -7023,12 +7031,16 @@ nsCSSFrameConstructor::MaybeConstructLazily(Operation aOperation,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSFrameConstructor::CreateNeededFrames(nsIContent* aContent)
|
nsCSSFrameConstructor::CreateNeededFrames(nsIContent* aContent,
|
||||||
|
TreeMatchContext& aTreeMatchContext)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!aContent->HasFlag(NODE_NEEDS_FRAME),
|
NS_ASSERTION(!aContent->HasFlag(NODE_NEEDS_FRAME),
|
||||||
"shouldn't get here with a content node that has needs frame bit set");
|
"shouldn't get here with a content node that has needs frame bit set");
|
||||||
NS_ASSERTION(aContent->HasFlag(NODE_DESCENDANTS_NEED_FRAMES),
|
NS_ASSERTION(aContent->HasFlag(NODE_DESCENDANTS_NEED_FRAMES),
|
||||||
"should only get here with a content node that has descendants needing frames");
|
"should only get here with a content node that has descendants needing frames");
|
||||||
|
NS_ASSERTION(aTreeMatchContext.mAncestorFilter.HasFilter(),
|
||||||
|
"The whole point of having the tree match context is optimizing "
|
||||||
|
"the ancestor filter usage!");
|
||||||
|
|
||||||
aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES);
|
aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES);
|
||||||
|
|
||||||
|
|
@ -7064,19 +7076,31 @@ nsCSSFrameConstructor::CreateNeededFrames(nsIContent* aContent)
|
||||||
inRun = false;
|
inRun = false;
|
||||||
// generate a ContentRangeInserted for [startOfRun,i)
|
// generate a ContentRangeInserted for [startOfRun,i)
|
||||||
ContentRangeInserted(aContent, firstChildInRun, child, nullptr,
|
ContentRangeInserted(aContent, firstChildInRun, child, nullptr,
|
||||||
false);
|
false, &aTreeMatchContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inRun) {
|
if (inRun) {
|
||||||
ContentAppended(aContent, firstChildInRun, false);
|
ContentAppended(aContent, firstChildInRun, false, &aTreeMatchContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now descend.
|
// Now descend.
|
||||||
FlattenedChildIterator iter(aContent);
|
FlattenedChildIterator iter(aContent);
|
||||||
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
|
for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
|
||||||
if (child->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
|
if (child->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
|
||||||
CreateNeededFrames(child);
|
TreeMatchContext::AutoAncestorPusher insertionPointPusher(
|
||||||
|
aTreeMatchContext);
|
||||||
|
|
||||||
|
// Handle stuff like xbl:children.
|
||||||
|
if (child->GetParent() != aContent && child->GetParent()->IsElement()) {
|
||||||
|
insertionPointPusher.PushAncestorAndStyleScope(
|
||||||
|
child->GetParent()->AsElement());
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeMatchContext::AutoAncestorPusher pusher(aTreeMatchContext);
|
||||||
|
pusher.PushAncestorAndStyleScope(child);
|
||||||
|
|
||||||
|
CreateNeededFrames(child, aTreeMatchContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7091,7 +7115,9 @@ void nsCSSFrameConstructor::CreateNeededFrames()
|
||||||
"root element should not have frame created lazily");
|
"root element should not have frame created lazily");
|
||||||
if (rootElement && rootElement->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
|
if (rootElement && rootElement->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
|
||||||
BeginUpdate();
|
BeginUpdate();
|
||||||
CreateNeededFrames(rootElement);
|
TreeMatchContext treeMatchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
treeMatchContext.InitAncestors(rootElement);
|
||||||
|
CreateNeededFrames(rootElement, treeMatchContext);
|
||||||
EndUpdate();
|
EndUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -7208,10 +7234,13 @@ nsCSSFrameConstructor::MaybeRecreateForFrameset(nsIFrame* aParentFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
||||||
nsIContent* aFirstNewContent,
|
nsIContent* aFirstNewContent,
|
||||||
bool aAllowLazyConstruction)
|
bool aAllowLazyConstruction,
|
||||||
|
TreeMatchContext* aProvidedTreeMatchContext)
|
||||||
{
|
{
|
||||||
|
MOZ_ASSERT_IF(aProvidedTreeMatchContext, !aAllowLazyConstruction);
|
||||||
|
|
||||||
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
|
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
|
||||||
NS_PRECONDITION(mUpdateCount != 0,
|
NS_PRECONDITION(mUpdateCount != 0,
|
||||||
"Should be in an update while creating frames");
|
"Should be in an update while creating frames");
|
||||||
|
|
@ -7391,13 +7420,23 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create some new frames
|
// Create some new frames
|
||||||
|
//
|
||||||
|
// We use the provided tree match context, or create a new one on the fly
|
||||||
|
// otherwise.
|
||||||
|
Maybe<TreeMatchContext> matchContext;
|
||||||
|
if (!aProvidedTreeMatchContext) {
|
||||||
|
matchContext.emplace(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
// We use GetParentElementCrossingShadowRoot to handle the case where
|
||||||
|
// aContainer is a ShadowRoot.
|
||||||
|
matchContext->InitAncestors(aFirstNewContent->GetParentElementCrossingShadowRoot());
|
||||||
|
}
|
||||||
nsFrameConstructorState state(mPresShell,
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
aProvidedTreeMatchContext
|
||||||
|
? *aProvidedTreeMatchContext
|
||||||
|
: *matchContext,
|
||||||
GetAbsoluteContainingBlock(parentFrame, FIXED_POS),
|
GetAbsoluteContainingBlock(parentFrame, FIXED_POS),
|
||||||
GetAbsoluteContainingBlock(parentFrame, ABS_POS),
|
GetAbsoluteContainingBlock(parentFrame, ABS_POS),
|
||||||
containingBlock);
|
containingBlock);
|
||||||
// We use GetParentElementCrossingShadowRoot to handle the case where
|
|
||||||
// aContainer is a ShadowRoot.
|
|
||||||
state.mTreeMatchContext.InitAncestors(aFirstNewContent->GetParentElementCrossingShadowRoot());
|
|
||||||
|
|
||||||
nsIAtom* frameType = parentFrame->GetType();
|
nsIAtom* frameType = parentFrame->GetType();
|
||||||
|
|
||||||
|
|
@ -7606,7 +7645,8 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
|
||||||
nsIContent* aStartChild,
|
nsIContent* aStartChild,
|
||||||
nsIContent* aEndChild,
|
nsIContent* aEndChild,
|
||||||
nsILayoutHistoryState* aFrameState,
|
nsILayoutHistoryState* aFrameState,
|
||||||
bool aAllowLazyConstruction)
|
bool aAllowLazyConstruction,
|
||||||
|
TreeMatchContext* aProvidedTreeMatchContext)
|
||||||
{
|
{
|
||||||
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
|
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
|
||||||
NS_PRECONDITION(mUpdateCount != 0,
|
NS_PRECONDITION(mUpdateCount != 0,
|
||||||
|
|
@ -7839,14 +7879,21 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Maybe<TreeMatchContext> matchContext;
|
||||||
|
if (!aProvidedTreeMatchContext) {
|
||||||
|
matchContext.emplace(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
// We use GetParentElementCrossingShadowRoot to handle the case where
|
||||||
|
// aContainer is a ShadowRoot.
|
||||||
|
matchContext->InitAncestors(aStartChild->GetParentElementCrossingShadowRoot());
|
||||||
|
}
|
||||||
nsFrameConstructorState state(mPresShell,
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
aProvidedTreeMatchContext
|
||||||
|
? *aProvidedTreeMatchContext
|
||||||
|
: *matchContext,
|
||||||
GetAbsoluteContainingBlock(insertion.mParentFrame, FIXED_POS),
|
GetAbsoluteContainingBlock(insertion.mParentFrame, FIXED_POS),
|
||||||
GetAbsoluteContainingBlock(insertion.mParentFrame, ABS_POS),
|
GetAbsoluteContainingBlock(insertion.mParentFrame, ABS_POS),
|
||||||
GetFloatContainingBlock(insertion.mParentFrame),
|
GetFloatContainingBlock(insertion.mParentFrame),
|
||||||
do_AddRef(aFrameState));
|
do_AddRef(aFrameState));
|
||||||
// We use GetParentElementCrossingShadowRoot to handle the case where
|
|
||||||
// aContainer is a ShadowRoot.
|
|
||||||
state.mTreeMatchContext.InitAncestors(aStartChild->GetParentElementCrossingShadowRoot());
|
|
||||||
|
|
||||||
// Recover state for the containing block - we need to know if
|
// Recover state for the containing block - we need to know if
|
||||||
// it has :first-letter or :first-line style applied to it. The
|
// it has :first-letter or :first-line style applied to it. The
|
||||||
|
|
@ -8695,7 +8742,9 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell,
|
||||||
// Replicate the header/footer frame.
|
// Replicate the header/footer frame.
|
||||||
nsTableRowGroupFrame* headerFooterFrame;
|
nsTableRowGroupFrame* headerFooterFrame;
|
||||||
nsFrameItems childItems;
|
nsFrameItems childItems;
|
||||||
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
nsFrameConstructorState state(mPresShell,
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
matchContext,
|
||||||
GetAbsoluteContainingBlock(newFrame, FIXED_POS),
|
GetAbsoluteContainingBlock(newFrame, FIXED_POS),
|
||||||
GetAbsoluteContainingBlock(newFrame, ABS_POS),
|
GetAbsoluteContainingBlock(newFrame, ABS_POS),
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
@ -8969,7 +9018,10 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame)
|
||||||
// This should not normally be possible (because fixed-pos elements should
|
// This should not normally be possible (because fixed-pos elements should
|
||||||
// be absolute containers) but fixed-pos tables currently aren't abs-pos
|
// be absolute containers) but fixed-pos tables currently aren't abs-pos
|
||||||
// containers.
|
// containers.
|
||||||
nsFrameConstructorState state(mPresShell, aParentFrame,
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
matchContext,
|
||||||
|
aParentFrame,
|
||||||
nullptr,
|
nullptr,
|
||||||
mRootElementFrame);
|
mRootElementFrame);
|
||||||
state.mCreatingExtraFrames = true;
|
state.mCreatingExtraFrames = true;
|
||||||
|
|
@ -11109,7 +11161,10 @@ nsCSSFrameConstructor::CreateLetterFrame(nsContainerFrame* aBlockFrame,
|
||||||
|
|
||||||
NS_ASSERTION(aBlockContinuation == GetFloatContainingBlock(aParentFrame),
|
NS_ASSERTION(aBlockContinuation == GetFloatContainingBlock(aParentFrame),
|
||||||
"Containing block is confused");
|
"Containing block is confused");
|
||||||
|
TreeMatchContext matchContext(mDocument,
|
||||||
|
TreeMatchContext::ForFrameConstruction);
|
||||||
nsFrameConstructorState state(mPresShell,
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
matchContext,
|
||||||
GetAbsoluteContainingBlock(aParentFrame, FIXED_POS),
|
GetAbsoluteContainingBlock(aParentFrame, FIXED_POS),
|
||||||
GetAbsoluteContainingBlock(aParentFrame, ABS_POS),
|
GetAbsoluteContainingBlock(aParentFrame, ABS_POS),
|
||||||
aBlockContinuation);
|
aBlockContinuation);
|
||||||
|
|
@ -11485,7 +11540,10 @@ nsCSSFrameConstructor::CreateListBoxContent(nsContainerFrame* aParentFrame,
|
||||||
// Construct a new frame
|
// Construct a new frame
|
||||||
if (nullptr != aParentFrame) {
|
if (nullptr != aParentFrame) {
|
||||||
nsFrameItems frameItems;
|
nsFrameItems frameItems;
|
||||||
nsFrameConstructorState state(mPresShell, GetAbsoluteContainingBlock(aParentFrame, FIXED_POS),
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
nsFrameConstructorState state(mPresShell,
|
||||||
|
matchContext,
|
||||||
|
GetAbsoluteContainingBlock(aParentFrame, FIXED_POS),
|
||||||
GetAbsoluteContainingBlock(aParentFrame, ABS_POS),
|
GetAbsoluteContainingBlock(aParentFrame, ABS_POS),
|
||||||
GetFloatContainingBlock(aParentFrame),
|
GetFloatContainingBlock(aParentFrame),
|
||||||
do_AddRef(mTempFrameTreeState.get()));
|
do_AddRef(mTempFrameTreeState.get()));
|
||||||
|
|
@ -12376,7 +12434,8 @@ nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame)
|
||||||
BeginUpdate();
|
BeginUpdate();
|
||||||
|
|
||||||
nsFrameItems childItems;
|
nsFrameItems childItems;
|
||||||
nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr);
|
TreeMatchContext matchContext(mDocument, TreeMatchContext::ForFrameConstruction);
|
||||||
|
nsFrameConstructorState state(mPresShell, matchContext, nullptr, nullptr, nullptr);
|
||||||
// We don't have a parent frame with a pending binding constructor here,
|
// We don't have a parent frame with a pending binding constructor here,
|
||||||
// so no need to worry about ordering of the kids' constructors with it.
|
// so no need to worry about ordering of the kids' constructors with it.
|
||||||
// Pass null for the PendingBinding.
|
// Pass null for the PendingBinding.
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,8 @@ public:
|
||||||
void CreateNeededFrames();
|
void CreateNeededFrames();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void CreateNeededFrames(nsIContent* aContent);
|
void CreateNeededFrames(nsIContent* aContent,
|
||||||
|
TreeMatchContext& aTreeMatchContext);
|
||||||
|
|
||||||
enum Operation {
|
enum Operation {
|
||||||
CONTENTAPPEND,
|
CONTENTAPPEND,
|
||||||
|
|
@ -202,9 +203,15 @@ public:
|
||||||
|
|
||||||
// If aAllowLazyConstruction is true then frame construction of the new
|
// If aAllowLazyConstruction is true then frame construction of the new
|
||||||
// children can be done lazily.
|
// children can be done lazily.
|
||||||
|
//
|
||||||
|
// When constructing frames lazily, we can keep the tree match context in a
|
||||||
|
// much easier way than nsFrameConstructorState, and thus, we're allowed to
|
||||||
|
// provide a TreeMatchContext to avoid calling InitAncestors repeatedly deep
|
||||||
|
// in the DOM.
|
||||||
void ContentAppended(nsIContent* aContainer,
|
void ContentAppended(nsIContent* aContainer,
|
||||||
nsIContent* aFirstNewContent,
|
nsIContent* aFirstNewContent,
|
||||||
bool aAllowLazyConstruction);
|
bool aAllowLazyConstruction,
|
||||||
|
TreeMatchContext* aProvidedTreeMatchContext = nullptr);
|
||||||
|
|
||||||
// If aAllowLazyConstruction is true then frame construction of the new child
|
// If aAllowLazyConstruction is true then frame construction of the new child
|
||||||
// can be done lazily.
|
// can be done lazily.
|
||||||
|
|
@ -219,11 +226,15 @@ public:
|
||||||
// aStartChild. If aAllowLazyConstruction is true then frame construction of
|
// aStartChild. If aAllowLazyConstruction is true then frame construction of
|
||||||
// the new children can be done lazily. It is only allowed to be true when
|
// the new children can be done lazily. It is only allowed to be true when
|
||||||
// inserting a single node.
|
// inserting a single node.
|
||||||
|
//
|
||||||
|
// See ContentAppended to see why we allow passing an already initialized
|
||||||
|
// TreeMatchContext.
|
||||||
void ContentRangeInserted(nsIContent* aContainer,
|
void ContentRangeInserted(nsIContent* aContainer,
|
||||||
nsIContent* aStartChild,
|
nsIContent* aStartChild,
|
||||||
nsIContent* aEndChild,
|
nsIContent* aEndChild,
|
||||||
nsILayoutHistoryState* aFrameState,
|
nsILayoutHistoryState* aFrameState,
|
||||||
bool aAllowLazyConstruction);
|
bool aAllowLazyConstruction,
|
||||||
|
TreeMatchContext* aProvidedTreeMatchContext = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// FIXME(emilio): How important is it to keep the frame tree state around for
|
// FIXME(emilio): How important is it to keep the frame tree state around for
|
||||||
|
|
|
||||||
|
|
@ -444,6 +444,15 @@ struct MOZ_STACK_CLASS TreeMatchContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ForFrameConstructionTag { ForFrameConstruction };
|
||||||
|
|
||||||
|
TreeMatchContext(nsIDocument* aDocument,
|
||||||
|
ForFrameConstructionTag)
|
||||||
|
: TreeMatchContext(true,
|
||||||
|
nsRuleWalker::eRelevantLinkUnvisited,
|
||||||
|
aDocument)
|
||||||
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MOZ_STACK_CLASS RuleProcessorData {
|
struct MOZ_STACK_CLASS RuleProcessorData {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue