Bug 1290276 Part 4 - Make ServoStyleSet::RawSet() return a pointer. r=heycam

In next part, we'll use ServoStyleSet to host XBL stylesheets. The raw set
is not available until the resources are loaded, so it's easier to tell that
by checking whether the pointer is nullptr or not.

MozReview-Commit-ID: Hqydd55FPO9

--HG--
extra : rebase_source : 6df6c2666aea2ca8a8065d4f4d9b552ec7b3e6fe
This commit is contained in:
Ting-Yu Lin 2017-06-05 11:57:13 +08:00
Родитель e2e9e98b3f
Коммит ee880dc08d
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -82,9 +82,10 @@ ServoMediaList::Delete(const nsAString& aOldMedium)
bool
ServoMediaList::Matches(nsPresContext* aPresContext) const
{
const RawServoStyleSet& rawSet =
const RawServoStyleSet* rawSet =
aPresContext->StyleSet()->AsServo()->RawSet();
return Servo_MediaList_Matches(mRawList, &rawSet);
MOZ_ASSERT(rawSet, "The RawServoStyleSet should be valid!");
return Servo_MediaList_Matches(mRawList, rawSet);
}
} // namespace mozilla

Просмотреть файл

@ -142,7 +142,9 @@ public:
void InvalidateStyleForCSSRuleChanges();
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
const RawServoStyleSet& RawSet() const { return *mRawSet; }
const RawServoStyleSet* RawSet() const {
return mRawSet.get();
}
bool GetAuthorStyleDisabled() const;
nsresult SetAuthorStyleDisabled(bool aStyleDisabled);