From 5614b975f19fe51155820db2f1c1e565fd0f84a8 Mon Sep 17 00:00:00 2001 From: James Kitchener Date: Fri, 24 Oct 2014 20:39:00 +0200 Subject: [PATCH] Bug 971432 - parser changes needed after moving baseURI to nsILoadInfo. r=hsivonen --- parser/html/nsHtml5TreeOpExecutor.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/parser/html/nsHtml5TreeOpExecutor.cpp b/parser/html/nsHtml5TreeOpExecutor.cpp index 235effc2666..fef3c4987b6 100644 --- a/parser/html/nsHtml5TreeOpExecutor.cpp +++ b/parser/html/nsHtml5TreeOpExecutor.cpp @@ -29,6 +29,7 @@ #include "nsIScriptContext.h" #include "mozilla/Preferences.h" #include "nsIHTMLDocument.h" +#include "nsILoadInfo.h" using namespace mozilla; @@ -797,12 +798,15 @@ nsHtml5TreeOpExecutor::GetViewSourceBaseURI() // 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 vsc; - vsc = do_QueryInterface(mDocument->GetChannel()); - if (vsc) { - nsresult rv = vsc->GetBaseURI(getter_AddRefs(mViewSourceBaseURI)); - if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) { - return mViewSourceBaseURI; + nsCOMPtr channel = mDocument->GetChannel(); + if (channel) { + nsCOMPtr loadInfo; + nsresult rv = channel->GetLoadInfo(getter_AddRefs(loadInfo)); + if (NS_SUCCEEDED(rv) && loadInfo) { + rv = loadInfo->GetBaseURI(getter_AddRefs(mViewSourceBaseURI)); + if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) { + return mViewSourceBaseURI; + } } }