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

@ -1268,7 +1268,7 @@ CreateStyleContextForAnimationValue(nsCSSPropertyID aProperty,
rules.AppendObject(styleRule);
nsStyleSet* styleSet =
aBaseStyleContext->PresContext()->StyleSet()->AsGecko();
aBaseStyleContext->PresContext()->StyleSet();
RefPtr<nsStyleContext> styleContext =
styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules);

View file

@ -245,8 +245,6 @@
#include "mozilla/dom/BoxObject.h"
#include "gfxPrefs.h"
#include "nsISupportsPrimitives.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/dom/SVGSVGElement.h"
@ -2073,7 +2071,7 @@ nsDocument::RemoveDocStyleSheetsFromStyleSets()
if (sheet->IsApplicable()) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->RemoveDocStyleSheet(sheet);
shell->StyleSet()->RemoveDocStyleSheet(sheet->AsGecko());
}
}
// XXX Tell observers?
@ -2092,7 +2090,7 @@ nsDocument::RemoveStyleSheetsFromStyleSets(
if (sheet->IsApplicable()) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->RemoveStyleSheet(aType, sheet);
shell->StyleSet()->RemoveStyleSheet(aType, sheet->AsGecko());
}
}
// XXX Tell observers?
@ -2158,18 +2156,18 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
}
static void
AppendSheetsToStyleSet(StyleSetHandle aStyleSet,
AppendSheetsToStyleSet(nsStyleSet* aStyleSet,
const nsTArray<RefPtr<StyleSheet>>& aSheets,
SheetType aType)
{
for (StyleSheet* sheet : Reversed(aSheets)) {
aStyleSet->AppendStyleSheet(aType, sheet);
aStyleSet->AppendStyleSheet(aType, sheet->AsGecko());
}
}
void
nsDocument::FillStyleSet(StyleSetHandle aStyleSet)
nsDocument::FillStyleSet(nsStyleSet* aStyleSet)
{
NS_PRECONDITION(aStyleSet, "Must have a style set");
NS_PRECONDITION(aStyleSet->SheetCount(SheetType::Doc) == 0,
@ -2179,21 +2177,21 @@ nsDocument::FillStyleSet(StyleSetHandle aStyleSet)
for (StyleSheet* sheet : Reversed(mStyleSheets)) {
if (sheet->IsApplicable()) {
aStyleSet->AddDocStyleSheet(sheet, this);
aStyleSet->AddDocStyleSheet(sheet->AsGecko(), this);
}
}
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
for (StyleSheet* sheet : *sheetService->AuthorStyleSheets()) {
aStyleSet->AppendStyleSheet(SheetType::Doc, sheet);
aStyleSet->AppendStyleSheet(SheetType::Doc, sheet->AsGecko());
}
}
// Iterate backwards to maintain order
for (StyleSheet* sheet : Reversed(mOnDemandBuiltInUASheets)) {
if (sheet->IsApplicable()) {
aStyleSet->PrependStyleSheet(SheetType::Agent, sheet);
aStyleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
@ -3431,7 +3429,7 @@ nsDocument::TryChannelCharset(nsIChannel *aChannel,
already_AddRefed<nsIPresShell>
nsDocument::CreateShell(nsPresContext* aContext, nsViewManager* aViewManager,
StyleSetHandle aStyleSet)
nsStyleSet* aStyleSet)
{
// Don't add anything here. Add it to |doCreateShell| instead.
// This exists so that subclasses can pass other values for the 4th
@ -3441,7 +3439,7 @@ nsDocument::CreateShell(nsPresContext* aContext, nsViewManager* aViewManager,
already_AddRefed<nsIPresShell>
nsDocument::doCreateShell(nsPresContext* aContext,
nsViewManager* aViewManager, StyleSetHandle aStyleSet)
nsViewManager* aViewManager, nsStyleSet* aStyleSet)
{
NS_ASSERTION(!mPresShell, "We have a presshell already!");
@ -3809,7 +3807,7 @@ nsDocument::AddOnDemandBuiltInUASheet(StyleSheet* aSheet)
// do not override Firefox OS/Mobile's content.css sheet. Maybe we should
// have an insertion point to match the order of
// nsDocumentViewer::CreateStyleSet though?
shell->StyleSet()->PrependStyleSheet(SheetType::Agent, aSheet);
shell->StyleSet()->PrependStyleSheet(SheetType::Agent, aSheet->AsGecko());
}
}
@ -3821,7 +3819,7 @@ nsDocument::AddStyleSheetToStyleSets(StyleSheet* aSheet)
{
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->AddDocStyleSheet(aSheet, this);
shell->StyleSet()->AddDocStyleSheet(aSheet->AsGecko(), this);
}
}
@ -3888,7 +3886,7 @@ nsDocument::RemoveStyleSheetFromStyleSets(StyleSheet* aSheet)
{
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->RemoveDocStyleSheet(aSheet);
shell->StyleSet()->RemoveDocStyleSheet(aSheet->AsGecko());
}
}
@ -4104,7 +4102,7 @@ nsDocument::AddAdditionalStyleSheet(additionalSheetType aType, StyleSheet* aShee
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
SheetType type = ConvertAdditionalSheetType(aType);
shell->StyleSet()->AppendStyleSheet(type, aSheet);
shell->StyleSet()->AppendStyleSheet(type, aSheet->AsGecko());
}
// Passing false, so documet.styleSheets.length will not be affected by
@ -4132,7 +4130,7 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
SheetType type = ConvertAdditionalSheetType(aType);
shell->StyleSet()->RemoveStyleSheet(type, sheetRef);
shell->StyleSet()->RemoveStyleSheet(type, sheetRef->AsGecko());
}
}
@ -12157,7 +12155,7 @@ nsIDocument::FlushUserFontSet()
nsTArray<nsFontFaceRuleContainer> rules;
nsIPresShell* shell = GetShell();
if (shell) {
if (!shell->StyleSet()->AsGecko()->AppendFontFaceRules(rules)) {
if (!shell->StyleSet()->AppendFontFaceRules(rules)) {
return;
}
}

View file

@ -43,7 +43,7 @@
#include "nsGkAtoms.h"
#include "nsIApplicationCache.h"
#include "nsIApplicationCacheContainer.h"
#include "mozilla/StyleSetHandle.h"
#include "nsStyleSet.h"
#include "PLDHashTable.h"
#include "nsAttrAndChildArray.h"
#include "nsDOMAttributeMap.h"
@ -426,7 +426,7 @@ public:
virtual already_AddRefed<nsIPresShell> CreateShell(
nsPresContext* aContext,
nsViewManager* aViewManager,
mozilla::StyleSetHandle aStyleSet) override;
nsStyleSet* aStyleSet) override;
virtual void DeleteShell() override;
virtual nsresult GetAllowPlugins(bool* aAllowPlugins) override;
@ -1113,14 +1113,14 @@ public:
protected:
already_AddRefed<nsIPresShell> doCreateShell(nsPresContext* aContext,
nsViewManager* aViewManager,
mozilla::StyleSetHandle aStyleSet);
nsStyleSet* aStyleSet);
void RemoveDocStyleSheetsFromStyleSets();
void RemoveStyleSheetsFromStyleSets(
const nsTArray<RefPtr<mozilla::StyleSheet>>& aSheets,
mozilla::SheetType aType);
void ResetStylesheetsToURI(nsIURI* aURI);
void FillStyleSet(mozilla::StyleSetHandle aStyleSet);
void FillStyleSet(nsStyleSet* aStyleSet);
// Return whether all the presshells for this document are safe to flush
bool IsSafeToFlush() const;

