зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1328420 Part 1: Uplift parent pointer and accessor to StyleSheet class. r=heycam
MozReview-Commit-ID: C63yRZM3ORC --HG-- extra : rebase_source : 92f7628506176d728e4b2ac4ae804729bc3738b3
This commit is contained in:
Родитель
8439919627
Коммит
f85fc3564c
|
@ -371,7 +371,6 @@ CSSStyleSheetInner::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
|||
CSSStyleSheet::CSSStyleSheet(css::SheetParsingMode aParsingMode,
|
||||
CORSMode aCORSMode, ReferrerPolicy aReferrerPolicy)
|
||||
: StyleSheet(StyleBackendType::Gecko, aParsingMode),
|
||||
mParent(nullptr),
|
||||
mOwnerRule(nullptr),
|
||||
mDirty(false),
|
||||
mInRuleProcessorCache(false),
|
||||
|
@ -387,7 +386,6 @@ CSSStyleSheet::CSSStyleSheet(css::SheetParsingMode aParsingMode,
|
|||
ReferrerPolicy aReferrerPolicy,
|
||||
const SRIMetadata& aIntegrity)
|
||||
: StyleSheet(StyleBackendType::Gecko, aParsingMode),
|
||||
mParent(nullptr),
|
||||
mOwnerRule(nullptr),
|
||||
mDirty(false),
|
||||
mInRuleProcessorCache(false),
|
||||
|
@ -404,7 +402,6 @@ CSSStyleSheet::CSSStyleSheet(const CSSStyleSheet& aCopy,
|
|||
nsIDocument* aDocumentToUse,
|
||||
nsINode* aOwningNodeToUse)
|
||||
: StyleSheet(aCopy, aDocumentToUse, aOwningNodeToUse),
|
||||
mParent(aParentToUse),
|
||||
mOwnerRule(aOwnerRuleToUse),
|
||||
mDirty(aCopy.mDirty),
|
||||
mInRuleProcessorCache(false),
|
||||
|
@ -412,6 +409,7 @@ CSSStyleSheet::CSSStyleSheet(const CSSStyleSheet& aCopy,
|
|||
mInner(aCopy.mInner),
|
||||
mRuleProcessors(nullptr)
|
||||
{
|
||||
mParent = aParentToUse;
|
||||
|
||||
mInner->AddSheet(this);
|
||||
|
||||
|
@ -609,12 +607,6 @@ CSSStyleSheet::EnabledStateChangedInternal()
|
|||
ClearRuleCascades();
|
||||
}
|
||||
|
||||
CSSStyleSheet*
|
||||
CSSStyleSheet::GetParentSheet() const
|
||||
{
|
||||
return mParent;
|
||||
}
|
||||
|
||||
void
|
||||
CSSStyleSheet::SetAssociatedDocument(nsIDocument* aDocument,
|
||||
DocumentAssociationMode aAssociationMode)
|
||||
|
@ -657,7 +649,8 @@ CSSStyleSheet::FindOwningWindowInnerID() const
|
|||
}
|
||||
|
||||
if (windowID == 0 && mParent) {
|
||||
windowID = mParent->FindOwningWindowInnerID();
|
||||
CSSStyleSheet* parentAsCSS = mParent->AsGecko();
|
||||
windowID = parentAsCSS->FindOwningWindowInnerID();
|
||||
}
|
||||
|
||||
return windowID;
|
||||
|
|
|
@ -115,8 +115,6 @@ public:
|
|||
|
||||
bool HasRules() const;
|
||||
|
||||
// style sheet owner info
|
||||
CSSStyleSheet* GetParentSheet() const; // may be null
|
||||
void SetAssociatedDocument(nsIDocument* aDocument,
|
||||
DocumentAssociationMode aAssociationMode);
|
||||
|
||||
|
@ -236,7 +234,6 @@ protected:
|
|||
void EnabledStateChangedInternal();
|
||||
|
||||
RefPtr<CSSStyleSheet> mNext;
|
||||
CSSStyleSheet* mParent; // weak ref
|
||||
css::ImportRule* mOwnerRule; // weak ref
|
||||
|
||||
RefPtr<CSSRuleListImpl> mRuleCollection;
|
||||
|
|
|
@ -67,15 +67,6 @@ ServoStyleSheet::SetAssociatedDocument(nsIDocument* aDocument,
|
|||
mDocumentAssociationMode = aAssociationMode;
|
||||
}
|
||||
|
||||
ServoStyleSheet*
|
||||
ServoStyleSheet::GetParentSheet() const
|
||||
{
|
||||
// XXXheycam: When we implement support for child sheets, we'll have
|
||||
// to fix SetAssociatedDocument to propagate the associated document down
|
||||
// to the children.
|
||||
MOZ_CRASH("stylo: not implemented");
|
||||
}
|
||||
|
||||
void
|
||||
ServoStyleSheet::AppendStyleSheet(ServoStyleSheet* aSheet)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,6 @@ public:
|
|||
void SetAssociatedDocument(nsIDocument* aDocument,
|
||||
DocumentAssociationMode aAssociationMode);
|
||||
|
||||
ServoStyleSheet* GetParentSheet() const;
|
||||
void AppendStyleSheet(ServoStyleSheet* aSheet);
|
||||
|
||||
MOZ_MUST_USE nsresult ParseSheet(css::Loader* aLoader,
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
namespace mozilla {
|
||||
|
||||
StyleSheet::StyleSheet(StyleBackendType aType, css::SheetParsingMode aParsingMode)
|
||||
: mDocument(nullptr)
|
||||
: mParent(nullptr)
|
||||
, mDocument(nullptr)
|
||||
, mOwningNode(nullptr)
|
||||
, mParsingMode(aParsingMode)
|
||||
, mType(aType)
|
||||
|
@ -31,7 +32,8 @@ StyleSheet::StyleSheet(StyleBackendType aType, css::SheetParsingMode aParsingMod
|
|||
StyleSheet::StyleSheet(const StyleSheet& aCopy,
|
||||
nsIDocument* aDocumentToUse,
|
||||
nsINode* aOwningNodeToUse)
|
||||
: mTitle(aCopy.mTitle)
|
||||
: mParent(nullptr)
|
||||
, mTitle(aCopy.mTitle)
|
||||
, mDocument(aDocumentToUse)
|
||||
, mOwningNode(aOwningNodeToUse)
|
||||
, mParsingMode(aCopy.mParsingMode)
|
||||
|
|
|
@ -124,7 +124,7 @@ public:
|
|||
DocumentAssociationMode aMode);
|
||||
inline void ClearAssociatedDocument();
|
||||
nsINode* GetOwnerNode() const { return mOwningNode; }
|
||||
inline StyleSheet* GetParentSheet() const;
|
||||
inline StyleSheet* GetParentSheet() const { return mParent; }
|
||||
|
||||
inline void AppendStyleSheet(StyleSheet* aSheet);
|
||||
|
||||
|
@ -227,6 +227,8 @@ protected:
|
|||
// Called from SetEnabled when the enabled state changed.
|
||||
void EnabledStateChanged();
|
||||
|
||||
StyleSheet* mParent; // weak ref
|
||||
|
||||
nsString mTitle;
|
||||
nsIDocument* mDocument; // weak ref; parents maintain this for their children
|
||||
nsINode* mOwningNode; // weak ref
|
||||
|
|
|
@ -96,12 +96,6 @@ StyleSheet::ClearAssociatedDocument()
|
|||
MOZ_STYLO_FORWARD(SetAssociatedDocument, (nullptr, NotOwnedByDocument));
|
||||
}
|
||||
|
||||
StyleSheet*
|
||||
StyleSheet::GetParentSheet() const
|
||||
{
|
||||
MOZ_STYLO_FORWARD(GetParentSheet, ())
|
||||
}
|
||||
|
||||
StyleSheet*
|
||||
StyleSheet::GetParentStyleSheet() const
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче