Commit 939af248 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Rename CheckIfBodyStylesheetAdded to reflect intent.

The method checks if the parser should be paused when a parser blocking
stylesheet is added. That is currently for sheets in body, but that is
not the only case with BlockHTMLParserOnStyleSheets enabled.

Bug: 891767
Change-Id: I9597ed2072ad18ba4552b4b6bc98cca8b85c8e68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2023788Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735827}
parent f4e19f78
......@@ -265,7 +265,7 @@ bool HTMLDocumentParser::IsParsingFragment() const {
}
void HTMLDocumentParser::PumpTokenizerIfPossible() {
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
if (IsStopped() || IsPaused())
return;
......@@ -281,7 +281,7 @@ void HTMLDocumentParser::ResumeParsingAfterYield() {
DCHECK(ShouldUseThreading());
DCHECK(have_background_parser_);
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
if (IsStopped() || IsPaused())
return;
......@@ -297,7 +297,7 @@ void HTMLDocumentParser::RunScriptsForPausedTreeBuilder() {
// We will not have a scriptRunner when parsing a DocumentFragment.
if (script_runner_)
script_runner_->ProcessScriptElement(script_element, script_start_position);
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
}
bool HTMLDocumentParser::CanTakeNextToken() {
......@@ -597,7 +597,7 @@ void HTMLDocumentParser::PumpPendingSpeculations() {
// IsScheduledForUnpause() may be set here as a result of
// ProcessTokenizedChunkFromBackgroundParser running arbitrary javascript
// which invokes nested event loops. (e.g. inspector breakpoints)
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
if (!IsParsing() || IsPaused() || IsScheduledForUnpause())
break;
......@@ -689,7 +689,7 @@ void HTMLDocumentParser::ConstructTreeFromHTMLToken() {
Token().Clear();
tree_builder_->ConstructTree(&atomic_token);
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
// FIXME: ConstructTree may synchronously cause Document to be detached.
if (!token_)
......@@ -706,7 +706,7 @@ void HTMLDocumentParser::ConstructTreeFromCompactHTMLToken(
DCHECK(!GetDocument()->IsPrefetchOnly());
AtomicHTMLToken token(compact_token);
tree_builder_->ConstructTree(&token);
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
}
bool HTMLDocumentParser::HasInsertionPoint() {
......@@ -1002,7 +1002,7 @@ void HTMLDocumentParser::ResumeParsingAfterPause() {
DCHECK(!IsExecutingScript());
DCHECK(!IsPaused());
CheckIfBodyStylesheetAdded();
CheckIfBlockingStylesheetAdded();
if (IsStopped() || IsPaused())
return;
......@@ -1091,7 +1091,7 @@ void HTMLDocumentParser::DidLoadAllPendingParserBlockingStylesheets() {
added_pending_parser_blocking_stylesheet_ = false;
}
void HTMLDocumentParser::CheckIfBodyStylesheetAdded() {
void HTMLDocumentParser::CheckIfBlockingStylesheetAdded() {
if (added_pending_parser_blocking_stylesheet_) {
added_pending_parser_blocking_stylesheet_ = false;
is_waiting_for_stylesheets_ = true;
......
......@@ -155,7 +155,7 @@ class CORE_EXPORT HTMLDocumentParser : public ScriptableDocumentParser,
void ExecuteScriptsWaitingForResources() final;
void DidAddPendingParserBlockingStylesheet() final;
void DidLoadAllPendingParserBlockingStylesheets() final;
void CheckIfBodyStylesheetAdded();
void CheckIfBlockingStylesheetAdded();
void DocumentElementAvailable() override;
// HTMLParserScriptRunnerHost
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment