mirror of
http://git.mos6581.com/ManchildProductions/Male-Poon.git
synced 2026-07-21 03:48:28 +00:00
Bug 802895 - Parser changes to support srcdoc attributes for iframes (Part 8)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "nsINestedURI.h"
|
||||
#include "nsCharsetSource.h"
|
||||
#include "nsIWyciwygChannel.h"
|
||||
#include "nsIInputStreamChannel.h"
|
||||
|
||||
#include "mozilla/dom/EncodingUtils.h"
|
||||
|
||||
@@ -877,6 +878,7 @@ nsHtml5StreamParser::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
|
||||
bool scriptingEnabled = mMode == LOAD_AS_DATA ?
|
||||
false : mExecutor->IsScriptEnabled();
|
||||
mOwner->StartTokenizer(scriptingEnabled);
|
||||
mTreeBuilder->setIsSrcdocDocument(IsSrcdocDocument());
|
||||
mTreeBuilder->setScriptingEnabled(scriptingEnabled);
|
||||
mTreeBuilder->SetPreventScriptExecution(!((mMode == NORMAL) &&
|
||||
scriptingEnabled));
|
||||
@@ -1616,3 +1618,20 @@ nsHtml5StreamParser::MarkAsBroken(nsresult aRv)
|
||||
NS_WARNING("failed to dispatch executor flush event");
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsHtml5StreamParser::IsSrcdocDocument()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
bool isSrcdoc = false;
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
rv = GetChannel(getter_AddRefs(channel));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIInputStreamChannel> isr = do_QueryInterface(channel);
|
||||
if (isr) {
|
||||
isr->GetIsSrcdocChannel(&isSrcdoc);
|
||||
}
|
||||
}
|
||||
return isSrcdoc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user