Bug 1469176: Load svg.css upfront. r=jwatt
Test Plan: Covered by existing tests. Reviewers: jwatt Reviewed By: jwatt Bug #: 1469176 Differential Revision: https://phabricator.services.mozilla.com/D1762
This commit is contained in:
@@ -495,14 +495,6 @@ SVGSVGElement::BindToTree(nsIDocument* aDocument,
|
||||
aCompileEventHandlers);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (nsIDocument* doc = GetComposedDoc()) {
|
||||
// Setup the style sheet during binding, not element construction, because
|
||||
// we could move the root SVG element from the document that created it to
|
||||
// another document.
|
||||
auto cache = nsLayoutStylesheetCache::Singleton();
|
||||
doc->EnsureOnDemandBuiltInUASheet(cache->SVGSheet());
|
||||
}
|
||||
|
||||
if (mTimedDocumentRoot && smilController) {
|
||||
rv = mTimedDocumentRoot->SetParent(smilController);
|
||||
if (mStartAnimationOnBindToTree) {
|
||||
|
||||
@@ -2514,6 +2514,11 @@ nsDocumentViewer::CreateStyleSet(nsIDocument* aDocument)
|
||||
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
|
||||
}
|
||||
|
||||
sheet = cache->SVGSheet();
|
||||
if (sheet) {
|
||||
styleSet->PrependStyleSheet(SheetType::Agent, sheet);
|
||||
}
|
||||
|
||||
styleSet->PrependStyleSheet(SheetType::Agent, cache->UASheet());
|
||||
|
||||
if (nsStyleSheetService* sheetService = nsStyleSheetService::GetInstance()) {
|
||||
|
||||
Reference in New Issue
Block a user