Backed out changeset 03166449953f (bug 1539759) on request from past for causing bug 1548990. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Sat, 04 May 2019 11:02:30 +0300
changeset 531366 24a6a4f933a8289666dbda9b9c5e39c2de89fa4f
parent 531365 e9bfe907b847e08e7fe89e12e6d86aa6115c99d9
child 531367 9419be649effc5bc67eb3d6fce1db46caa7fae7e
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1539759, 1548990
milestone68.0a1
backs out03166449953fbcaaf6c66d2c3b358319781a0e52
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
Backed out changeset 03166449953f (bug 1539759) on request from past for causing bug 1548990. CLOSED TREE
dom/base/test/browser_bug593387.js
parser/expat/lib/xmlparse.c
parser/htmlparser/nsExpatDriver.cpp
parser/htmlparser/nsExpatDriver.h
--- a/dom/base/test/browser_bug593387.js
+++ b/dom/base/test/browser_bug593387.js
@@ -3,17 +3,17 @@
  * Loads a chrome document in a content docshell and then inserts a
  * X-Frame-Options: DENY iframe into the document and verifies that the document
  * loads. The policy we are enforcing is outlined here:
  * https://bugzilla.mozilla.org/show_bug.cgi?id=593387#c17
 */
 
 add_task(async function test() {
   await BrowserTestUtils.withNewTab({ gBrowser,
-                                      url: "chrome://global/content/aboutProfiles.xhtml" },
+                                      url: "chrome://global/content/mozilla.xhtml" },
                                      async function(newBrowser) {
     // NB: We load the chrome:// page in the parent process.
     await testXFOFrameInChrome(newBrowser);
 
     // Run next test (try the same with a content top-level context)
     await BrowserTestUtils.loadURI(newBrowser, "http://example.com/");
     await BrowserTestUtils.browserLoaded(newBrowser);
 
--- a/parser/expat/lib/xmlparse.c
+++ b/parser/expat/lib/xmlparse.c
@@ -1760,26 +1760,26 @@ XML_SetElementDeclHandler(XML_Parser par
 
 void XMLCALL
 XML_SetAttlistDeclHandler(XML_Parser parser,
                           XML_AttlistDeclHandler attdecl)
 {
   if (parser != NULL)
     attlistDeclHandler = attdecl;
 }
-#endif
-/* END MOZILLA CHANGE */
 
 void XMLCALL
 XML_SetEntityDeclHandler(XML_Parser parser,
                          XML_EntityDeclHandler handler)
 {
   if (parser != NULL)
     entityDeclHandler = handler;
 }
+#endif
+/* END MOZILLA CHANGE */
 
 void XMLCALL
 XML_SetXmlDeclHandler(XML_Parser parser,
                       XML_XmlDeclHandler handler) {
   if (parser != NULL)
     xmlDeclHandler = handler;
 }
 
--- a/parser/htmlparser/nsExpatDriver.cpp
+++ b/parser/htmlparser/nsExpatDriver.cpp
@@ -149,28 +149,16 @@ static int Driver_HandleExternalEntityRe
 
   nsExpatDriver* driver =
       static_cast<nsExpatDriver*>(aExternalEntityRefHandler);
 
   return driver->HandleExternalEntityRef(aOpenEntityNames, aBase, aSystemId,
                                          aPublicId);
 }
 
-static void Driver_HandleEntityDecl(
-    void* aUserData, const XML_Char* aEntityName, int aIsParameterEntity,
-    const XML_Char* aValue, int aValueLength, const XML_Char* aBase,
-    const XML_Char* aSystemId, const XML_Char* aPublicId,
-    const XML_Char* aNotationName) {
-  NS_ASSERTION(aUserData, "expat driver should exist");
-  if (aUserData) {
-    static_cast<nsExpatDriver*>(aUserData)->HandleEntityDecl(
-        aEntityName, aValue, aValueLength);
-  }
-}
-
 /***************************** END CALL BACKS ********************************/
 
 /***************************** CATALOG UTILS *********************************/
 
 // Initially added for bug 113400 to switch from the remote "XHTML 1.0 plus
 // MathML 2.0" DTD to the the lightweight customized version that Mozilla uses.
 // Since Mozilla is not validating, no need to fetch a *huge* file at each
 // click.
@@ -481,29 +469,16 @@ nsresult nsExpatDriver::HandleEndDoctype
     MaybeStopParser(rv);
   }
 
   mInternalSubset.Truncate();
 
   return NS_OK;
 }
 
-void nsExpatDriver::HandleEntityDecl(const char16_t* aEntityName,
-                                     const char16_t* aEntityValue,
-                                     const uint32_t aLength) {
-  MOZ_ASSERT(
-      mInInternalSubset || mInExternalDTD,
-      "Should only see entity declarations in the internal subset or in DTDs");
-  auto charLength = aLength / sizeof(char16_t);
-  nsDependentSubstring entityVal(aEntityValue, charLength);
-  if (entityVal.FindChar('<') != -1) {
-    MaybeStopParser(NS_ERROR_UNEXPECTED);
-  }
-}
-
 static nsresult ExternalDTDStreamReaderFunc(nsIUnicharInputStream* aIn,
                                             void* aClosure,
                                             const char16_t* aFromSegment,
                                             uint32_t aToOffset, uint32_t aCount,
                                             uint32_t* aWriteCount) {
   // Pass the buffer to expat for parsing.
   if (XML_Parse((XML_Parser)aClosure, (const char*)aFromSegment,
                 aCount * sizeof(char16_t), 0) == XML_STATUS_OK) {
@@ -1077,19 +1052,16 @@ nsExpatDriver::WillBuildModel(const CPar
       (XML_ExternalEntityRefHandler)Driver_HandleExternalEntityRef);
   XML_SetExternalEntityRefHandlerArg(mExpatParser, this);
   XML_SetCommentHandler(mExpatParser, Driver_HandleComment);
   XML_SetCdataSectionHandler(mExpatParser, Driver_HandleStartCdataSection,
                              Driver_HandleEndCdataSection);
 
   XML_SetParamEntityParsing(mExpatParser,
                             XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE);
-  if (doc && doc->NodePrincipal()->IsSystemPrincipal()) {
-    XML_SetEntityDeclHandler(mExpatParser, Driver_HandleEntityDecl);
-  }
   XML_SetDoctypeDeclHandler(mExpatParser, Driver_HandleStartDoctypeDecl,
                             Driver_HandleEndDoctypeDecl);
 
   // Set up the user data.
   XML_SetUserData(mExpatParser, this);
 
   return mInternalState;
 }
--- a/parser/htmlparser/nsExpatDriver.h
+++ b/parser/htmlparser/nsExpatDriver.h
@@ -44,18 +44,16 @@ class nsExpatDriver : public nsIDTD, pub
   nsresult HandleDefault(const char16_t* aData, const uint32_t aLength);
   nsresult HandleStartCdataSection();
   nsresult HandleEndCdataSection();
   nsresult HandleStartDoctypeDecl(const char16_t* aDoctypeName,
                                   const char16_t* aSysid,
                                   const char16_t* aPubid,
                                   bool aHasInternalSubset);
   nsresult HandleEndDoctypeDecl();
-  void HandleEntityDecl(const char16_t* aEntityName,
-                        const char16_t* aEntityValue, const uint32_t aLength);
 
  private:
   // Load up an external stream to get external entity information
   nsresult OpenInputStreamFromExternalDTD(const char16_t* aFPIStr,
                                           const char16_t* aURLStr,
                                           const char16_t* aBaseURL,
                                           nsIInputStream** aStream,
                                           nsAString& aAbsURL);