mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 508725 - Part 4: Add a content flag representing whether an element is a scoped style root. r=dbaron
This commit is contained in:
parent
50a3cffd42
commit
ad3f65836e
@ -1322,6 +1322,8 @@ private:
|
||||
// Set if the element is in the scope of a scoped style sheet; this flag is
|
||||
// only accurate for elements bounds to a document
|
||||
ElementIsInStyleScope,
|
||||
// Set if the element is a scoped style sheet root
|
||||
ElementIsScopedStyleRoot,
|
||||
// Guard value
|
||||
BooleanFlagCount
|
||||
};
|
||||
@ -1452,6 +1454,10 @@ public:
|
||||
ClearBoolFlag(ElementIsInStyleScope);
|
||||
}
|
||||
bool IsElementInStyleScope() const { return GetBoolFlag(ElementIsInStyleScope); }
|
||||
|
||||
void SetIsScopedStyleRoot() { SetBoolFlag(ElementIsScopedStyleRoot); }
|
||||
void ClearIsScopedStyleRoot() { ClearBoolFlag(ElementIsScopedStyleRoot); }
|
||||
bool IsScopedStyleRoot() { return GetBoolFlag(ElementIsScopedStyleRoot); }
|
||||
protected:
|
||||
void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
|
||||
void SetInDocument() { SetBoolFlag(IsInDocument); }
|
||||
|
@ -295,6 +295,12 @@ nsStyleSet::GatherRuleProcessors(sheetType aType)
|
||||
{
|
||||
mRuleProcessors[aType] = nullptr;
|
||||
if (aType == eScopedDocSheet) {
|
||||
for (int i = 0; i < mScopedDocSheetRuleProcessors.Length(); i++) {
|
||||
nsIStyleRuleProcessor* processor = mScopedDocSheetRuleProcessors[i].get();
|
||||
Element* scope =
|
||||
static_cast<nsCSSRuleProcessor*>(processor)->GetScopeElement();
|
||||
scope->ClearIsScopedStyleRoot();
|
||||
}
|
||||
mScopedDocSheetRuleProcessors.Clear();
|
||||
}
|
||||
if (mAuthorStyleDisabled && (aType == eDocSheet ||
|
||||
@ -348,6 +354,8 @@ nsStyleSet::GatherRuleProcessors(sheetType aType)
|
||||
end++;
|
||||
}
|
||||
|
||||
scope->SetIsScopedStyleRoot();
|
||||
|
||||
// Create a rule processor for the scope.
|
||||
nsTArray< nsRefPtr<nsCSSStyleSheet> > sheetsForScope;
|
||||
sheetsForScope.AppendElements(sheets.Elements() + start, end - start);
|
||||
|
Loading…
Reference in New Issue
Block a user