Bug 1507895 - Part VI, Reword the content process XBL binding assertion r=smaug
authorTimothy Guan-tin Chien <timdream@gmail.com>
Fri, 25 Jan 2019 15:07:06 +0000
changeset 455669 bcf07920d63f90e8047a7f472d6ea34375f388c9
parent 455668 d7e0e993611faaa007e591e964eb9a54f94f4732
child 455670 1d40794bc9cf93c0ed2ab5ed2a0cf8ce4f9f04b2
push id76921
push usertchien@mozilla.com
push dateMon, 28 Jan 2019 18:34:59 +0000
treeherderautoland@bcf07920d63f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1507895, 1426492, 1503019
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507895 - Part VI, Reword the content process XBL binding assertion r=smaug This patch cleans up the assertion added in bug 1426492. With that we have disallowed all bindings in content HTML. The XMLPrettyPrint binding was removed in bug 1503019. Depends on D17575 Differential Revision: https://phabricator.services.mozilla.com/D17576
dom/xbl/nsXBLService.cpp
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -457,36 +457,32 @@ nsresult nsXBLService::LoadBindings(Elem
 
   AutoEnsureSubtreeStyled subtreeStyled(aElement);
 
   if (MOZ_UNLIKELY(!aURL)) {
     return NS_OK;
   }
 
 #ifdef DEBUG
-  // Ensures that only the whitelisted bindings are used in the following
-  // conditions:
+  // Ensures that XBL bindings are not used in the following conditions:
   //
   // 1) In the content process
   // 2) In a document that disallows XUL/XBL which only loads bindings
   //    referenced in a chrome stylesheet.
   //
-  // If the conditions are met, assert that:
-  //
-  // a) The binding is XMLPrettyPrint (since it may be bound to any XML)
+  // If the conditions are met, trigger an assertion since there shouldn't
+  // be this kind of binding usage.
   //
   // The assertion might not catch all violations because (2) is needed
   // for the current test setup. Someone may unknownly using a binding
   // in AllowXULXBL() documents in content process in production without
   // knowing.
   if (XRE_IsContentProcess() &&
       IsSystemOrChromeURLPrincipal(aOriginPrincipal) && aElement->OwnerDoc() &&
-      !aElement->OwnerDoc()->AllowXULXBL() &&
-      !aURL->GetSpecOrDefault().EqualsLiteral(
-          "chrome://global/content/xml/XMLPrettyPrint.xml#prettyprint")) {
+      !aElement->OwnerDoc()->AllowXULXBL()) {
     MOZ_ASSERT(false, "Unexpected XBL binding used in the content process");
   }
 #endif
 
   // Easy case: The binding was already loaded.
   nsXBLBinding* binding = aElement->GetXBLBinding();
   if (binding && !binding->MarkedForDeath() &&
       binding->PrototypeBinding()->CompareBindingURI(aURL)) {