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:
Emilio Cobos Álvarez
2018-06-22 12:47:11 +02:00
parent 7b4b015e7f
commit 73d69bb8a2
2 changed files with 5 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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()) {