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

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: 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
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..2cfa2c2b46e2a8fd6c63167353f032a9f49ed41e 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,36 @@ 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
kouhei (in TOK) 2017/02/13 21:31:09 Should we // "Initially, script elements must have
hiroshige 2017/02/13 21:46:53 Done. Applied the same to other flags and modifies
+ bool m_alreadyStarted;
+
+ // https://html.spec.whatwg.org/#parser-inserted
+ bool m_parserInserted;
+
+ // https://html.spec.whatwg.org/#non-blocking
+ bool m_nonBlocking;
hiroshige 2017/02/13 21:17:25 Renamed from m_forceAsync.
+
+ // 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".
hiroshige 2017/02/13 21:17:25 I'm not sure whether we'll implement the script ty
kouhei (in TOK) 2017/02/13 21:31:09 sgtm
+
+ // https://html.spec.whatwg.org/#concept-script-external
+ bool m_isExternalScript;
+
+ 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 {

Powered by Google App Engine
This is Rietveld 408576698