Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.h

Issue 2696653004: [Script Spec Annotation] Annotate and refactor script element's flags (Closed)
Patch Set: More refactor Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.h
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h
index 3935fe1c45d2b4e3e52cf36dc873e24efa01f0e7..c3d5416d4c05b2e9a761e263910a737cfac60c1c 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -91,7 +91,7 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
}
bool isParserInserted() const { return m_parserInserted; }
bool alreadyStarted() const { return m_alreadyStarted; }
- bool forceAsync() const { return m_forceAsync; }
+ bool isNonBlocking() const { return m_nonBlocking; }
// Helper functions used by our parent classes.
void didNotifySubtreeInsertionsToDocument();
@@ -142,16 +142,40 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
Member<ScriptResource> m_resource;
WTF::OrdinalNumber m_startLineNumber;
- bool m_parserInserted : 1;
- bool m_isExternalScript : 1;
- bool m_alreadyStarted : 1;
- bool m_haveFiredLoad : 1;
+ // https://html.spec.whatwg.org/#script-processing-model
+ // "A script element has several associated pieces of state.":
+
+ // https://html.spec.whatwg.org/#already-started
+ // "Initially, script elements must have this flag unset"
+ bool m_alreadyStarted = false;
+
+ // https://html.spec.whatwg.org/#parser-inserted
+ // "Initially, script elements must have this flag unset."
+ bool m_parserInserted = false;
+
+ // https://html.spec.whatwg.org/#non-blocking
+ // "Initially, script elements must have this flag set."
+ bool m_nonBlocking = true;
+
+ // https://html.spec.whatwg.org/#ready-to-be-parser-executed
+ // "Initially, script elements must have this flag unset"
+ bool m_readyToBeParserExecuted = false;
+
+ // https://html.spec.whatwg.org/#concept-script-type
+ // TODO(hiroshige): Implement "script's type".
+
+ // https://html.spec.whatwg.org/#concept-script-external
+ // "It is determined when the script is prepared"
+ bool m_isExternalScript = false;
+
+ bool m_haveFiredLoad;
+
// Same as "The parser will handle executing the script."
- bool m_willBeParserExecuted : 1;
- bool m_readyToBeParserExecuted : 1;
- bool m_willExecuteWhenDocumentFinishedParsing : 1;
- bool m_forceAsync : 1;
- const bool m_createdDuringDocumentWrite : 1;
+ bool m_willBeParserExecuted;
+
+ bool m_willExecuteWhenDocumentFinishedParsing;
+
+ const bool m_createdDuringDocumentWrite;
ScriptRunner::AsyncExecutionType m_asyncExecType;
enum DocumentWriteIntervention {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698