Bug 903372 - Removal of xml:base. r=baku
☠☠ backed out by d4574d735063 ☠ ☠
authorJonathan Kingston <jkt@mozilla.com>
Thu, 29 Nov 2018 15:31:46 +0000
changeset 505321 6562c2392ac9127ff2deeed7276e2c44cd36669b
parent 505320 2f92fd614d56a6c6b68041f4cdf70c358c01e7c8
child 505322 bf919773f9d19a9032c1b5805d08723843dac701
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs903372
milestone65.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 903372 - Removal of xml:base. r=baku Differential Revision: https://phabricator.services.mozilla.com/D8965
dom/base/FragmentOrElement.cpp
dom/base/nsDeprecatedOperationList.h
dom/base/nsTreeSanitizer.cpp
dom/base/test/mochitest.ini
dom/base/test/test_base.xhtml
dom/base/test/test_bug505783.html
dom/html/HTMLAnchorElement.cpp
dom/html/HTMLAreaElement.cpp
dom/html/HTMLLinkElement.cpp
dom/html/test/test_bug481335.xhtml
dom/locales/en-US/chrome/dom/dom.properties
dom/mathml/nsMathMLElement.cpp
dom/svg/SVGAElement.cpp
dom/xhr/tests/test_XHRDocURI.html
dom/xslt/xslt/txStylesheetCompiler.cpp
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -342,81 +342,25 @@ nsIContent::GetLang() const
 
   return nullptr;
 }
 
 already_AddRefed<nsIURI>
 nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const
 {
   if (SVGUseElement* use = GetContainingSVGUseShadowHost()) {
-    // XXX Ignore xml:base as we are removing it.
     if (URLExtraData* data = use->GetContentURLData()) {
       return do_AddRef(data->BaseURI());
     }
   }
 
   nsIDocument* doc = OwnerDoc();
   // Start with document base
   nsCOMPtr<nsIURI> base = doc->GetBaseURI(aTryUseXHRDocBaseURI);
 
-  // Collect array of xml:base attribute values up the parent chain. This
-  // is slightly slower for the case when there are xml:base attributes, but
-  // faster for the far more common case of there not being any such
-  // attributes.
-  // Also check for SVG elements which require special handling
-  AutoTArray<nsString, 5> baseAttrs;
-  nsString attr;
-  const nsIContent *elem = this;
-  do {
-    // First check for SVG specialness (why is this SVG specific?)
-    if (elem->IsSVGElement()) {
-      nsIContent* bindingParent = elem->GetBindingParent();
-      if (bindingParent) {
-        nsXBLBinding* binding = bindingParent->GetXBLBinding();
-        if (binding) {
-          // XXX sXBL/XBL2 issue
-          // If this is an anonymous XBL element use the binding
-          // document for the base URI.
-          // XXX Will fail with xml:base
-          base = binding->PrototypeBinding()->DocURI();
-          break;
-        }
-      }
-    }
-
-    // Otherwise check for xml:base attribute
-    if (elem->IsElement()) {
-      elem->AsElement()->GetAttr(kNameSpaceID_XML, nsGkAtoms::base, attr);
-      if (!attr.IsEmpty()) {
-        baseAttrs.AppendElement(attr);
-      }
-    }
-    elem = elem->GetParent();
-  } while(elem);
-
-  if (!baseAttrs.IsEmpty()) {
-    doc->WarnOnceAbout(nsIDocument::eXMLBaseAttribute);
-    // Now resolve against all xml:base attrs
-    for (uint32_t i = baseAttrs.Length() - 1; i != uint32_t(-1); --i) {
-      nsCOMPtr<nsIURI> newBase;
-      nsresult rv = NS_NewURI(getter_AddRefs(newBase), baseAttrs[i],
-                              doc->GetDocumentCharacterSet(), base);
-      // Do a security check, almost the same as nsDocument::SetBaseURL()
-      // Only need to do this on the final uri
-      if (NS_SUCCEEDED(rv) && i == 0) {
-        rv = nsContentUtils::GetSecurityManager()->
-          CheckLoadURIWithPrincipal(NodePrincipal(), newBase,
-                                    nsIScriptSecurityManager::STANDARD);
-      }
-      if (NS_SUCCEEDED(rv)) {
-        base.swap(newBase);
-      }
-    }
-  }
-
   return base.forget();
 }
 
 nsIURI*
 nsIContent::GetBaseURIForStyleAttr() const
 {
   if (SVGUseElement* use = GetContainingSVGUseShadowHost()) {
     if (URLExtraData* data = use->GetContentURLData()) {
--- a/dom/base/nsDeprecatedOperationList.h
+++ b/dom/base/nsDeprecatedOperationList.h
@@ -27,17 +27,16 @@ DEPRECATED_OPERATION(ImportXULIntoConten
 DEPRECATED_OPERATION(NavigatorGetUserMedia)
 DEPRECATED_OPERATION(WebrtcDeprecatedPrefix)
 DEPRECATED_OPERATION(RTCPeerConnectionGetStreams)
 DEPRECATED_OPERATION(AppCache)
 DEPRECATED_OPERATION(AppCacheInsecure)
 DEPRECATED_OPERATION(PrefixedImageSmoothingEnabled)
 DEPRECATED_OPERATION(LenientSetter)
 DEPRECATED_OPERATION(ImageBitmapRenderingContext_TransferImageBitmap)
-DEPRECATED_OPERATION(XMLBaseAttribute)
 DEPRECATED_OPERATION(WindowContentUntrusted)
 DEPRECATED_OPERATION(RegisterProtocolHandlerInsecure)
 DEPRECATED_OPERATION(MixedDisplayObjectSubrequest)
 DEPRECATED_OPERATION(MotionEvent)
 DEPRECATED_OPERATION(OrientationEvent)
 DEPRECATED_OPERATION(ProximityEvent)
 DEPRECATED_OPERATION(AmbientLightEvent)
 DEPRECATED_OPERATION(IDBOpenDBOptions_StorageType)
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -1260,25 +1260,16 @@ nsTreeSanitizer::SanitizeAttributes(mozi
       // Allow aria-* on all for simplicity.
       if (UTF16StringStartsWith(localStr, localLen, u"_") ||
           UTF16StringStartsWith(localStr, localLen, u"data-") ||
           UTF16StringStartsWith(localStr, localLen, u"aria-")) {
         continue;
       }
       // else not allowed
     } else if (kNameSpaceID_XML == attrNs) {
-      if (nsGkAtoms::base == attrLocal) {
-        if (SanitizeURL(aElement, attrNs, attrLocal)) {
-          // in case the attribute removal shuffled the attribute order, start
-          // the loop again.
-          --ac;
-          i = ac; // i will be decremented immediately thanks to the for loop
-        }
-        continue;
-      }
       if (nsGkAtoms::lang == attrLocal || nsGkAtoms::space == attrLocal) {
         continue;
       }
       // else not allowed
     } else if (aAllowed.mXLink && kNameSpaceID_XLink == attrNs) {
       if (nsGkAtoms::href == attrLocal) {
         if (SanitizeURL(aElement, attrNs, attrLocal)) {
           // in case the attribute removal shuffled the attribute order, start
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -432,18 +432,16 @@ support-files = test_bug493881.js
 [test_bug500937.html]
 [test_bug503473.html]
 disabled = Disabled due to making the harness time out
 support-files = file_bug503473-frame.sjs
 [test_bug503481.html]
 skip-if = toolkit == 'android' #TIMED_OUT
 [test_bug503481b.html]
 skip-if = toolkit == 'android' #TIMED_OUT
-[test_bug505783.html]
-skip-if = toolkit == 'android' #TIMED_OUT
 [test_bug513194.html]
 [test_bug514487.html]
 [test_bug515401.html]
 [test_bug518104.html]
 support-files = file_bug518104.js
 [test_bug527896.html]
 [test_bug540854.html]
 [test_bug541937.html]
--- a/dom/base/test/test_base.xhtml
+++ b/dom/base/test/test_base.xhtml
@@ -16,34 +16,34 @@
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(function() {
   is(document.baseURI, "http://mochi.test:8888/tests/dom/base/",
      "document base");
   is(document.body.baseURI, "http://mochi.test:8888/tests/dom/base/",
      "body base");
 
   var expected =
-    ["http://mochi.test:8888/tests/dom/base/supercalifragilisticexpialidocious",
-     "http://mochi.test:8888/tests/dom/base/supercalifragilisticexpialidocious",
-     "http://mochi.test:8888/tests/dom/base/hello/",
-     "http://mochi.test:8888/tests/dom/base/hello/world",
-     "http://mochi.test:8888/tests/dom/base/hello/world#iamtheverymodelofamodernmajorgeneral",
-     "http://mochi.test:8888/tests/dom/base/hello/world#iamtheverymodelofamodernmajorgeneral",
+    ["http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
      ];
   var node = document.getElementById("1");
   while(node) {
     is(node.baseURI, expected.shift(), "node base");
     node = node.firstChild;
   }
   is(expected.length, 0, "found all expected nodes");
 
   var svgExpected =
-    ["http://mochi.test:8888/tests/dom/base/test/file_base_xbl.xml",
-     "http://mochi.test:8888/tests/dom/base/test/file_base_xbl.xml",
-     "http://mochi.test:8888/tests/dom/base/test/file_base_xbl.xml#shesellsseashellsbytheseashore",
+    ["http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
+     "http://mochi.test:8888/tests/dom/base/",
      ];
   node = SpecialPowers.wrap(document).getAnonymousNodes(document.getElementById("bound"))[0];
   while(node) {
     is(node.baseURI, svgExpected.shift(), "node base");
     node = node.firstChild;
   }
   is(svgExpected.length, 0, "found all expected nodes");
 
deleted file mode 100644
--- a/dom/base/test/test_bug505783.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=505783
--->
-<head>
-  <title>Test for Bug 505783</title>
-  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=505783">Mozilla Bug 505783</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 505783 **/
-
-var a = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
-a.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:base", "http://example.org/");
-a.href = "page";
-is(a.href, "http://example.org/page", "xml:base not used when not in doc");
-document.getElementById("content").appendChild(a);
-is(a.href, "http://example.org/page", "xml:base not used when in doc");
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/html/HTMLAnchorElement.cpp
+++ b/dom/html/HTMLAnchorElement.cpp
@@ -139,18 +139,18 @@ void
 HTMLAnchorElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
   // Cancel any DNS prefetches
   // Note: Must come before ResetLinkState.  If called after, it will recreate
   // mCachedURI based on data that is invalid - due to a call to GetHostname.
   CancelDNSPrefetch(HTML_ANCHOR_DNS_PREFETCH_DEFERRED,
                     HTML_ANCHOR_DNS_PREFETCH_REQUESTED);
 
-  // If this link is ever reinserted into a document, it might
-  // be under a different xml:base, so forget the cached state now.
+  // Without removing the link state we risk a dangling pointer
+  // in the mStyledLinks hashtable
   Link::ResetLinkState(false, Link::ElementHasHref());
 
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 static bool
 IsNodeInEditableRegion(nsINode* aNode)
 {
--- a/dom/html/HTMLAreaElement.cpp
+++ b/dom/html/HTMLAreaElement.cpp
@@ -104,18 +104,18 @@ HTMLAreaElement::BindToTree(nsIDocument*
     doc->RegisterPendingLinkUpdate(this);
   }
   return rv;
 }
 
 void
 HTMLAreaElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
-  // If this link is ever reinserted into a document, it might
-  // be under a different xml:base, so forget the cached state now.
+  // Without removing the link state we risk a dangling pointer
+  // in the mStyledLinks hashtable
   Link::ResetLinkState(false, Link::ElementHasHref());
 
   nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
 }
 
 nsresult
 HTMLAreaElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
                               const nsAttrValue* aValue,
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -170,18 +170,18 @@ HTMLLinkElement::UnbindFromTree(bool aDe
 {
   // Cancel any DNS prefetches
   // Note: Must come before ResetLinkState.  If called after, it will recreate
   // mCachedURI based on data that is invalid - due to a call to GetHostname.
   CancelDNSPrefetch(HTML_LINK_DNS_PREFETCH_DEFERRED,
                     HTML_LINK_DNS_PREFETCH_REQUESTED);
   CancelPrefetchOrPreload();
 
-  // If this link is ever reinserted into a document, it might
-  // be under a different xml:base, so forget the cached state now.
+  // Without removing the link state we risk a dangling pointer
+  // in the mStyledLinks hashtable
   Link::ResetLinkState(false, Link::ElementHasHref());
 
   // If this is reinserted back into the document it will not be
   // from the parser.
   nsIDocument* oldDoc = GetUncomposedDoc();
   ShadowRoot* oldShadowRoot = GetContainingShadow();
 
   if (oldDoc && this->AttrValueIs(kNameSpaceID_None, nsGkAtoms::rel, nsGkAtoms::localization, eIgnoreCase)) {
--- a/dom/html/test/test_bug481335.xhtml
+++ b/dom/html/test/test_bug481335.xhtml
@@ -5,44 +5,43 @@ https://bugzilla.mozilla.org/show_bug.cg
 <head>
   <title>Test for Bug 481335</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
   <style type="text/css">
     a { color:blue; }
     a:visited { color:red; }
   </style>
+  <base href="http://www.example.com/" />
 </head>
 <body>
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=481335">Mozilla Bug 481335</a>
 <p id="display">
   <a id="t">A link</a>
   <iframe id="i"></iframe>
 </p>
-<p id="newparent" xml:base="http://www.example.com/"></p>
+<p id="newparent"></p>
 <div id="content" style="display: none"></div>
 <pre id="test">
 <script type="application/javascript">
 <![CDATA[
 
 /** Test for Bug 481335 **/
 SimpleTest.waitForExplicitFinish();
 var rand = Date.now() + "-" + Math.random();
 
 is($("t").href, "",
    "Unexpected href before set");
 is($("t").href, "",
    "Unexpected cached href before set");
 
 $("t").setAttribute("href", rand);
-is($("t").href,
-   window.location.href.replace(/test_bug481335.xhtml([\?].*)?/, rand),
+is($("t").href, "http://www.example.com/" + rand,
    "Unexpected href after set");
-is($("t").href,
-   window.location.href.replace(/test_bug481335.xhtml([\?].*)?/, rand),
+is($("t").href, "http://www.example.com/" + rand,
    "Unexpected cached href after set");
 const unvisitedColor = "rgb(0, 0, 255)";
 const visitedColor = "rgb(255, 0, 0)";
 
 let tests = testIterator();
 function continueTest() {
   tests.next();
 }
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -312,18 +312,16 @@ LargeAllocationSuccess=This page was loa
 LargeAllocationNonGetRequest=A Large-Allocation header was ignored due to the load being triggered by a non-GET request.
 # LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name. Do not translate `window.opener`.
 LargeAllocationNotOnlyToplevelInTabGroup=A Large-Allocation header was ignored due to the presence of windows which have a reference to this browsing context through the frame hierarchy or window.opener.
 # LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name
 LargeAllocationNonE10S=A Large-Allocation header was ignored due to the document not being loaded out of process.
 GeolocationInsecureRequestIsForbidden=A Geolocation request can only be fulfilled in a secure context.
 # LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name.
 LargeAllocationNonWin32=This page would be loaded in a new process due to a Large-Allocation header, however Large-Allocation process creation is disabled on non-Win32 platforms.
-# LOCALIZATION NOTE: Do not translate xml:base.
-XMLBaseAttributeWarning=Use of xml:base attribute is deprecated and will be removed soon. Please remove any use of it.
 # LOCALIZATION NOTE: Do not translate "content", "Window", and "window.top"
 WindowContentUntrustedWarning=The ‘content’ attribute of Window objects is deprecated.  Please use ‘window.top’ instead.
 # LOCALIZATION NOTE: The first %S is the tag name of the element that starts the loop, the second %S is the element's ID.
 SVGRefLoopWarning=The SVG <%S> with ID “%S” has a reference loop.
 # LOCALIZATION NOTE: The first %S is the tag name of the element in the chain where the chain was broken, the second %S is the element's ID.
 SVGRefChainLengthExceededWarning=An SVG <%S> reference chain which is too long was abandoned at the element with ID “%S”.
 # LOCALIZATION NOTE: Do not translate "<script>".
 ScriptSourceEmpty=‘%S’ attribute of <script> element is empty.
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -110,18 +110,18 @@ nsMathMLElement::BindToTree(nsIDocument*
   }
 
   return rv;
 }
 
 void
 nsMathMLElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
-  // If this link is ever reinserted into a document, it might
-  // be under a different xml:base, so forget the cached state now.
+  // Without removing the link state we risk a dangling pointer
+  // in the mStyledLinks hashtable
   Link::ResetLinkState(false, Link::ElementHasHref());
 
   nsMathMLElementBase::UnbindFromTree(aDeep, aNullParent);
 }
 
 bool
 nsMathMLElement::ParseAttribute(int32_t aNamespaceID,
                                 nsAtom* aAttribute,
--- a/dom/svg/SVGAElement.cpp
+++ b/dom/svg/SVGAElement.cpp
@@ -226,18 +226,18 @@ SVGAElement::BindToTree(nsIDocument *aDo
   }
 
   return NS_OK;
 }
 
 void
 SVGAElement::UnbindFromTree(bool aDeep, bool aNullParent)
 {
-  // If this link is ever reinserted into a document, it might
-  // be under a different xml:base, so forget the cached state now.
+  // Without removing the link state we risk a dangling pointer
+  // in the mStyledLinks hashtable
   Link::ResetLinkState(false, Link::ElementHasHref());
 
   SVGAElementBase::UnbindFromTree(aDeep, aNullParent);
 }
 
 already_AddRefed<nsIURI>
 SVGAElement::GetHrefURI() const
 {
--- a/dom/xhr/tests/test_XHRDocURI.html
+++ b/dom/xhr/tests/test_XHRDocURI.html
@@ -33,31 +33,25 @@ function startTest() {
     gen = runTest();
     gen.next();
   });
 }
 
 function testXMLDocURI(aDoc, aExpects) {
   is(aDoc.documentURI, aExpects.documentURI, "wrong url");
   is(aDoc.baseURI, aExpects.baseURI, "wrong base");
-  is(aDoc.documentElement.baseURI, aExpects.elementBaseURI,
-     "wrong base (xml:base)");
 }
 
 function testChromeXMLDocURI(aDoc, aExpects) {
   is(aDoc.documentURI, aExpects.documentURI, "wrong url");
   is(aDoc.documentURIObject.spec, aExpects.documentURI,
      "wrong url (.documentObjectURI)");
   is(aDoc.baseURI, aExpects.baseURI, "wrong base");
   is(aDoc.baseURIObject.spec, aExpects.baseURI,
      "wrong base (.baseURIObject)");
-  is(aDoc.documentElement.baseURI, aExpects.elementBaseURI,
-     "wrong base (xml:base)");
-  is(aDoc.documentElement.baseURIObject.spec, aExpects.elementBaseURI,
-     "wrong base (.baseURIObject, xml:base)");
 }
 
 function testHTMLDocURI(aDoc, aExpects) {
   is(aDoc.documentURI, aExpects.documentURI, "wrong url");
   is(aDoc.baseURI, aExpects.baseURI, "wrong base");
 
   var base = aDoc.createElement("base");
   var newBaseURI = "http://www.example.com/";
@@ -69,28 +63,16 @@ function testHTMLDocURI(aDoc, aExpects) 
 function testChromeHTMLDocURI(aDoc, aNonChromeBaseURI, aExpects) {
   is(aDoc.documentURI, aExpects.documentURI, "wrong url");
   is(aDoc.documentURIObject.spec, aExpects.documentURI,
      "wrong url (.documentURIObject)");
   is(aDoc.baseURI, aExpects.baseURI, "wrong base");
   is(aDoc.baseURIObject.spec, aExpects.baseURI,
      "wrong url (.baseURIObject)");
 
-  aDoc.body.setAttributeNS("http://www.w3.org/XML/1998/namespace", "base",
-                           aNonChromeBaseURI);
-  is(aDoc.body.baseURI, aNonChromeBaseURI,
-     "wrong base (doc base and xml:base are same)");
-  is(aDoc.body.baseURIObject.spec, aNonChromeBaseURI,
-     "wrong base (.baseURIObject, doc base and xml:base are same)")
-  var attr = aDoc.getElementById("data").getAttributeNode("id");
-  is(attr.baseURI, aNonChromeBaseURI,
-     "wrong attr base (doc base and xml:base are same)")
-  is(attr.baseURIObject.spec, aNonChromeBaseURI,
-     "wrong attr base (.baseURIObject, doc base and xml:base are same)")
-
   var base = aDoc.createElement("base");
   var newBaseURI = "http://www.example.com/";
   base.href = newBaseURI;
   aDoc.head.appendChild(base);
   is(aDoc.baseURI, newBaseURI, "wrong base (after <base> changed)");
   is(aDoc.baseURIObject.spec, newBaseURI,
      "wrong base (.baseURIObject, after <base> changed)");
 }
--- a/dom/xslt/xslt/txStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txStylesheetCompiler.cpp
@@ -205,28 +205,16 @@ txStylesheetCompiler::startElementIntern
             else if (TX_StringEqualsAtom(attr->mValue, nsGkAtoms::_default)) {
                 mElementContext->mPreserveWhitespace = false;
             }
             else {
                 return NS_ERROR_XSLT_PARSE_FAILURE;
             }
         }
 
-        // xml:base
-        if (attr->mNamespaceID == kNameSpaceID_XML &&
-            attr->mLocalName == nsGkAtoms::base &&
-            !attr->mValue.IsEmpty()) {
-            rv = ensureNewElementContext();
-            NS_ENSURE_SUCCESS(rv, rv);
-
-            nsAutoString uri;
-            URIUtils::resolveHref(attr->mValue, mElementContext->mBaseURI, uri);
-            mElementContext->mBaseURI = uri;
-        }
-
         // extension-element-prefixes
         if ((attr->mNamespaceID == kNameSpaceID_XSLT &&
              attr->mLocalName == nsGkAtoms::extensionElementPrefixes &&
              aNamespaceID != kNameSpaceID_XSLT) ||
             (attr->mNamespaceID == kNameSpaceID_None &&
              attr->mLocalName == nsGkAtoms::extensionElementPrefixes &&
              aNamespaceID == kNameSpaceID_XSLT &&
              (aLocalName == nsGkAtoms::stylesheet ||