mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 781032 - Fix a crash in CSSParserImpl::SetDefaultNamespaceOnSelector by creating the nsCSSParser at a valid spot. r=bz
This commit is contained in:
parent
28e7684705
commit
cc82c3a601
@ -791,6 +791,8 @@ CSSParserImpl::SetStyleSheet(nsCSSStyleSheet* aSheet)
|
||||
} else {
|
||||
mNameSpaceMap = nullptr;
|
||||
}
|
||||
} else if (mSheet) {
|
||||
mNameSpaceMap = mSheet->GetNameSpaceMap();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2134,8 +2134,6 @@ nsCSSStyleSheet::ParseSheet(const nsAString& aInput)
|
||||
loader = new css::Loader();
|
||||
}
|
||||
|
||||
nsCSSParser parser(loader, this);
|
||||
|
||||
mozAutoDocUpdate updateBatch(mDocument, UPDATE_STYLE, true);
|
||||
|
||||
nsresult rv = WillDirty();
|
||||
@ -2163,6 +2161,8 @@ nsCSSStyleSheet::ParseSheet(const nsAString& aInput)
|
||||
|
||||
// allow unsafe rules if the style sheet's principal is the system principal
|
||||
bool allowUnsafeRules = nsContentUtils::IsSystemPrincipal(mInner->mPrincipal);
|
||||
|
||||
nsCSSParser parser(loader, this);
|
||||
rv = parser.ParseSheet(aInput, mInner->mSheetURI, mInner->mBaseURI,
|
||||
mInner->mPrincipal, 1, allowUnsafeRules);
|
||||
DidDirty(); // we are always 'dirty' here since we always remove rules first
|
||||
|
Loading…
x
Reference in New Issue
Block a user