Bug 464222 - Get relative links to resolve in parser view selection source processing. r=hsivonen
authorJames Kitchener <jkitch.bug@gmail.com>
Thu, 20 Feb 2014 08:43:53 -0500
changeset 169682 08ed6226573d05aba4148a9359cca20c3a8e32e4
parent 169681 af8283de5112a6505a7999a50bc081b0df71a0e3
child 169683 3ad497d0c250107285f2032000524a8afcbea7b8
push id26263
push userryanvm@gmail.com
push dateThu, 20 Feb 2014 20:12:54 +0000
treeherdermozilla-central@b89a9d7b4ca0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs464222
milestone30.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 464222 - Get relative links to resolve in parser view selection source processing. r=hsivonen
parser/html/nsHtml5TreeOpExecutor.cpp
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -927,31 +927,25 @@ nsHtml5TreeOpExecutor::InitializeDocWrit
   GetParser()->InitializeDocWriteParserState(aState, aLine);
 }
 
 nsIURI*
 nsHtml5TreeOpExecutor::GetViewSourceBaseURI()
 {
   if (!mViewSourceBaseURI) {
 
-    // We query the channel for the baseURI of srcdoc view-source loads as it
-    // cannot be otherwise determined.  If any step in this process fails, fall
-    // back to the standard method.
+    // We query the channel for the baseURI because in certain situations it
+    // cannot otherwise be determined. If this process fails, fall back to the
+    // standard method.
     nsCOMPtr<nsIViewSourceChannel> vsc;
     vsc = do_QueryInterface(mDocument->GetChannel());
     if (vsc) {
-      bool isSrcdocChannel;
-      // Note that the channel is a srcdoc channel, but mDocument is not a
-      // srcdoc document.
-      nsresult rv = vsc->GetIsSrcdocChannel(&isSrcdocChannel);
-      if (NS_SUCCEEDED(rv) && isSrcdocChannel) {
-        rv =  vsc->GetBaseURI(getter_AddRefs(mViewSourceBaseURI));
-        if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) {
-          return mViewSourceBaseURI;
-        }
+      nsresult rv =  vsc->GetBaseURI(getter_AddRefs(mViewSourceBaseURI));
+      if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) {
+        return mViewSourceBaseURI;
       }
     }
 
     nsCOMPtr<nsIURI> orig = mDocument->GetOriginalURI();
     bool isViewSource;
     orig->SchemeIs("view-source", &isViewSource);
     if (isViewSource) {
       nsCOMPtr<nsINestedURI> nested = do_QueryInterface(orig);