Issue #2488 - Part 3: Remove the StyleSetHandle smart pointer class

This commit is contained in:
FranklinDM 2024-03-29 01:40:22 +08:00 committed by roytam1
commit 4bf43b8fb4
58 changed files with 155 additions and 589 deletions

View file

@ -34,8 +34,7 @@
#include "nsPresShell.h"
#include "nsIPresShell.h"
#include "nsUnicharUtils.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsViewManager.h"
#include "nsStyleConsts.h"
#include "nsIDOMXULElement.h"
@ -1837,7 +1836,7 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat
MOZ_ASSERT(aParentContent->IsElement());
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
// Probe for the existence of the pseudo-element
RefPtr<nsStyleContext> pseudoStyleContext;
@ -2691,11 +2690,11 @@ nsCSSFrameConstructor::ConstructRootFrame()
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
// Set up our style rule observer.
// XXXbz wouldn't this make more sense as part of presshell init?
styleSet->AsGecko()->SetBindingManager(mDocument->BindingManager());
styleSet->SetBindingManager(mDocument->BindingManager());
// --------- BUILD VIEWPORT -----------
RefPtr<nsStyleContext> viewportPseudoStyle =
@ -2860,7 +2859,7 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement)
// Start off with the viewport as parent; we'll adjust it as needed.
nsContainerFrame* parentFrame = viewportFrame;
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
// If paginated, make sure we don't put scrollbars in
if (!isScrollable) {
rootPseudoStyle = styleSet->ResolveAnonymousBoxStyle(rootPseudo,
@ -2961,7 +2960,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell,
nsContainerFrame*& aCanvasFrame)
{
nsStyleContext* parentStyleContext = aParentFrame->StyleContext();
StyleSetHandle styleSet = aPresShell->StyleSet();
nsStyleSet* styleSet = aPresShell->StyleSet();
RefPtr<nsStyleContext> pagePseudoStyle;
pagePseudoStyle = styleSet->ResolveAnonymousBoxStyle(nsCSSAnonBoxes::page,
@ -4560,7 +4559,7 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState,
aNewFrame = gfxScrollFrame;
// we used the style that was passed in. So resolve another one.
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
RefPtr<nsStyleContext> scrolledChildStyle =
styleSet->ResolveAnonymousBoxStyle(aScrolledPseudo, contentStyle);
@ -5014,7 +5013,7 @@ nsCSSFrameConstructor::ResolveStyleContext(nsStyleContext* aParentStyleContext,
nsFrameConstructorState* aState,
Element* aOriginatingElementOrNull)
{
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
aContent->OwnerDoc()->FlushPendingLinkUpdates();
RefPtr<nsStyleContext> result;
@ -5096,7 +5095,7 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
nsStyleContext* parentContext =
nsFrame::CorrectStyleParentFrame(aParentFrame,
anonPseudo)->StyleContext();
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
RefPtr<nsStyleContext> blockContext;
blockContext = styleSet->
ResolveAnonymousBoxStyle(anonPseudo, parentContext);
@ -11031,7 +11030,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame(
// get a proper style context for it (the one passed in is for the
// letter frame and will have the float property set on it; the text
// frame shouldn't have that set).
StyleSetHandle styleSet = mPresShell->StyleSet();
nsStyleSet* styleSet = mPresShell->StyleSet();
RefPtr<nsStyleContext> textSC = styleSet->
ResolveStyleForText(aTextContent, aStyleContext);
aTextFrame->SetStyleContextWithoutNotification(textSC);