Bug 1376805 - Disable stylo for about: pages other than about:blank. r?bholley draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 28 Jun 2017 10:17:45 -0700
changeset 601351 c8143ef5d5820d7b4bebf8da8d0e067c8a1cb565
parent 601107 e66fda9cc21126249c5253e5a2b525dd91f855c0
child 635222 38cffebdbd8dda78ab8c1b69fe4e1df98356a9f4
push id66022
push userbmo:cam@mcc.id.au
push dateWed, 28 Jun 2017 17:28:17 +0000
reviewersbholley
bugs1376805
milestone56.0a1
Bug 1376805 - Disable stylo for about: pages other than about:blank. r?bholley MozReview-Commit-ID: F3gSY2uDGJ7
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -13128,17 +13128,23 @@ nsIDocument::UpdateStyleBackendType()
   mStyleBackendType = StyleBackendType::Gecko;
 
 #ifdef MOZ_STYLO
   if (nsLayoutUtils::StyloEnabled()) {
     if (!mDocumentContainer) {
       NS_WARNING("stylo: No docshell yet, assuming Gecko style system");
     } else if ((IsHTMLOrXHTML() || IsSVGDocument()) &&
                IsContentDocument()) {
-      mStyleBackendType = StyleBackendType::Servo;
+      // Disable stylo for about: pages other than about:blank, since
+      // they tend to use unsupported selectors like XUL tree pseudos.
+      bool isAbout = false;
+      mDocumentURI->SchemeIs("about", &isAbout);
+      if (!isAbout || NS_IsAboutBlank(mDocumentURI)) {
+        mStyleBackendType = StyleBackendType::Servo;
+      }
     }
   }
 #endif
 }
 
 /**
  * Helper function for |nsDocument::PrincipalFlashClassification|
  *