Bug 256180 parser part - Insert elements as siblings instead of children at the Blink-defined magic depth for compatibility. r=smaug

MozReview-Commit-ID: K8fgv3rgklt
This commit is contained in:
Henri Sivonen
2017-09-12 16:57:05 +03:00
parent cd6d40a679
commit d2c77a8997
19 changed files with 6405 additions and 208 deletions

View File

@@ -65,12 +65,13 @@ nsHtml5TreeOpExecutor::nsHtml5TreeOpExecutor()
, mSuppressEOF(false)
, mReadingFromStage(false)
, mStreamParser(nullptr)
, mPreloadedURLs(23) // Mean # of preloadable resources per page on dmoz
, mPreloadedURLs(23) // Mean # of preloadable resources per page on dmoz
, mSpeculationReferrerPolicy(mozilla::net::RP_Unset)
, mStarted(false)
, mRunFlushLoopOnStack(false)
, mCallContinueInterruptedParsingIfEnabled(false)
, mAlreadyComplainedAboutCharset(false)
, mAlreadyComplainedAboutDeepTree(false)
{
}
@@ -815,6 +816,25 @@ nsHtml5TreeOpExecutor::ComplainAboutBogusProtocolCharset(nsIDocument* aDoc)
"EncProtocolUnsupported");
}
void
nsHtml5TreeOpExecutor::MaybeComplainAboutDeepTree(uint32_t aLineNumber)
{
if (mAlreadyComplainedAboutDeepTree) {
return;
}
mAlreadyComplainedAboutDeepTree = true;
nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
NS_LITERAL_CSTRING("HTML parser"),
mDocument,
nsContentUtils::eHTMLPARSER_PROPERTIES,
"errDeepTree",
nullptr,
0,
nullptr,
EmptyString(),
aLineNumber);
}
nsHtml5Parser*
nsHtml5TreeOpExecutor::GetParser()
{