View file

@ -96,6 +96,7 @@ class nsWindowSizes;
class nsDOMCaretPosition;
class nsViewportInfo;
class nsIGlobalObject;
class nsStyleSet;
struct nsCSSSelectorList;
namespace mozilla {
@ -103,7 +104,6 @@ class CSSStyleSheet;
class ErrorResult;
class EventStates;
class PendingAnimationTracker;
class StyleSetHandle;
class SVGAttrAnimationRuleProcessor;
template<typename> class OwningNonNull;
@ -781,7 +781,7 @@ public:
virtual already_AddRefed<nsIPresShell> CreateShell(
nsPresContext* aContext,
nsViewManager* aViewManager,
mozilla::StyleSetHandle aStyleSet) = 0;
nsStyleSet* aStyleSet) = 0;
virtual void DeleteShell() = 0;
nsIPresShell* GetShell() const

View file

@ -121,8 +121,7 @@
#include "nsFontMetrics.h"
#include "Units.h"
#include "CanvasUtils.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "mozilla/layers/CanvasClient.h"
#undef free // apparently defined by some windows header, clashing with a free()
@ -2670,7 +2669,7 @@ GetFontParentStyleContext(Element* aElement, nsIPresShell* aPresShell,
// otherwise inherit from default (10px sans-serif)
nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
nsStyleSet* styleSet = aPresShell->StyleSet();
if (!styleSet) {
aError.Throw(NS_ERROR_FAILURE);
return nullptr;
@ -2711,7 +2710,7 @@ GetFontStyleContext(Element* aElement, const nsAString& aFont,
nsAString& aOutUsedFont,
ErrorResult& aError)
{
nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
nsStyleSet* styleSet = aPresShell->StyleSet();
if (!styleSet) {
aError.Throw(NS_ERROR_FAILURE);
return nullptr;
@ -2785,7 +2784,7 @@ ResolveStyleForFilter(const nsAString& aFilterString,
nsStyleContext* aParentContext,
ErrorResult& aError)
{
nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
nsStyleSet* styleSet = aPresShell->StyleSet();
if (!styleSet) {
aError.Throw(NS_ERROR_FAILURE);
return nullptr;

View file

@ -103,8 +103,7 @@
#include "mozilla/dom/HTMLBodyElement.h"
#include "imgIContainer.h"
#include "nsComputedDOMStyle.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "ReferrerPolicy.h"
#include "mozilla/dom/HTMLLabelElement.h"
@ -3019,7 +3018,7 @@ IsOrHasAncestorWithDisplayNone(Element* aElement, nsIPresShell* aPresShell)
return false;
}
StyleSetHandle styleSet = aPresShell->StyleSet();
nsStyleSet* styleSet = aPresShell->StyleSet();
RefPtr<nsStyleContext> sc;
for (int32_t i = elementsToCheck.Length() - 1; i >= 0; --i) {
if (sc) {

View file

@ -273,7 +273,7 @@ nsHTMLDocument::ResetToURI(nsIURI *aURI, nsILoadGroup *aLoadGroup,
already_AddRefed<nsIPresShell>
nsHTMLDocument::CreateShell(nsPresContext* aContext,
nsViewManager* aViewManager,
StyleSetHandle aStyleSet)
nsStyleSet* aStyleSet)
{
return doCreateShell(aContext, aViewManager, aStyleSet);
}

View file

@ -55,7 +55,7 @@ public:
virtual already_AddRefed<nsIPresShell> CreateShell(
nsPresContext* aContext,
nsViewManager* aViewManager,
mozilla::StyleSetHandle aStyleSet) override;
nsStyleSet* aStyleSet) override;
virtual nsresult StartDocumentLoad(const char* aCommand,
nsIChannel* aChannel,

View file

@ -6,8 +6,6 @@
#include "ActiveElementManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/EventStates.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/Preferences.h"
#include "base/message_loop.h"
#include "base/task.h"
@ -166,7 +164,7 @@ ElementHasActiveStyle(dom::Element* aElement)
if (!pc) {
return false;
}
StyleSetHandle styleSet = pc->StyleSet();
nsStyleSet* styleSet = pc->StyleSet();
for (dom::Element* e = aElement; e; e = e->GetParentElement()) {
if (styleSet->HasStateDependentStyle(e, NS_EVENT_STATE_ACTIVE)) {
AEM_LOG("Element %p's style is dependent on the active state\n", e);

View file

@ -3869,7 +3869,7 @@ RestyleManager::ComputeAndProcessStyleChange(nsStyleContext* aNewContext,
nsStyleSet*
ElementRestyler::StyleSet() const
{
return mPresContext->StyleSet()->AsGecko();
return mPresContext->StyleSet();
}
AutoDisplayContentsAncestorPusher::AutoDisplayContentsAncestorPusher(

View file

@ -458,7 +458,7 @@ public:
private:
inline nsStyleSet* StyleSet() const {
return PresContext()->StyleSet()->AsGecko();
return PresContext()->StyleSet();
}
/* aMinHint is the minimal change that should be made to the element */

View file

@ -5,8 +5,7 @@
#include "mozilla/RestyleManagerBase.h"
#include "mozilla/RestyleManager.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h" // for Ptr::HasStateDependentStyle
#include "nsStyleSet.h" // for HasStateDependentStyle
#include "ActiveLayerTracker.h"
#include "nsCSSFrameConstructor.h"
#include "nsCSSRendering.h"
@ -52,7 +51,7 @@ RestyleManagerBase::ContentStateChangedInternal(Element* aElement,
MOZ_ASSERT(aOutChangeHint);
MOZ_ASSERT(aOutRestyleHint);
StyleSetHandle styleSet = PresContext()->StyleSet();
nsStyleSet* styleSet = PresContext()->StyleSet();
NS_ASSERTION(styleSet, "couldn't get style set");
*aOutChangeHint = nsChangeHint(0);

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);

View file

@ -19,8 +19,7 @@
#include "nsIDocument.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsIFrame.h"
#include "nsIWritablePropertyBag2.h"
#include "nsSubDocumentFrame.h"
@ -679,12 +678,12 @@ nsDocumentViewer::InitPresentationStuff(bool aDoInitialReflow)
"Someone should have destroyed the presshell!");
// Create the style set...
StyleSetHandle styleSet = CreateStyleSet(mDocument);
nsStyleSet* styleSet = CreateStyleSet(mDocument);
// Now make the shell for the document
mPresShell = mDocument->CreateShell(mPresContext, mViewManager, styleSet);
if (!mPresShell) {
styleSet->Delete();
delete styleSet;
return NS_ERROR_FAILURE;
}
@ -2268,7 +2267,7 @@ nsDocumentViewer::RequestWindowClose(bool* aCanClose)
return NS_OK;
}
StyleSetHandle
nsStyleSet*
nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
{
// Make sure this does the same thing as PresShell::AddSheet wrt ordering.
@ -2276,7 +2275,7 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
// this should eventually get expanded to allow for creating
// different sets for different media
StyleSetHandle styleSet = new nsStyleSet();
nsStyleSet* styleSet = new nsStyleSet();
styleSet->BeginUpdate();
@ -2307,7 +2306,7 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
}
if (sheet)
styleSet->AppendStyleSheet(SheetType::User, sheet);
styleSet->AppendStyleSheet(SheetType::User, sheet->AsGecko());
// Append chrome sheets (scrollbars + forms).
bool shouldOverride = false;
@ -2343,7 +2342,7 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
cssLoader->LoadSheetSync(uri, &chromeSheet);
if (!chromeSheet) continue;
styleSet->PrependStyleSheet(SheetType::Agent, chromeSheet);
styleSet->PrependStyleSheet(SheetType::Agent, chromeSheet->AsGecko());
shouldOverride = true;
}
free(str);
@ -2354,7 +2353,7 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
if (!shouldOverride) {
sheet = cache->ScrollbarsSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
@ -2370,12 +2369,12 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
sheet = cache->NumberControlSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
sheet = cache->FormsSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
if (aDocument->LoadsFullXULStyleSheetUpFront()) {
@ -2383,7 +2382,7 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
// up-front here.
sheet = cache->XULSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
@ -2391,25 +2390,25 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
if (sheet) {
// Load the minimal XUL rules for scrollbars and a few other XUL things
// that non-XUL (typically HTML) documents commonly use.
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
sheet = cache->CounterStylesSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
if (nsLayoutUtils::ShouldUseNoScriptSheet(aDocument)) {
sheet = cache->NoScriptSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
if (nsLayoutUtils::ShouldUseNoFramesSheet(aDocument)) {
sheet = cache->NoFramesSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
@ -2418,26 +2417,26 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
sheet = cache->HTMLSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
styleSet->PrependStyleSheet(SheetType::Agent,
cache->UASheet());
cache->UASheet()->AsGecko());
} else {
// SVG documents may have scrollbars and need the scrollbar styling.
sheet = cache->MinimalXULSheet();
if (sheet) {
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
styleSet->PrependStyleSheet(SheetType::Agent, sheet->AsGecko());
}
}
nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
for (StyleSheet* sheet : *sheetService->AgentStyleSheets()) {
styleSet->AppendStyleSheet(SheetType::Agent, sheet);
styleSet->AppendStyleSheet(SheetType::Agent, sheet->AsGecko());
}
for (StyleSheet* sheet : Reversed(*sheetService->UserStyleSheets())) {
styleSet->PrependStyleSheet(SheetType::User, sheet);
styleSet->PrependStyleSheet(SheetType::User, sheet->AsGecko());
}
}

View file

@ -24,6 +24,7 @@
class nsIFrame;
class nsIPresShell;
class nsStyleSet;
class nsFrameManagerBase
{

View file

@ -8,10 +8,8 @@
#include "nsISupports.h"
class nsIDocument;
namespace mozilla {
class StyleSetHandle;
} // namespace mozilla
class nsIPresShell;
class nsStyleSet;
class nsPresContext;
class nsViewManager;
@ -38,7 +36,7 @@ public:
// The style set returned by CreateStyleSet is in the middle of an
// update batch so that the caller can add sheets to it if needed.
// Callers should call EndUpdate() on it when ready to use.
virtual mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) = 0;
virtual nsStyleSet* CreateStyleSet(nsIDocument* aDocument) = 0;
virtual void IncrementDestroyRefCount() = 0;
virtual void DecrementDestroyRefCount() = 0;
@ -74,7 +72,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentViewerPrint,
bool GetIsPrinting() override; \
void SetIsPrintPreview(bool aIsPrintPreview) override; \
bool GetIsPrintPreview() override; \
mozilla::StyleSetHandle CreateStyleSet(nsIDocument* aDocument) override; \
nsStyleSet* CreateStyleSet(nsIDocument* aDocument) override; \
void IncrementDestroyRefCount() override; \
void DecrementDestroyRefCount() override; \
void ReturnToGalleyPresentation() override; \

View file

@ -24,7 +24,6 @@
#include "mozilla/EventForwards.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/WeakPtr.h"
#include "gfxPoint.h"
@ -62,6 +61,7 @@ class nsIPageSequenceFrame;
class nsCanvasFrame;
class nsAString;
class nsCaret;
class nsStyleSet;
namespace mozilla {
class AccessibleCaretEventHub;
class CSSStyleSheet;
@ -323,7 +323,7 @@ public:
#endif
#ifdef MOZILLA_INTERNAL_API
mozilla::StyleSetHandle StyleSet() const { return mStyleSet; }
nsStyleSet* StyleSet() const { return mStyleSet; }
nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }
@ -1722,7 +1722,7 @@ protected:
// we must share ownership.
nsCOMPtr<nsIDocument> mDocument;
RefPtr<nsPresContext> mPresContext;
mozilla::StyleSetHandle mStyleSet; // [OWNS]
nsStyleSet* mStyleSet; // [OWNS]
nsCSSFrameConstructor* mFrameConstructor; // [OWNS]
nsViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
nsPresArena mFrameArena;

View file

@ -114,8 +114,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/RuleNodeCacheConditions.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "RegionBuilder.h"
#include "SVGSVGElement.h"
#include "nsDocument.h"

View file

@ -18,8 +18,7 @@
#include "nsDocShell.h"
#include "nsIContentViewer.h"
#include "nsPIDOMWindow.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDocument.h"
@ -1142,18 +1141,18 @@ nsPresContext::CompatibilityModeChanged()
return;
}
StyleSetHandle styleSet = mShell->StyleSet();
nsStyleSet* styleSet = mShell->StyleSet();
auto cache = nsLayoutStylesheetCache::Get();
StyleSheet* sheet = cache->QuirkSheet();
if (needsQuirkSheet) {
// quirk.css needs to come after html.css; we just keep it at the end.
DebugOnly<nsresult> rv =
styleSet->AppendStyleSheet(SheetType::Agent, sheet);
styleSet->AppendStyleSheet(SheetType::Agent, sheet->AsGecko());
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "failed to insert quirk.css");
} else {
DebugOnly<nsresult> rv =
styleSet->RemoveStyleSheet(SheetType::Agent, sheet);
styleSet->RemoveStyleSheet(SheetType::Agent, sheet->AsGecko());
NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "failed to remove quirk.css");
}
@ -1375,7 +1374,7 @@ GetPropagatedScrollStylesForViewport(nsPresContext* aPresContext,
}
// Check the style on the document root element
StyleSetHandle styleSet = aPresContext->StyleSet();
nsStyleSet* styleSet = aPresContext->StyleSet();
RefPtr<nsStyleContext> rootStyle;
rootStyle = styleSet->ResolveStyleFor(docElement, nullptr);
if (CheckOverflow(rootStyle->StyleDisplay(), aStyles)) {
@ -1882,7 +1881,7 @@ nsPresContext::MediaFeatureValuesChanged(nsRestyleHint aRestyleHint,
// MediumFeaturesChanged updates the applied rules, so it always gets called.
if (mShell) {
if (mShell->StyleSet()->AsGecko()->MediumFeaturesChanged()) {
if (mShell->StyleSet()->MediumFeaturesChanged()) {
aRestyleHint |= eRestyle_Subtree;
}
}
@ -2135,7 +2134,7 @@ nsPresContext::NotifyMissingFonts()
void
nsPresContext::EnsureSafeToHandOutCSSRules()
{
nsStyleSet* styleSet = mShell->StyleSet()->GetAsGecko();
nsStyleSet* styleSet = mShell->StyleSet();
if (!styleSet) {
return;
}
@ -2475,7 +2474,7 @@ nsPresContext::HasCachedStyleData()
return false;
}
nsStyleSet* styleSet = mShell->StyleSet()->GetAsGecko();
nsStyleSet* styleSet = mShell->StyleSet();
if (!styleSet) {
return mShell->DidInitialize();
}

View file

@ -229,7 +229,7 @@ public:
}
#ifdef MOZILLA_INTERNAL_API
mozilla::StyleSetHandle StyleSet() { return GetPresShell()->StyleSet(); }
nsStyleSet* StyleSet() { return GetPresShell()->StyleSet(); }
nsFrameManager* FrameManager()
{ return PresShell()->FrameManager(); }

View file

@ -190,8 +190,6 @@
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include "nsStyleSet.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/dom/ImageTracker.h"
@ -848,7 +846,7 @@ PresShell::~PresShell()
MOZ_ASSERT(mAllocatedPointers.IsEmpty(), "Some pres arena objects were not freed");
mStyleSet->Delete();
delete mStyleSet;
delete mFrameConstructor;
mCurrentEventContent = nullptr;
@ -864,7 +862,7 @@ void
PresShell::Init(nsIDocument* aDocument,
nsPresContext* aPresContext,
nsViewManager* aViewManager,
StyleSetHandle aStyleSet)
nsStyleSet* aStyleSet)
{
NS_PRECONDITION(aDocument, "null ptr");
NS_PRECONDITION(aPresContext, "null ptr");
@ -1400,7 +1398,7 @@ PresShell::UpdatePreferenceStyles()
RemovePreferenceStyles();
mStyleSet->AppendStyleSheet(SheetType::User, newPrefSheet);
mStyleSet->AppendStyleSheet(SheetType::User, newPrefSheet->AsGecko());
mPrefStyleSheet = newPrefSheet;
mStyleSet->EndUpdate();
@ -1410,7 +1408,7 @@ void
PresShell::RemovePreferenceStyles()
{
if (mPrefStyleSheet) {
mStyleSet->RemoveStyleSheet(SheetType::User, mPrefStyleSheet);
mStyleSet->RemoveStyleSheet(SheetType::User, mPrefStyleSheet->AsGecko());
mPrefStyleSheet = nullptr;
}
}
@ -1433,13 +1431,13 @@ PresShell::AddUserSheet(nsISupports* aSheet)
// Iterate forwards when removing so the searches for RemoveStyleSheet are as
// short as possible.
for (StyleSheet* sheet : userSheets) {
mStyleSet->RemoveStyleSheet(SheetType::User, sheet);
mStyleSet->RemoveStyleSheet(SheetType::User, sheet->AsGecko());
}
// Now iterate backwards, so that the order of userSheets will be the same as
// the order of sheets from it in the style set.
for (StyleSheet* sheet : Reversed(userSheets)) {
mStyleSet->PrependStyleSheet(SheetType::User, sheet);
mStyleSet->PrependStyleSheet(SheetType::User, sheet->AsGecko());
}
mStyleSet->EndUpdate();
@ -1457,7 +1455,7 @@ PresShell::AddAgentSheet(nsISupports* aSheet)
return;
}
mStyleSet->AppendStyleSheet(SheetType::Agent, sheet);
mStyleSet->AppendStyleSheet(SheetType::Agent, sheet->AsGecko());
RestyleForCSSRuleChanges();
}
@ -1474,9 +1472,9 @@ PresShell::AddAuthorSheet(nsISupports* aSheet)
StyleSheet* firstAuthorSheet =
mDocument->GetFirstAdditionalAuthorSheet();
if (firstAuthorSheet) {
mStyleSet->InsertStyleSheetBefore(SheetType::Doc, sheet, firstAuthorSheet);
mStyleSet->InsertStyleSheetBefore(SheetType::Doc, sheet->AsGecko(), firstAuthorSheet->AsGecko());
} else {
mStyleSet->AppendStyleSheet(SheetType::Doc, sheet);
mStyleSet->AppendStyleSheet(SheetType::Doc, sheet->AsGecko());
}
RestyleForCSSRuleChanges();
@ -1490,7 +1488,7 @@ PresShell::RemoveSheet(SheetType aType, nsISupports* aSheet)
return;
}
mStyleSet->RemoveStyleSheet(aType, sheet);
mStyleSet->RemoveStyleSheet(aType, sheet->AsGecko());
RestyleForCSSRuleChanges();
}
@ -4168,7 +4166,7 @@ PresShell::DocumentStatesChanged(nsIDocument* aDocument,
NS_PRECONDITION(!mIsDocumentGone, "Unexpected DocumentStatesChanged");
NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
nsStyleSet* styleSet = mStyleSet->GetAsGecko();
nsStyleSet* styleSet = mStyleSet;
if (!styleSet) {
return;
}
@ -8772,19 +8770,23 @@ PresShell::GetAgentStyleSheets(nsTArray<RefPtr<StyleSheet>>& aSheets)
nsresult
PresShell::SetAgentStyleSheets(const nsTArray<RefPtr<StyleSheet>>& aSheets)
{
return mStyleSet->ReplaceSheets(SheetType::Agent, aSheets);
nsTArray<RefPtr<CSSStyleSheet>> newSheets(aSheets.Length());
for (auto& sheet : aSheets) {
newSheets.AppendElement(sheet->AsGecko());
}
return mStyleSet->ReplaceSheets(SheetType::Agent, newSheets);
}
nsresult
PresShell::AddOverrideStyleSheet(StyleSheet* aSheet)
{
return mStyleSet->PrependStyleSheet(SheetType::Override, aSheet);
return mStyleSet->PrependStyleSheet(SheetType::Override, aSheet->AsGecko());
}
nsresult
PresShell::RemoveOverrideStyleSheet(StyleSheet* aSheet)
{
return mStyleSet->RemoveStyleSheet(SheetType::Override, aSheet);
return mStyleSet->RemoveStyleSheet(SheetType::Override, aSheet->AsGecko());
}
static void
@ -9957,7 +9959,7 @@ PresShell::VerifyIncrementalReflow()
// Create a new presentation shell to view the document. Use the
// exact same style information that this document has.
nsAutoPtr<nsStyleSet> newSet(CloneStyleSet(mStyleSet->AsGecko()));
nsAutoPtr<nsStyleSet> newSet(CloneStyleSet(mStyleSet));
nsCOMPtr<nsIPresShell> sh = mDocument->CreateShell(cx, vm, newSet.get());
NS_ENSURE_TRUE(sh, false);
newSet.forget();
@ -10802,7 +10804,7 @@ PresShell::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
*aPresShellSize += mFramesToDirty.ShallowSizeOfExcludingThis(aMallocSizeOf);
*aPresShellSize += aArenaObjectsSize->mOther;
if (nsStyleSet* styleSet = StyleSet()->GetAsGecko()) {
if (nsStyleSet* styleSet = StyleSet()) {
*aStyleSetsSize += styleSet->SizeOfIncludingThis(aMallocSizeOf);
}
@ -11010,7 +11012,7 @@ nsIPresShell::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
}
*aRetVal = false;
if (nsStyleSet* styleSet = mStyleSet->GetAsGecko()) {
if (nsStyleSet* styleSet = mStyleSet) {
*aRetVal = styleSet->HasRuleProcessorUsedByMultipleStyleSets(type);
}
return NS_OK;

View file

@ -34,13 +34,13 @@
#include "mozilla/Attributes.h"
#include "mozilla/EventForwards.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/UniquePtr.h"
#include "MobileViewportManager.h"
#include "ZoomConstraintsClient.h"
class nsIDocShell;
class nsRange;
class nsStyleSet;
struct RangePaintInfo;
struct nsCallbackEventRequest;
@ -100,7 +100,7 @@ public:
static bool IsTargetIframe(nsINode* aTarget);
void Init(nsIDocument* aDocument, nsPresContext* aPresContext,
nsViewManager* aViewManager, mozilla::StyleSetHandle aStyleSet);
nsViewManager* aViewManager, nsStyleSet* aStyleSet);
virtual void Destroy() override;
virtual void MakeZombie() override;

View file

@ -8,8 +8,7 @@
#include "nsGkAtoms.h"
#include "nsCSSPseudoElements.h"
#include "nsNameSpaceManager.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsDisplayList.h"
#include "nsITheme.h"
#include "nsFrame.h"
@ -376,7 +375,7 @@ nsButtonFrameRenderer::ReResolveStyles(nsPresContext* aPresContext)
{
// get all the styles
nsStyleContext* context = mFrame->StyleContext();
StyleSetHandle styleSet = aPresContext->StyleSet();
nsStyleSet* styleSet = aPresContext->StyleSet();
#ifdef DEBUG
if (mInnerFocusStyle) {

View file

@ -14,8 +14,7 @@
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMNode.h"
#include "nsIFormControl.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsIDocument.h"
using mozilla::dom::Element;

View file

@ -30,8 +30,7 @@
#include "nsIDocument.h"
#include "nsIScrollableFrame.h"
#include "nsListControlFrame.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"
#include "nsLayoutUtils.h"
@ -1358,7 +1357,7 @@ nsComboboxControlFrame::CreateFrameForDisplayNode()
// Get PresShell
nsIPresShell *shell = PresContext()->PresShell();
StyleSetHandle styleSet = shell->StyleSet();
nsStyleSet* styleSet = shell->StyleSet();
// create the style contexts for the anonymous block frame and text frame
RefPtr<nsStyleContext> styleContext;

View file

@ -6,8 +6,7 @@
#include "nsGfxButtonControlFrame.h"
#include "nsIFormControl.h"
#include "nsGkAtoms.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsContentUtils.h"
// MouseEvent suppression in PP
#include "nsContentList.h"

View file

@ -21,8 +21,6 @@
#include "nsContentList.h"
#include "nsCSSPseudoElements.h"
#include "nsStyleSet.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsThemeConstants.h"
#include <algorithm>

View file

@ -22,8 +22,6 @@
#include "nsContentList.h"
#include "nsCSSPseudoElements.h"
#include "nsStyleSet.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsIDOMMutationEvent.h"
#include "nsThreadUtils.h"
#include "mozilla/FloatingPoint.h"

View file

@ -21,8 +21,6 @@
#include "nsContentList.h"
#include "nsCSSPseudoElements.h"
#include "nsStyleSet.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsThemeConstants.h"
#include <algorithm>

View file

@ -24,8 +24,7 @@
#include "nsNodeInfoManager.h"
#include "nsRenderingContext.h"
#include "mozilla/dom/Element.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsThemeConstants.h"
#ifdef ACCESSIBILITY
@ -84,7 +83,7 @@ nsRangeFrame::Init(nsIContent* aContent,
}
aContent->AddEventListener(NS_LITERAL_STRING("touchstart"), mDummyTouchListener, false);
StyleSetHandle styleSet = PresContext()->StyleSet();
nsStyleSet* styleSet = PresContext()->StyleSet();
mOuterFocusStyle =
styleSet->ProbePseudoElementStyle(aContent->AsElement(),

View file

@ -44,8 +44,7 @@
#include "mozilla/TextEditRules.h"
#include "nsContentUtils.h"
#include "nsTextNode.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/HTMLTextAreaElement.h"
#include "mozilla/dom/ScriptSettings.h"

View file

@ -53,8 +53,7 @@
#include "nsISelection.h"
#include "mozilla/dom/HTMLDetailsElement.h"
#include "mozilla/dom/HTMLSummaryElement.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsBidiPresUtils.h"

View file

@ -11,8 +11,7 @@
#include "nsIContent.h"
#include "nsLineLayout.h"
#include "nsGkAtoms.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsFrameManager.h"
#include "mozilla/RestyleManagerHandle.h"
#include "mozilla/RestyleManagerHandleInlines.h"

View file

@ -29,8 +29,7 @@
#include "nsIDOMMutationEvent.h"
#include "nsNameSpaceManager.h"
#include "nsCSSAnonBoxes.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "mozilla/dom/Element.h"
#include "nsDisplayList.h"
#include "nsNodeUtils.h"
@ -802,7 +801,7 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
DO_GLOBAL_REFLOW_COUNT("nsHTMLFramesetFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus);
nsIPresShell *shell = aPresContext->PresShell();
StyleSetHandle styleSet = shell->StyleSet();
nsStyleSet* styleSet = shell->StyleSet();
GetParent()->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);

View file

@ -71,8 +71,7 @@
#include "gfxRect.h"
#include "ImageLayers.h"
#include "ImageContainer.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsBlockFrame.h"
#include "nsStyleStructInlines.h"

View file

@ -19,8 +19,7 @@
#include "nsDisplayList.h"
#include "mozilla/Likely.h"
#include "SVGTextFrame.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#ifdef DEBUG
#undef NOISY_PUSHING

View file

@ -63,8 +63,7 @@
#include "nsIWordBreaker.h"
#include "nsGenericDOMDataNode.h"
#include "nsIFrameInlines.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include <algorithm>
#include <limits>

View file

@ -48,8 +48,7 @@
#include "nsCSSProps.h"
#include "nsCSSValue.h"
#include "nsColor.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsStyleUtil.h"
#include "nsQueryObject.h"
@ -87,7 +86,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength,
nsIPresShell* presShell = document->GetShell();
if (presShell) {
StyleSetHandle styleSet = presShell->StyleSet();
nsStyleSet* styleSet = presShell->StyleSet();
SheetType sheetType = SheetType::Agent;
for (int32_t i = 0; i < styleSet->SheetCount(sheetType); i++) {
sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i));
@ -97,7 +96,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength,
sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i));
}
AutoTArray<CSSStyleSheet*, 32> xblSheetArray;
styleSet->AsGecko()->AppendAllXBLStyleSheets(xblSheetArray);
styleSet->AppendAllXBLStyleSheets(xblSheetArray);
// The XBL stylesheet array will quite often be full of duplicates. Cope:
nsTHashtable<nsPtrHashKey<CSSStyleSheet>> sheetSet;

View file

@ -15,8 +15,7 @@
#include "gfxMathTable.h"
// used to map attributes into CSS rules
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsDisplayList.h"
#include "nsRenderingContext.h"

View file

@ -125,8 +125,7 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsIChannel.h"
#include "xpcpublic.h"
#include "nsVariant.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2239,12 +2238,12 @@ nsPrintEngine::ReflowPrintObject(nsPrintObject * aPO)
rv = aPO->mViewManager->Init(printData->mPrintDC);
NS_ENSURE_SUCCESS(rv,rv);
StyleSetHandle styleSet = mDocViewerPrint->CreateStyleSet(aPO->mDocument);
nsStyleSet* styleSet = mDocViewerPrint->CreateStyleSet(aPO->mDocument);
aPO->mPresShell = aPO->mDocument->CreateShell(aPO->mPresContext,
aPO->mViewManager, styleSet);
if (!aPO->mPresShell) {
styleSet->Delete();
delete styleSet;
return NS_ERROR_FAILURE;
}

View file

@ -17,8 +17,7 @@
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "nsUnicodeProperties.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
namespace mozilla {
@ -2028,9 +2027,9 @@ CounterStyleManager::BuildCounterStyle(const nsSubstring& aName)
// It is intentional that the predefined names are case-insensitive
// but the user-defined names case-sensitive.
StyleSetHandle styleSet = mPresContext->StyleSet();
nsStyleSet* styleSet = mPresContext->StyleSet();
nsCSSCounterStyleRule* rule =
styleSet->AsGecko()->CounterStyleRuleForName(aName);
styleSet->CounterStyleRuleForName(aName);
if (rule) {
data = new (mPresContext) CustomCounterStyle(aName, this, rule);
} else {
@ -2070,9 +2069,9 @@ CounterStyleManager::NotifyRuleChanged()
RefPtr<CounterStyle>& style = iter.Data();
bool toBeUpdated = false;
bool toBeRemoved = false;
StyleSetHandle styleSet = mPresContext->StyleSet();
nsStyleSet* styleSet = mPresContext->StyleSet();
nsCSSCounterStyleRule* newRule =
styleSet->AsGecko()->CounterStyleRuleForName(iter.Key());
styleSet->CounterStyleRuleForName(iter.Key());
if (!newRule) {
if (style->IsCustomStyle()) {
toBeRemoved = true;

View file

@ -3261,7 +3261,7 @@ ComputeValuesFromStyleRule(nsCSSPropertyID aProperty,
return false;
}
nsStyleSet* styleSet = aStyleContext->PresContext()->StyleSet()->AsGecko();
nsStyleSet* styleSet = aStyleContext->PresContext()->StyleSet();
RefPtr<nsStyleContext> tmpStyleContext;
if (aIsContextSensitive) {

View file

@ -1,162 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_StyleSetHandle_h
#define mozilla_StyleSetHandle_h
#include "mozilla/EventStates.h"
#include "mozilla/RefPtr.h"
#include "mozilla/SheetType.h"
#include "mozilla/StyleSheet.h"
#include "nsChangeHint.h"
#include "nsCSSPseudoElements.h"
#include "nsTArray.h"
namespace mozilla {
class CSSStyleSheet;
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla
class nsIAtom;
class nsIContent;
class nsIDocument;
class nsStyleContext;
class nsStyleSet;
class nsPresContext;
struct TreeMatchContext;
namespace mozilla {
/**
* Smart pointer class that can hold a pointer to an nsStyleSet.
*/
class StyleSetHandle
{
public:
// We define this Ptr class with a StyleSet API that forwards on to the
// wrapped pointer, rather than putting these methods on StyleSetHandle
// itself, so that we can have StyleSetHandle behave like a smart pointer and
// be dereferenced with operator->.
class Ptr
{
public:
friend class ::mozilla::StyleSetHandle;
nsStyleSet* AsGecko()
{
return reinterpret_cast<nsStyleSet*>(mValue);
}
nsStyleSet* GetAsGecko() { return AsGecko(); }
const nsStyleSet* AsGecko() const
{
return const_cast<Ptr*>(this)->AsGecko();
}
const nsStyleSet* GetAsGecko() const { return AsGecko(); }
// These inline methods are defined in StyleSetHandleInlines.h.
inline void Delete();
// Style set interface. These inline methods are defined in
// StyleSetHandleInlines.h and just forward to the underlying
// nsStyleSet. See corresponding comments in nsStyleSet.h for
// descriptions of these methods.
inline void Init(nsPresContext* aPresContext);
inline void BeginShutdown();
inline void Shutdown();
inline bool GetAuthorStyleDisabled() const;
inline nsresult SetAuthorStyleDisabled(bool aStyleDisabled);
inline void BeginUpdate();
inline nsresult EndUpdate();
inline already_AddRefed<nsStyleContext>
ResolveStyleFor(dom::Element* aElement,
nsStyleContext* aParentContext);
inline already_AddRefed<nsStyleContext>
ResolveStyleFor(dom::Element* aElement,
nsStyleContext* aParentContext,
TreeMatchContext& aTreeMatchContext);
inline already_AddRefed<nsStyleContext>
ResolveStyleForText(nsIContent* aTextNode,
nsStyleContext* aParentContext);
inline already_AddRefed<nsStyleContext>
ResolveStyleForOtherNonElement(nsStyleContext* aParentContext);
inline already_AddRefed<nsStyleContext>
ResolvePseudoElementStyle(dom::Element* aParentElement,
mozilla::CSSPseudoElementType aType,
nsStyleContext* aParentContext,
dom::Element* aPseudoElement);
inline already_AddRefed<nsStyleContext>
ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag, nsStyleContext* aParentContext,
uint32_t aFlags = 0);
inline nsresult AppendStyleSheet(SheetType aType, StyleSheet* aSheet);
inline nsresult PrependStyleSheet(SheetType aType, StyleSheet* aSheet);
inline nsresult RemoveStyleSheet(SheetType aType, StyleSheet* aSheet);
inline nsresult ReplaceSheets(SheetType aType,
const nsTArray<RefPtr<StyleSheet>>& aNewSheets);
inline nsresult InsertStyleSheetBefore(SheetType aType,
StyleSheet* aNewSheet,
StyleSheet* aReferenceSheet);
inline int32_t SheetCount(SheetType aType) const;
inline StyleSheet* StyleSheetAt(SheetType aType, int32_t aIndex) const;
inline nsresult RemoveDocStyleSheet(StyleSheet* aSheet);
inline nsresult AddDocStyleSheet(StyleSheet* aSheet, nsIDocument* aDocument);
inline already_AddRefed<nsStyleContext>
ProbePseudoElementStyle(dom::Element* aParentElement,
mozilla::CSSPseudoElementType aType,
nsStyleContext* aParentContext);
inline already_AddRefed<nsStyleContext>
ProbePseudoElementStyle(dom::Element* aParentElement,
mozilla::CSSPseudoElementType aType,
nsStyleContext* aParentContext,
TreeMatchContext& aTreeMatchContext,
dom::Element* aPseudoElement = nullptr);
inline nsRestyleHint HasStateDependentStyle(dom::Element* aElement,
EventStates aStateMask);
inline nsRestyleHint HasStateDependentStyle(
dom::Element* aElement,
mozilla::CSSPseudoElementType aPseudoType,
dom::Element* aPseudoElement,
EventStates aStateMask);
inline void RootStyleContextAdded();
inline void RootStyleContextRemoved();
private:
// Stores a pointer to an nsStyleSet. The least
// significant bit is 0 for the former, 1 for the latter. This is
// valid as the least significant bit will never be used for a pointer
// value on platforms we care about.
uintptr_t mValue;
};
StyleSetHandle() { mPtr.mValue = 0; }
StyleSetHandle(const StyleSetHandle& aOth) { mPtr.mValue = aOth.mPtr.mValue; }
MOZ_IMPLICIT StyleSetHandle(nsStyleSet* aSet) { *this = aSet; }
StyleSetHandle& operator=(nsStyleSet* aStyleSet)
{
mPtr.mValue = reinterpret_cast<uintptr_t>(aStyleSet);
return *this;
}
// Make StyleSetHandle usable in boolean contexts.
explicit operator bool() const { return !!mPtr.mValue; }
bool operator!() const { return !mPtr.mValue; }
// Make StyleSetHandle behave like a smart pointer.
Ptr* operator->() { return &mPtr; }
const Ptr* operator->() const { return &mPtr; }
private:
Ptr mPtr;
};
} // namespace mozilla
#endif // mozilla_StyleSetHandle_h

View file

@ -1,226 +0,0 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_StyleSetHandleInlines_h
#define mozilla_StyleSetHandleInlines_h
#include "mozilla/StyleSheetInlines.h"
#include "nsStyleSet.h"
namespace mozilla {
void
StyleSetHandle::Ptr::Delete()
{
if (mValue) {
delete AsGecko();
}
}
void
StyleSetHandle::Ptr::Init(nsPresContext* aPresContext)
{
AsGecko()->Init(aPresContext);
}
void
StyleSetHandle::Ptr::BeginShutdown()
{
AsGecko()->BeginShutdown();
}
void
StyleSetHandle::Ptr::Shutdown()
{
AsGecko()->Shutdown();
}
bool
StyleSetHandle::Ptr::GetAuthorStyleDisabled() const
{
return AsGecko()->GetAuthorStyleDisabled();
}
nsresult
StyleSetHandle::Ptr::SetAuthorStyleDisabled(bool aStyleDisabled)
{
return AsGecko()->SetAuthorStyleDisabled(aStyleDisabled);
}
void
StyleSetHandle::Ptr::BeginUpdate()
{
AsGecko()->BeginUpdate();
}
nsresult
StyleSetHandle::Ptr::EndUpdate()
{
return AsGecko()->EndUpdate();
}
// resolve a style context
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
nsStyleContext* aParentContext)
{
return AsGecko()->ResolveStyleFor(aElement, aParentContext);
}
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveStyleFor(dom::Element* aElement,
nsStyleContext* aParentContext,
TreeMatchContext& aTreeMatchContext)
{
return AsGecko()->ResolveStyleFor(aElement, aParentContext, aTreeMatchContext);
}
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveStyleForText(nsIContent* aTextNode,
nsStyleContext* aParentContext)
{
return AsGecko()->ResolveStyleForText(aTextNode, aParentContext);
}
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveStyleForOtherNonElement(nsStyleContext* aParentContext)
{
return AsGecko()->ResolveStyleForOtherNonElement(aParentContext);
}
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolvePseudoElementStyle(dom::Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
dom::Element* aPseudoElement)
{
return AsGecko()->ResolvePseudoElementStyle(
aParentElement, aType, aParentContext, aPseudoElement);
}
// aFlags is an nsStyleSet flags bitfield
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ResolveAnonymousBoxStyle(nsIAtom* aPseudoTag,
nsStyleContext* aParentContext,
uint32_t aFlags)
{
return AsGecko()->ResolveAnonymousBoxStyle(aPseudoTag, aParentContext, aFlags);
}
// manage the set of style sheets in the style set
nsresult
StyleSetHandle::Ptr::AppendStyleSheet(SheetType aType, StyleSheet* aSheet)
{
return AsGecko()->AppendStyleSheet(aType, aSheet->AsGecko());
}
nsresult
StyleSetHandle::Ptr::PrependStyleSheet(SheetType aType, StyleSheet* aSheet)
{
return AsGecko()->PrependStyleSheet(aType, aSheet->AsGecko());
}
nsresult
StyleSetHandle::Ptr::RemoveStyleSheet(SheetType aType, StyleSheet* aSheet)
{
return AsGecko()->RemoveStyleSheet(aType, aSheet->AsGecko());
}
nsresult
StyleSetHandle::Ptr::ReplaceSheets(SheetType aType,
const nsTArray<RefPtr<StyleSheet>>& aNewSheets)
{
nsTArray<RefPtr<CSSStyleSheet>> newSheets(aNewSheets.Length());
for (auto& sheet : aNewSheets) {
newSheets.AppendElement(sheet->AsGecko());
}
return AsGecko()->ReplaceSheets(aType, newSheets);
}
nsresult
StyleSetHandle::Ptr::InsertStyleSheetBefore(SheetType aType,
StyleSheet* aNewSheet,
StyleSheet* aReferenceSheet)
{
return AsGecko()->InsertStyleSheetBefore(
aType, aNewSheet->AsGecko(), aReferenceSheet->AsGecko());
}
int32_t
StyleSetHandle::Ptr::SheetCount(SheetType aType) const
{
return AsGecko()->SheetCount(aType);
}
StyleSheet*
StyleSetHandle::Ptr::StyleSheetAt(SheetType aType, int32_t aIndex) const
{
return AsGecko()->StyleSheetAt(aType, aIndex);
}
nsresult
StyleSetHandle::Ptr::RemoveDocStyleSheet(StyleSheet* aSheet)
{
return AsGecko()->RemoveDocStyleSheet(aSheet->AsGecko());
}
nsresult
StyleSetHandle::Ptr::AddDocStyleSheet(StyleSheet* aSheet,
nsIDocument* aDocument)
{
return AsGecko()->AddDocStyleSheet(aSheet->AsGecko(), aDocument);
}
// check whether there is ::before/::after style for an element
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ProbePseudoElementStyle(dom::Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext)
{
return AsGecko()->ProbePseudoElementStyle(aParentElement, aType, aParentContext);
}
already_AddRefed<nsStyleContext>
StyleSetHandle::Ptr::ProbePseudoElementStyle(dom::Element* aParentElement,
CSSPseudoElementType aType,
nsStyleContext* aParentContext,
TreeMatchContext& aTreeMatchContext,
dom::Element* aPseudoElement)
{
return AsGecko()->ProbePseudoElementStyle(
aParentElement, aType, aParentContext, aTreeMatchContext, aPseudoElement);
}
nsRestyleHint
StyleSetHandle::Ptr::HasStateDependentStyle(dom::Element* aElement,
EventStates aStateMask)
{
return AsGecko()->HasStateDependentStyle(aElement, aStateMask);
}
nsRestyleHint
StyleSetHandle::Ptr::HasStateDependentStyle(dom::Element* aElement,
CSSPseudoElementType aPseudoType,
dom::Element* aPseudoElement,
EventStates aStateMask)
{
return AsGecko()->HasStateDependentStyle(aElement, aPseudoType, aPseudoElement, aStateMask);
}
void
StyleSetHandle::Ptr::RootStyleContextAdded()
{
AsGecko()->RootStyleContextAdded();
}
void
StyleSetHandle::Ptr::RootStyleContextRemoved()
{
RootStyleContextAdded();
}
} // namespace mozilla
#endif // mozilla_StyleSetHandleInlines_h

View file

@ -88,8 +88,6 @@ EXPORTS.mozilla += [
'SheetType.h',
'StyleAnimationValue.h',
'StyleComplexColor.h',
'StyleSetHandle.h',
'StyleSetHandleInlines.h',
'StyleSheet.h',
'StyleSheetInfo.h',
'StyleSheetInlines.h',

View file

@ -525,7 +525,7 @@ ResolvedStyleCache::Get(nsPresContext *aPresContext,
nsCOMArray<nsIStyleRule> rules;
rules.AppendObject(aKeyframeDeclaration);
RefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->AsGecko()->
RefPtr<nsStyleContext> resultStrong = aPresContext->StyleSet()->
ResolveStyleByAddingRules(aParentStyleContext, rules);
mCache.Put(aKeyframeDeclaration, resultStrong);
result = resultStrong;
@ -1052,7 +1052,7 @@ CSSAnimationBuilder::GetComputedValue(nsPresContext* aPresContext,
StyleAnimationValue computedValue;
if (!mStyleWithoutAnimation) {
mStyleWithoutAnimation = aPresContext->StyleSet()->AsGecko()->
mStyleWithoutAnimation = aPresContext->StyleSet()->
ResolveStyleWithoutAnimation(mTarget, mStyleContext,
eRestyle_AllHintsWithAnimations);
}
@ -1098,7 +1098,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
nsCSSKeyframesRule* rule =
src.GetName().IsEmpty()
? nullptr
: mPresContext->StyleSet()->AsGecko()->KeyframesRuleForName(src.GetName());
: mPresContext->StyleSet()->KeyframesRuleForName(src.GetName());
if (!rule) {
continue;
}

View file

@ -35,8 +35,7 @@
#include "nsIDocument.h"
#include "nsCSSPseudoElements.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "imgIRequest.h"
#include "nsLayoutUtils.h"
#include "nsCSSKeywords.h"
@ -504,7 +503,7 @@ nsComputedDOMStyle::GetStyleContextForElementNoFlush(Element* aElement,
if (!presContext)
return nullptr;
StyleSetHandle styleSet = presShell->StyleSet();
nsStyleSet* styleSet = presShell->StyleSet();
RefPtr<nsStyleContext> sc;
if (aPseudo) {
@ -543,7 +542,7 @@ nsComputedDOMStyle::GetStyleContextForElementNoFlush(Element* aElement,
rules[i].swap(rules[length - i - 1]);
}
sc = styleSet->AsGecko()->ResolveStyleForRules(parentContext, rules);
sc = styleSet->ResolveStyleForRules(parentContext, rules);
}
return sc.forget();

View file

@ -18,7 +18,8 @@
#include "nsWrapperCacheInlines.h"
#include "nsIFrame.h"
#include "ActiveLayerTracker.h"
#include "StyleSetHandle.h"
class nsStyleSet;
using namespace mozilla;
using namespace mozilla::dom;

View file

@ -1659,7 +1659,7 @@ nsRuleNode::nsRuleNode(nsPresContext* aContext, nsRuleNode* aParent,
NS_ASSERTION(IsRoot() || GetLevel() == aLevel, "not enough bits");
NS_ASSERTION(IsRoot() || IsImportantRule() == aIsImportant, "yikes");
aContext->StyleSet()->AsGecko()->RuleNodeUnused(this, /* aMayGC = */ false);
aContext->StyleSet()->RuleNodeUnused(this, /* aMayGC = */ false);
// nsStyleSet::GetContext depends on there being only one animation
// rule.
@ -3903,7 +3903,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
if (variantAlternates & NS_FONT_VARIANT_ALTERNATES_FUNCTIONAL_MASK) {
// fetch the feature lookup object from the styleset
aFont->mFont.featureValueLookup =
aPresContext->StyleSet()->AsGecko()->GetFontFeatureValuesLookup();
aPresContext->StyleSet()->GetFontFeatureValuesLookup();
NS_ASSERTION(variantAlternatesValue->GetPairValue().mYValue.GetUnit() ==
eCSSUnit_List, "function list not a list value");

View file

@ -31,8 +31,6 @@
#include "RubyUtils.h"
#include "mozilla/Preferences.h"
#include "mozilla/ArenaObjectID.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/ReflowInput.h"
#include "nsLayoutUtils.h"
@ -160,7 +158,7 @@ nsStyleContext::~nsStyleContext()
#endif
nsPresContext *presContext = PresContext();
DebugOnly<nsStyleSet*> styleSet = presContext->PresShell()->StyleSet()->GetAsGecko();
DebugOnly<nsStyleSet*> styleSet = presContext->PresShell()->StyleSet();
NS_ASSERTION(!styleSet ||
styleSet->GetRuleTree() == mRuleNode->RuleTree() ||
styleSet->IsInRuleTreeReconstruct(),

View file

@ -11,16 +11,13 @@
#include "mozilla/Assertions.h"
#include "mozilla/RestyleLogging.h"
#include "nsCSSAnonBoxes.h"
#include "nsCSSPseudoElements.h"
#include "nsStyleSet.h"
#include "nsRuleNode.h"
class nsIAtom;
class nsPresContext;
namespace mozilla {
enum class CSSPseudoElementType : uint8_t;
} // namespace mozilla
/**
* An nsStyleContext represents the computed style data for an element.
* The computed style data are stored in a set of structs (see

View file

@ -580,7 +580,7 @@ inline
void nsRuleNode::AddRef()
{
if (mRefCnt++ == 0) {
mPresContext->StyleSet()->AsGecko()->RuleNodeInUse(this);
mPresContext->StyleSet()->RuleNodeInUse(this);
}
}
@ -588,7 +588,7 @@ inline
void nsRuleNode::Release()
{
if (--mRefCnt == 0) {
mPresContext->StyleSet()->AsGecko()->RuleNodeUnused(this, /* aMayGC = */ true);
mPresContext->StyleSet()->RuleNodeUnused(this, /* aMayGC = */ true);
}
}
#endif

View file

@ -530,7 +530,7 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
// not stopping or starting right now.
RefPtr<nsStyleContext> afterChangeStyle;
if (collection) {
nsStyleSet* styleSet = mPresContext->StyleSet()->AsGecko();
nsStyleSet* styleSet = mPresContext->StyleSet();
afterChangeStyle =
styleSet->ResolveStyleWithoutAnimation(aElement, newStyleContext,
eRestyle_CSSTransitions);

View file

@ -38,8 +38,7 @@
#include "nsFrameManager.h"
#include "nsError.h"
#include "nsCSSFrameConstructor.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "mozilla/gfx/Helpers.h"
#include "nsDisplayList.h"
#include "nsIScrollableFrame.h"

View file

@ -26,8 +26,7 @@
#include "nsStyleContext.h"
#include "nsFontMetrics.h"
#include "nsITimer.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsPIBoxObject.h"
#include "nsLayoutUtils.h"
#include "nsPIListBoxObject.h"

View file

@ -29,8 +29,7 @@
#include "nsIServiceManager.h"
#include "nsContainerFrame.h"
#include "nsContentCID.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsStyleSet.h"
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
#include "nsContentUtils.h"

View file

@ -6,8 +6,6 @@
#include "nsTreeStyleCache.h"
#include "nsStyleSet.h"
#include "mozilla/dom/Element.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
nsTreeStyleCache::Transition::Transition(DFAState aState, nsIAtom* aSymbol)
: mState(aState), mInputSymbol(aSymbol)
@ -78,7 +76,7 @@ nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
}
if (!result) {
// We missed the cache. Resolve this pseudo-style.
RefPtr<nsStyleContext> newResult = aPresContext->StyleSet()->AsGecko()->
RefPtr<nsStyleContext> newResult = aPresContext->StyleSet()->
ResolveXULTreePseudoStyle(aContent->AsElement(), aPseudoElement,
aContext, aComparator);

View file

@ -9,7 +9,6 @@
#include "mozilla/GuardObjects.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Move.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "nsAutoPtr.h"
#include "nsBindingManager.h"
#include "nsComponentManagerUtils.h"
@ -115,8 +114,7 @@ AttachXBLBindings(nsIContent* aContent) {
}
RefPtr<nsStyleContext> sc =
shell->StyleSet()->AsGecko()->ResolveStyleFor(aContent->AsElement(),
nullptr);
shell->StyleSet()->ResolveStyleFor(aContent->AsElement(), nullptr);
if (!sc) {
return;
}