mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 971432 - parser changes needed after moving baseURI to nsILoadInfo. r=hsivonen
This commit is contained in:
parent
a7839118a6
commit
e79b9abb16
@ -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<nsIViewSourceChannel> vsc;
|
||||
vsc = do_QueryInterface(mDocument->GetChannel());
|
||||
if (vsc) {
|
||||
nsresult rv = vsc->GetBaseURI(getter_AddRefs(mViewSourceBaseURI));
|
||||
if (NS_SUCCEEDED(rv) && mViewSourceBaseURI) {
|
||||
return mViewSourceBaseURI;
|
||||
nsCOMPtr<nsIChannel> channel = mDocument->GetChannel();
|
||||
if (channel) {
|
||||
nsCOMPtr<nsILoadInfo> 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user