Spec: https://html.spec.whatwg.org/
Wasn't +jbroman looking at this recently?
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7a12f25e6aac98ef911351297135cc7f02996621 commit 7a12f25e6aac98ef911351297135cc7f02996621 Author: hiroshige <hiroshige@chromium.org> Date: Sat Jan 28 04:42:14 2017 Make |ScriptLoader::m_characterEncoding| a local variable In the spec, |encoding| is a local variable of "prepare a script". This doesn't change behavior. This CL also removes |ScriptLoader::m_fallbackCharacterEncoding| that is not used at all. Spec: https://html.spec.whatwg.org/#prepare-a-script BUG=686281 Review-Url: https://codereview.chromium.org/2665503002 Cr-Commit-Position: refs/heads/master@{#446908} [modify] https://crrev.com/7a12f25e6aac98ef911351297135cc7f02996621/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/7a12f25e6aac98ef911351297135cc7f02996621/third_party/WebKit/Source/core/dom/ScriptLoader.h
#1: I've touched ScriptLoader recently, but not for this reason. (In fact, I might end up causing less direct correspondence to the spec in places.)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f4d659e887283a9cf544f917cf82a5abde22aa7b commit f4d659e887283a9cf544f917cf82a5abde22aa7b Author: hiroshige <hiroshige@chromium.org> Date: Tue Feb 14 02:24:34 2017 [Script Spec Annotation] Annotate and refactor script element's flags This CL annotates some flags of ScriptLoader that correspond directly to the spec (https://html.spec.whatwg.org/#script-processing-model), and refactors related code to improve the correspondence to the spec. This CL also - Modifies ScriptLoader constructor to match its flag setting code with the spec, - Reorders the flags to match the order in the spec, - Renames |m_forceAsnyc| to |m_nonBlocking| according to the spec, and - Turn bitfields into normal bools to allow in-class initializers. BUG=686281 Review-Url: https://codereview.chromium.org/2696653004 Cr-Commit-Position: refs/heads/master@{#450203} [modify] https://crrev.com/f4d659e887283a9cf544f917cf82a5abde22aa7b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/f4d659e887283a9cf544f917cf82a5abde22aa7b/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/f4d659e887283a9cf544f917cf82a5abde22aa7b/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d07584db64b31ca46f90b54b8cb65948d6dbc768 commit d07584db64b31ca46f90b54b8cb65948d6dbc768 Author: hiroshige <hiroshige@chromium.org> Date: Tue Feb 14 04:16:10 2017 [Script Spec Annotation] Annotate "prepare a script" https://html.spec.whatwg.org/#prepare-a-script BUG=686281 Review-Url: https://codereview.chromium.org/2690273002 Cr-Commit-Position: refs/heads/master@{#450240} [modify] https://crrev.com/d07584db64b31ca46f90b54b8cb65948d6dbc768/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/d07584db64b31ca46f90b54b8cb65948d6dbc768/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/d07584db64b31ca46f90b54b8cb65948d6dbc768/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/977fe146bd6777af01d8de34cbaab350b53d62f3 commit 977fe146bd6777af01d8de34cbaab350b53d62f3 Author: hiroshige <hiroshige@chromium.org> Date: Tue Feb 14 06:15:14 2017 [Script Spec Annotation] Annotate Steps 15--20 and 22 of "prepare a script" BUG=686281 Review-Url: https://codereview.chromium.org/2691123003 Cr-Commit-Position: refs/heads/master@{#450277} [modify] https://crrev.com/977fe146bd6777af01d8de34cbaab350b53d62f3/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a2920d6de4edbf12a55e81345b5911849a7cebb6 commit a2920d6de4edbf12a55e81345b5911849a7cebb6 Author: hiroshige <hiroshige@chromium.org> Date: Tue Feb 21 18:27:36 2017 [Script Spec Annotation] Annotate HTMLParserScriptRunner https://html.spec.whatwg.org/#the-end https://html.spec.whatwg.org/#scriptEndTag BUG=686281 Review-Url: https://codereview.chromium.org/2699713002 Cr-Commit-Position: refs/heads/master@{#451803} [modify] https://crrev.com/a2920d6de4edbf12a55e81345b5911849a7cebb6/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/a2920d6de4edbf12a55e81345b5911849a7cebb6/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/85a1f107f95bc55f75992f52d61343cd51f1aa53 commit 85a1f107f95bc55f75992f52d61343cd51f1aa53 Author: hiroshige <hiroshige@chromium.org> Date: Wed Feb 22 07:29:49 2017 Do not re-initialize PendingScript in HTMLParserScriptRunner Previously, |HTMLParserScriptRunner::m_parserBlockingScript| was re-initialized every time it processes a new script tag (i.e. a new ScriptLoader), and therefore one PendingScript can be reused for multiple ScriptLoaders. This CL makes |m_parserBlockingScript| to be newly created rather than re-initialized with the same object. This clarifies that a PendingScript corresponds to a ScriptLoader, and also enables creating ModulePendingScript in a cleaner way in https://codereview.chromium.org/2653923008/. BUG=686281 Review-Url: https://codereview.chromium.org/2693423002 Cr-Commit-Position: refs/heads/master@{#451911} [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/85a1f107f95bc55f75992f52d61343cd51f1aa53/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/48b7863dbfda443885ee2cf2d2c22c3d422fb51d commit 48b7863dbfda443885ee2cf2d2c22c3d422fb51d Author: hiroshige <hiroshige@chromium.org> Date: Wed Feb 22 09:29:30 2017 Refactor SRI check in PendingScript::notifyFinished() Follow-up of https://codereview.chromium.org/2693423002/diff/20001/third_party/WebKit/Source/core/dom/PendingScript.cpp#newcode144. BUG=686281 Review-Url: https://codereview.chromium.org/2698613007 Cr-Commit-Position: refs/heads/master@{#451955} [modify] https://crrev.com/48b7863dbfda443885ee2cf2d2c22c3d422fb51d/third_party/WebKit/Source/core/dom/PendingScript.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e359f31a6ca4013fcf2668ad3e5a1c53ae217983 commit e359f31a6ca4013fcf2668ad3e5a1c53ae217983 Author: hiroshige <hiroshige@chromium.org> Date: Wed Feb 22 10:50:31 2017 Assert that |resource| is always non-null in requestPendingScript() BUG=686281 Review-Url: https://codereview.chromium.org/2692863013 Cr-Commit-Position: refs/heads/master@{#451986} [modify] https://crrev.com/e359f31a6ca4013fcf2668ad3e5a1c53ae217983/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/edef4982396f33e6038ba37df5f200921bc63f79 commit edef4982396f33e6038ba37df5f200921bc63f79 Author: hiroshige <hiroshige@chromium.org> Date: Thu Feb 23 16:32:56 2017 Check that PendingScript::m_streamer is always null when resource() is null PendingScript::errorOccurred() is written as if |m_streamer| can be non-null even when resource() is null. However, |m_streamer| can be (and should be) set to non-null only if resource() is non-null, and resource() is not cleared unless PendingScript::dispose()d. This CL adds checkState() that asserts |m_streamer| is never non-null when resource() is null, and rewrites PendingScript::errorOccurred() and PendingScript::isReady() based on this assumption, and now these methods are clearly splitted into non-inline and inline script cases. This CL also adds other assertions to hold and more checkState() calls. BUG=686281 Review-Url: https://codereview.chromium.org/2706243006 Cr-Commit-Position: refs/heads/master@{#452515} [modify] https://crrev.com/edef4982396f33e6038ba37df5f200921bc63f79/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/edef4982396f33e6038ba37df5f200921bc63f79/third_party/WebKit/Source/core/dom/PendingScript.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ac80ac8e76ab5e54af045fe844ebbef4c7e1c325 commit ac80ac8e76ab5e54af045fe844ebbef4c7e1c325 Author: hiroshige <hiroshige@chromium.org> Date: Thu Feb 23 16:47:30 2017 Fix PendingScript::errorOccurred() to be consistent with getSource() Previously, PendingScript::errorOccurred() didn't take |m_integrityFailure| into consideration while getSource()'s |errorOccurred| did. This CL merges these two implementations and thus makes PendingScript::errorOccurred() to take |m_integrityFailure| into consideration. BUG=686281 Review-Url: https://codereview.chromium.org/2716543002 Cr-Commit-Position: refs/heads/master@{#452518} [modify] https://crrev.com/ac80ac8e76ab5e54af045fe844ebbef4c7e1c325/third_party/WebKit/Source/core/dom/PendingScript.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/641c52c72d465295087d9a937dab9dea7333aecb commit 641c52c72d465295087d9a937dab9dea7333aecb Author: sigbjornf <sigbjornf@opera.com> Date: Thu Feb 23 20:51:19 2017 Tidy ScriptRunner pending script handling. R=hiroshige BUG=686281 Review-Url: https://codereview.chromium.org/2710233002 Cr-Commit-Position: refs/heads/master@{#452619} [modify] https://crrev.com/641c52c72d465295087d9a937dab9dea7333aecb/third_party/WebKit/Source/core/dom/ScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bb1b87fb08ec4407a2cf1cdcf6d9e400e253e578 commit bb1b87fb08ec4407a2cf1cdcf6d9e400e253e578 Author: hiroshige <hiroshige@chromium.org> Date: Sat Feb 25 03:11:58 2017 Use ScriptLoader::errorOccurred() instead of Resource in ScriptLoader https://codereview.chromium.org/2716543002/ made ScriptLoader::errorOccurred() and PendingScript::errorOccurred() inconsistent and thus causes the following issue: If the integrity check fails for a script that falls into 3rd Clause of Step 23 of "prepare a script", then notifyScriptReady() is called because Resource::errorOccurred() is false, but execution of the script and the subsequent scripts are blocked forever by ScriptRunner::scheduleReadyInOrderScripts() because ScriptLoader::errorOccurred() is true. This CL fixes it and add a layout test for this case. BUG=686281 Review-Url: https://codereview.chromium.org/2715533007 Cr-Commit-Position: refs/heads/master@{#453056} [modify] https://crrev.com/bb1b87fb08ec4407a2cf1cdcf6d9e400e253e578/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-script-cors-bad-integrity.html [modify] https://crrev.com/bb1b87fb08ec4407a2cf1cdcf6d9e400e253e578/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a08766e7f8ec19cc09341d18b91107377ccfbcd6 commit a08766e7f8ec19cc09341d18b91107377ccfbcd6 Author: hiroshige <hiroshige@chromium.org> Date: Tue Feb 28 10:28:05 2017 Clear pointers to PendingScript when dispose()d in pendingScriptFinished() In HTMLParserScriptRunner, |pendingScript| is dispose()d but the corresponding pointer to it is not cleared and thus causing the use of PendingScript that is already dispose()d, causing CHECK() failure in PendingScript::element(). There can be two cases, where (1) |pendingScript| is |m_parserBlockingScript| (Clusterfuzz found a test case at Issue 695730 ), or (2) |pendingScript| is |m_scriptsToExecuteAfterParsing.first()| (no test case found so far). This CL fixes these cases by clearing |m_parserBlockingScript| or removing |m_scriptsToExecuteAfterParsing.first()|. This CL also adds CHECK(false) for (2), which should be removed shortly, hoping clusterfuzz find a test case for (2). This is a regression since https://codereview.chromium.org/2693423002. Before that, when |m_parserBlockingScript| was already disposed, then it was considered as not having a parser blocking script, and thus calling PendingScript::dispose() was sufficient. BUG= 695730 , 696775, 686281 Review-Url: https://codereview.chromium.org/2720683003 Cr-Commit-Position: refs/heads/master@{#453564} [modify] https://crrev.com/a08766e7f8ec19cc09341d18b91107377ccfbcd6/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1e806b1e34b10601573dc18d6ebfafd40651d40f commit 1e806b1e34b10601573dc18d6ebfafd40651d40f Author: hiroshige <hiroshige@chromium.org> Date: Wed Mar 01 18:52:59 2017 Remove default arguments from V8ScriptRunner::compileScript()s No callsites use the default arguments except for those in unit tests. BUG=686281 Review-Url: https://codereview.chromium.org/2726723002 Cr-Commit-Position: refs/heads/master@{#453983} [modify] https://crrev.com/1e806b1e34b10601573dc18d6ebfafd40651d40f/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/1e806b1e34b10601573dc18d6ebfafd40651d40f/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ab145489a36b45789323b50bcaceab843423ec06 commit ab145489a36b45789323b50bcaceab843423ec06 Author: hiroshige <hiroshige@chromium.org> Date: Thu Apr 06 04:24:15 2017 Introduce PendingScript::startStreamingIfPossible() This is preparation for introducing ModulePendingScript. As TaskType::Networking uses the loading task runner in the back, this CL shouldn't change any behavior. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2800683005 Cr-Commit-Position: refs/heads/master@{#462353} [modify] https://crrev.com/ab145489a36b45789323b50bcaceab843423ec06/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/ab145489a36b45789323b50bcaceab843423ec06/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/ab145489a36b45789323b50bcaceab843423ec06/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/ab145489a36b45789323b50bcaceab843423ec06/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/875e8893e9a463c771b63ef6d76e2bf98519e553 commit 875e8893e9a463c771b63ef6d76e2bf98519e553 Author: hiroshige <hiroshige@chromium.org> Date: Thu Apr 06 04:53:38 2017 Assume Resource is always non-null in external classic script BUG=686281 Review-Url: https://codereview.chromium.org/2800923002 Cr-Commit-Position: refs/heads/master@{#462360} [modify] https://crrev.com/875e8893e9a463c771b63ef6d76e2bf98519e553/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/38295e6a25c1394264de81fedcde29659d03f632 commit 38295e6a25c1394264de81fedcde29659d03f632 Author: hiroshige <hiroshige@chromium.org> Date: Fri Apr 07 06:18:17 2017 Move isLegacySupportedJavaScriptLanguage() to MIMETypeRegistry This is preparation for https://codereview.chromium.org/2780463002/ that moves callers of isLegacySupportedJavaScriptLanguage() to outside ScriptLoader. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2806523002 Cr-Commit-Position: refs/heads/master@{#462792} [modify] https://crrev.com/38295e6a25c1394264de81fedcde29659d03f632/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/38295e6a25c1394264de81fedcde29659d03f632/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.cpp [modify] https://crrev.com/38295e6a25c1394264de81fedcde29659d03f632/third_party/WebKit/Source/platform/network/mime/MIMETypeRegistry.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf commit ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf Author: hiroshige <hiroshige@chromium.org> Date: Tue Apr 11 15:48:55 2017 Rename ScriptResource/WorkerScriptLoader::Script() to SourceText() To avoid naming conflict between Script() and a new class Script that will be introduced by https://codereview.chromium.org/2780463002/. BUG=686281 Review-Url: https://codereview.chromium.org/2807343002 Cr-Commit-Position: refs/heads/master@{#463641} [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/loader/resource/ScriptResource.h [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/workers/InProcessWorkerBase.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp [modify] https://crrev.com/ffc3b8b65470e1a2fe1e27e7f3e75227a46ddddf/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e93942b9e38b017648e248b79f60bbaceb5809d commit 2e93942b9e38b017648e248b79f60bbaceb5809d Author: hiroshige <hiroshige@chromium.org> Date: Tue Apr 11 16:21:16 2017 Rename LocalFrame::Script() to GetScriptController() To avoid naming conflict between Script() and a new class Script that will be introduced by https://codereview.chromium.org/2780463002/. BUG=686281 Review-Url: https://codereview.chromium.org/2811793005 Cr-Commit-Position: refs/heads/master@{#463650} [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/dom/Document.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/dom/StyleElement.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/events/EventTargetTest.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/frame/DOMTimerTest.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/frame/LocalFrame.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/frame/LocalFrame.h [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/html/HTMLDocument.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/html/HTMLFormElement.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/html/HTMLFrameElementBase.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/loader/FrameLoader.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/loader/ImageLoader.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/page/Page.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/core/xml/DocumentXMLTreeViewer.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/InspectorOverlay.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/WebDevToolsFrontendImpl.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/tests/ActivityLoggerTest.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp [modify] https://crrev.com/2e93942b9e38b017648e248b79f60bbaceb5809d/third_party/WebKit/Source/web/tests/ResizeObserverTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c6494e265fc1de5c751198a4282daf7e5c30eb10 commit c6494e265fc1de5c751198a4282daf7e5c30eb10 Author: hiroshige <hiroshige@chromium.org> Date: Wed Apr 12 17:24:27 2017 Rename Script() returning UScriptCode to GetScript() To avoid naming conflict between Script() and a new class Script that will be introduced by https://codereview.chromium.org/2780463002/. BUG=686281 Review-Url: https://codereview.chromium.org/2815523002 Cr-Commit-Position: refs/heads/master@{#464064} [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/core/css/CSSFontSelector.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/core/layout/ng/inline/ng_layout_inline_items_builder.cc [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/LayoutLocale.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/LayoutLocale.h [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/LayoutLocaleTest.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/AcceptLanguagesResolverTest.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/FontDescription.h [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroid.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/android/FontCacheAndroidTest.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaperTest.cpp [modify] https://crrev.com/c6494e265fc1de5c751198a4282daf7e5c30eb10/third_party/WebKit/Source/platform/fonts/win/FontFallbackWin.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7bd81a2cc4caff15e2d290591b2567a599fbe846 commit 7bd81a2cc4caff15e2d290591b2567a599fbe846 Author: hiroshige <hiroshige@chromium.org> Date: Wed Apr 12 21:49:10 2017 Introduce blink::Script This CL introduces blink::Script and ClassicScript that correspond to https://html.spec.whatwg.org/#concept-script and https://html.spec.whatwg.org/#classic-script, respectively. This CL moves classic-script-only logic in ScriptLoader::DoExecuteScript() (AccessControlStatus and MIME type check) to ClassicScript. In the rest of this CL, we replace ScriptSourceCode with Script and wrap ScriptSourceCode by ClassicScript where needed. Although this CL makes ScriptLoader to handle blink::Script, currently module scripts are not actually processed because all the call sites supply ClassicScript, and thus this CL shouldn't change the behavior. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2780463002 Cr-Commit-Position: refs/heads/master@{#464161} [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/BUILD.gn [add] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ClassicScript.cpp [add] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ClassicScript.h [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ModuleScript.cpp [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ModuleScript.h [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/PendingScript.h [add] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/Script.h [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/7bd81a2cc4caff15e2d290591b2567a599fbe846/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d512803299c01324b92ffd8c962da97e3bc8ccff commit d512803299c01324b92ffd8c962da97e3bc8ccff Author: hiroshige <hiroshige@chromium.org> Date: Thu Apr 13 19:14:53 2017 Split PendingScript into PendingScript and ClassicPendingScript This is preparation for introducing ModulePendingScript. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2653923008 Cr-Commit-Position: refs/heads/master@{#464494} [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/BUILD.gn [add] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [add] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/d512803299c01324b92ffd8c962da97e3bc8ccff/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4 commit d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4 Author: hiroshige <hiroshige@chromium.org> Date: Thu Apr 13 23:38:28 2017 Make Script non-TraceWrapperBase and add a comment about ModuleScript tracing https://codereview.chromium.org/2780463002/ introduced Script as TraceWrapperBase, but after discussions Script doesn't needs to be TraceWrapperBase. This CL makes Script non-TraceWrapperBase and adds a comments describing why. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2820533003 Cr-Commit-Position: refs/heads/master@{#464608} [modify] https://crrev.com/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4/third_party/WebKit/Source/core/dom/ClassicScript.cpp [modify] https://crrev.com/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4/third_party/WebKit/Source/core/dom/ClassicScript.h [modify] https://crrev.com/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4/third_party/WebKit/Source/core/dom/ModuleScript.cpp [modify] https://crrev.com/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4/third_party/WebKit/Source/core/dom/ModuleScript.h [modify] https://crrev.com/d1ed2867ffe879d6e1e404cb99c0a9713d7c3eb4/third_party/WebKit/Source/core/dom/Script.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0 commit 06fcf4b92be26a28fde65c743e6a0d40bbc53dc0 Author: hiroshige <hiroshige@chromium.org> Date: Thu Apr 13 23:49:19 2017 Rename PendingScript::Url() to UrlForClassicScript() Because it is/can be used only for classic scripts. BUG=686281 Review-Url: https://codereview.chromium.org/2815163005 Cr-Commit-Position: refs/heads/master@{#464613} [modify] https://crrev.com/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/476b2ca298bce5eae94e680ce84ef56c08e28a2e commit 476b2ca298bce5eae94e680ce84ef56c08e28a2e Author: hiroshige <hiroshige@chromium.org> Date: Fri Apr 14 18:59:21 2017 Revert of Rename PendingScript::Url() to UrlForClassicScript() (patchset #1 id:1 of https://codereview.chromium.org/2815163005/ ) Reason for revert: https://codereview.chromium.org/2653923008/ is suspected to cause CHECK() failure (crbug.com/711703) inside PendingScript's prefinalizer. BUG=711703 Original issue's description: > Rename PendingScript::Url() to UrlForClassicScript() > > Because it is/can be used only for classic scripts. > > BUG=686281 > > Review-Url: https://codereview.chromium.org/2815163005 > Cr-Commit-Position: refs/heads/master@{#464613} > Committed: https://chromium.googlesource.com/chromium/src/+/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0 TBR=kouhei@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=686281 Review-Url: https://codereview.chromium.org/2822763002 Cr-Commit-Position: refs/heads/master@{#464766} [modify] https://crrev.com/476b2ca298bce5eae94e680ce84ef56c08e28a2e/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/476b2ca298bce5eae94e680ce84ef56c08e28a2e/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/476b2ca298bce5eae94e680ce84ef56c08e28a2e/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/476b2ca298bce5eae94e680ce84ef56c08e28a2e/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/56f27b65967e0722581b511fcd03f61d25b991c5 commit 56f27b65967e0722581b511fcd03f61d25b991c5 Author: hiroshige <hiroshige@chromium.org> Date: Fri Apr 14 19:02:44 2017 Revert of Split PendingScript into PendingScript and ClassicPendingScript (patchset #37 id:720001 of https://codereview.chromium.org/2653923008/ ) Reason for revert: Suspected to cause CHECK() failure (crbug.com/711703) inside PendingScript's prefinalizer. BUG=711703 Original issue's description: > Split PendingScript into PendingScript and ClassicPendingScript > > This is preparation for introducing ModulePendingScript. > > BUG= 594639 , 686281 > > Review-Url: https://codereview.chromium.org/2653923008 > Cr-Commit-Position: refs/heads/master@{#464494} > Committed: https://chromium.googlesource.com/chromium/src/+/d512803299c01324b92ffd8c962da97e3bc8ccff TBR=kouhei@chromium.org,sigbjornf@opera.com,japhet@chromium.org,haraken@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2820753002 Cr-Commit-Position: refs/heads/master@{#464768} [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/core/dom/BUILD.gn [delete] https://crrev.com/30e1e88c37b843bde2d1623b46a772f0c99b865d/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [delete] https://crrev.com/30e1e88c37b843bde2d1623b46a772f0c99b865d/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/56f27b65967e0722581b511fcd03f61d25b991c5/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4ef50c3d0a9efe019b290cb28844e1506c3da623 commit 4ef50c3d0a9efe019b290cb28844e1506c3da623 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Mon Apr 17 17:42:23 2017 Revert of Rename PendingScript::Url() to UrlForClassicScript() (patchset #1 id:1 of https://codereview.chromium.org/2815163005/ ) Reason for revert: https://codereview.chromium.org/2653923008/ is suspected to cause CHECK() failure (crbug.com/711703) inside PendingScript's prefinalizer. BUG=711703 Original issue's description: > Rename PendingScript::Url() to UrlForClassicScript() > > Because it is/can be used only for classic scripts. > > BUG=686281 > > Review-Url: https://codereview.chromium.org/2815163005 > Cr-Commit-Position: refs/heads/master@{#464613} > Committed: https://chromium.googlesource.com/chromium/src/+/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0 TBR=kouhei@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=686281 Review-Url: https://codereview.chromium.org/2822763002 Cr-Commit-Position: refs/heads/master@{#464766} (cherry picked from commit 476b2ca298bce5eae94e680ce84ef56c08e28a2e) Review-Url: https://codereview.chromium.org/2826493002 . Cr-Commit-Position: refs/branch-heads/3071@{#17} Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641} [modify] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f41274df3c287d68031e1453c9aeff846c6d4449 commit f41274df3c287d68031e1453c9aeff846c6d4449 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Mon Apr 17 17:45:05 2017 Revert of Split PendingScript into PendingScript and ClassicPendingScript (patchset #37 id:720001 of https://codereview.chromium.org/2653923008/ ) Reason for revert: Suspected to cause CHECK() failure (crbug.com/711703) inside PendingScript's prefinalizer. BUG=711703 Original issue's description: > Split PendingScript into PendingScript and ClassicPendingScript > > This is preparation for introducing ModulePendingScript. > > BUG= 594639 , 686281 > > Review-Url: https://codereview.chromium.org/2653923008 > Cr-Commit-Position: refs/heads/master@{#464494} > Committed: https://chromium.googlesource.com/chromium/src/+/d512803299c01324b92ffd8c962da97e3bc8ccff TBR=kouhei@chromium.org,sigbjornf@opera.com,japhet@chromium.org,haraken@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2820753002 Cr-Commit-Position: refs/heads/master@{#464768} (cherry picked from commit 56f27b65967e0722581b511fcd03f61d25b991c5) Review-Url: https://codereview.chromium.org/2827473002 . Cr-Commit-Position: refs/branch-heads/3071@{#18} Cr-Branched-From: a106f0abbf69dad349d4aaf4bcc4f5d376dd2377-refs/heads/master@{#464641} [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/core/dom/BUILD.gn [delete] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [delete] https://crrev.com/4ef50c3d0a9efe019b290cb28844e1506c3da623/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/f41274df3c287d68031e1453c9aeff846c6d4449/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/08697f894248cda25e67bd5c82565ffbc33f21fa commit 08697f894248cda25e67bd5c82565ffbc33f21fa Author: hiroshige <hiroshige@chromium.org> Date: Wed Apr 19 00:40:27 2017 Introduce ScriptLoader::script_type_ This CL introduces the logic for determining the script type to ScriptLoader. script_type_ will be used by subsequent CLs. This CL also makes Step 6 of ScriptLoader::PrepareScript() (IsValidScriptTypeAndLanguage()) to correspond directly to the spec. This CL doesn't change the behavior. BUG= 594639 , 686281 Review-Url: https://codereview.chromium.org/2821803002 Cr-Commit-Position: refs/heads/master@{#465443} [modify] https://crrev.com/08697f894248cda25e67bd5c82565ffbc33f21fa/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/08697f894248cda25e67bd5c82565ffbc33f21fa/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/08697f894248cda25e67bd5c82565ffbc33f21fa/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp [modify] https://crrev.com/08697f894248cda25e67bd5c82565ffbc33f21fa/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b8d842d9a8a6d837901ce9ef4629c6ebdaef5694 commit b8d842d9a8a6d837901ce9ef4629c6ebdaef5694 Author: hiroshige <hiroshige@chromium.org> Date: Wed Apr 19 03:37:29 2017 Refactor code around ScriptLoader::FetchScript() according to the spec This CL renames FetchScript() into FetchClassicScript(), and moves most of spec'ed logic to PrepareScript(). This makes the code structure to correspond to the spec more directly, e.g. - FetchClassicScript() now directly corresponds to "fetch a classic script" https://html.spec.whatwg.org/#fetch-a-classic-script and works just as a bridge between PrepareScript() (dominated by HTML spec) and the Blink loading interface. - Empty/invalid URLs are handled explicitly, independently from script type, and in the steps that directly correspond to the spec, while previously they are handled as the cases where ScriptResource::Fetch() returns null. This also makes it easier to implement module script supports. This CL shouldn't change the behavior. BUG=686281 Review-Url: https://codereview.chromium.org/2821553002 Cr-Commit-Position: refs/heads/master@{#465485} [modify] https://crrev.com/b8d842d9a8a6d837901ce9ef4629c6ebdaef5694/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/b8d842d9a8a6d837901ce9ef4629c6ebdaef5694/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac commit 77c5ade43bf1d07f035d143ee6f3449d92b5d6ac Author: hiroshige <hiroshige@chromium.org> Date: Tue Apr 25 06:29:34 2017 Reland of Split PendingScript into PendingScript and ClassicPendingScript This is preparation for introducing ModulePendingScript. This CL shouldn't change the behavior. This has been reverted due to crashing (Issue 711703) because ResourceOwner's prefinalizer is called before PendingScript's prefinalizer, causing CheckState() assertion failure. This reland fixes this issue by registering PendingScript::Dispose() also as the prefinalizer of ClassicPendingScript, which is called before ResourceOwner's prefinalizer. A unit test for the crash will be added by https://codereview.chromium.org/2828973002/. BUG= 594639 , 686281, 711703 Review-Url: https://codereview.chromium.org/2653923008 Cr-Original-Commit-Position: refs/heads/master@{#464494} Committed: https://chromium.googlesource.com/chromium/src/+/d512803299c01324b92ffd8c962da97e3bc8ccff Review-Url: https://codereview.chromium.org/2653923008 Cr-Commit-Position: refs/heads/master@{#466899} [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/BUILD.gn [add] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [add] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/77c5ade43bf1d07f035d143ee6f3449d92b5d6ac/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3d792ae95a9b9e1efa7dfe380278182f94ac8755 commit 3d792ae95a9b9e1efa7dfe380278182f94ac8755 Author: hiroshige <hiroshige@chromium.org> Date: Tue Apr 25 06:38:37 2017 Remove ClassicPendingScript::CreateForTesting() This CL uses MockScriptElementBase instead of nullptr to create ClassicPendingScript, in order to remove ClassicPendingScript::CreateForTesting() and make |PendingScript::element_| always non-null when used. BUG=686281, 694702 Review-Url: https://codereview.chromium.org/2827163003 Cr-Commit-Position: refs/heads/master@{#466902} [modify] https://crrev.com/3d792ae95a9b9e1efa7dfe380278182f94ac8755/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/3d792ae95a9b9e1efa7dfe380278182f94ac8755/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/3d792ae95a9b9e1efa7dfe380278182f94ac8755/third_party/WebKit/Source/core/dom/ClassicPendingScript.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4 commit 8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4 Author: hiroshige <hiroshige@chromium.org> Date: Tue Apr 25 06:56:38 2017 Reland of name PendingScript::Url() to UrlForClassicScript() (patchset #1 id:1 of https://codereview.chromium.org/2822763002/ ) This CL doesn't change the behavior, because this is renaming only. Reason for revert: Issue 711703 is fixed on https://codereview.chromium.org/2653923008/. Original issue's description: > Revert of Rename PendingScript::Url() to UrlForClassicScript() (patchset #1 id:1 of https://codereview.chromium.org/2815163005/ ) > > Reason for revert: > https://codereview.chromium.org/2653923008/ is > suspected to cause CHECK() failure (crbug.com/711703) > inside PendingScript's prefinalizer. > > BUG=711703 > > Original issue's description: > > Rename PendingScript::Url() to UrlForClassicScript() > > > > Because it is/can be used only for classic scripts. > > > > BUG=686281 > > > > Review-Url: https://codereview.chromium.org/2815163005 > > Cr-Commit-Position: refs/heads/master@{#464613} > > Committed: https://chromium.googlesource.com/chromium/src/+/06fcf4b92be26a28fde65c743e6a0d40bbc53dc0 > > TBR=kouhei@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=686281 > > Review-Url: https://codereview.chromium.org/2822763002 > Cr-Commit-Position: refs/heads/master@{#464766} > Committed: https://chromium.googlesource.com/chromium/src/+/476b2ca298bce5eae94e680ce84ef56c08e28a2e TBR=kouhei@chromium.org BUG=686281, 711703 Review-Url: https://codereview.chromium.org/2819043002 Cr-Commit-Position: refs/heads/master@{#466906} [modify] https://crrev.com/8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/8bb84356d2e79de6c4a88e323dc9c5d6a0df40c4/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bb963b8d2b45bc42599aeb59ce1a4d1a91edb3e7 commit bb963b8d2b45bc42599aeb59ce1a4d1a91edb3e7 Author: hiroshige <hiroshige@chromium.org> Date: Fri May 12 23:50:33 2017 Make the clauses of Step 23 of ScriptLoader::PrepareScript() in-order This CL moves the implementation of the 5th Clause of Step 23 of "prepare a script", removes TODO's and adjusts DCHECK() positions. This doesn't change the behavior, because - the 5th Clause only affects classic scripts with HasSourceAttribute() == false, while - the 3rd and 4th Clauses only affect classic scripts with HasSourceAttribute() == true, and module scripts. BUG=686281 Review-Url: https://codereview.chromium.org/2874343003 Cr-Commit-Position: refs/heads/master@{#471496} [modify] https://crrev.com/bb963b8d2b45bc42599aeb59ce1a4d1a91edb3e7/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ed9ec796e62619560c0a8ca788f3ee1dc49e7c07 commit ed9ec796e62619560c0a8ca788f3ee1dc49e7c07 Author: hiroshige <hiroshige@chromium.org> Date: Mon May 15 20:56:32 2017 Strip leading/trailing whitespaces from script URLs in ScriptLoader Previously, leading/trailing whitespaces are not stripped by ScriptLoader and are removed by URL parser later. This CL makes ScriptLoader strip the whitespaces, as described in the spec. This CL makes <script> src attributes that have newline characters in their leading/trailing whitespaces NOT blocked by [1]. This is consistent with the blocking behavior for <img> src attributes. This CL doesn't affect <script> src attributes with newlines in the middle. [1] https://codereview.chromium.org/2794303002 BUG=686281 Review-Url: https://codereview.chromium.org/2818893002 Cr-Commit-Position: refs/heads/master@{#471895} [modify] https://crrev.com/ed9ec796e62619560c0a8ca788f3ee1dc49e7c07/third_party/WebKit/LayoutTests/http/tests/local/absolute-url-strip-whitespace-expected.txt [modify] https://crrev.com/ed9ec796e62619560c0a8ca788f3ee1dc49e7c07/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
Starting efforts to refactor "execute a script block", for Issue 721914.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/188b5d4ae4b8965620b835e0f145474d6e837b61 commit 188b5d4ae4b8965620b835e0f145474d6e837b61 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 02:46:45 2017 Remove Script::IsEmpty() check in ScriptLoader::DoExecuteScript() As preparation for DoExecuteScript() refactoring, this CL removes an early-exit condition for empty scripts, and let empty scripts to be handled by the general-case path below. Behavior changes: Previously some CSP/MIME type checks are skipped for empty scripts, and this causes load events are fired for empty scripts that would fail CSP/MIME checks. This CL makes these checks applied and causes error events are fired instead of load events. The modified layout test adds cases for MIME checks of empty scripts, which would have failed previously. Bug: 686281 Change-Id: I21b460e395c952fa4a6289fb82e027cecd47335e Reviewed-on: https://chromium-review.googlesource.com/553559 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#483601} [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/block-mime-as-script.html [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/LayoutTests/external/wpt/fetch/api/resources/script-with-header.py [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/ClassicScript.cpp [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/ClassicScript.h [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/ModuleScript.cpp [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/ModuleScript.h [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/Script.h [modify] https://crrev.com/188b5d4ae4b8965620b835e0f145474d6e837b61/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2581e93000ff05dbdc52efb980304c2d3f7004b7 commit 2581e93000ff05dbdc52efb980304c2d3f7004b7 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 08:48:05 2017 Introduce ExecuteScriptResult, omit DispatchLoadEvent() for null frames This CL makes ScriptLoader::DoExecuteScript() and related methods return ExecuteScriptResult and checks ExecuteScriptResult more explicitly, to prepare for fixing layering around DoExecuteScript(). ExecuteScriptResult is a kind of glue status code that is needed just because the event dispatching is done outside DoExecuteScript(). This CL also stops calling DispatchLoadEvent() when the context document or frame is null. Such DispatchLoadEvent() calls are expected to be no-op and thus this shouldn't cause observable behavior changes. Bug: 686281 Change-Id: I897dfb545d5742110248d29188e01066a94bef75 Reviewed-on: https://chromium-review.googlesource.com/553430 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#483659} [modify] https://crrev.com/2581e93000ff05dbdc52efb980304c2d3f7004b7/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/2581e93000ff05dbdc52efb980304c2d3f7004b7/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/2581e93000ff05dbdc52efb980304c2d3f7004b7/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/2581e93000ff05dbdc52efb980304c2d3f7004b7/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/65b1b1759fc2cbdbfe4ef5556fdf7d15a3c82123 commit 65b1b1759fc2cbdbfe4ef5556fdf7d15a3c82123 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 15:29:05 2017 Dispatch and error event in a branch in ProcessScriptElementInternal() According to the spec, error event should be fired in this code point. This code block and the last part of ScriptLoader::PrepareScript() process 6th Clause, Step 23 of "prepare a script". As the latter already fires error event on kShouldFireErrorEvent, this CL makes these two code blocks consistent. Bug: 686281 Change-Id: I213e90951f106eacc11d5bb358f9116ad385603f Reviewed-on: https://chromium-review.googlesource.com/553588 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#483710} [modify] https://crrev.com/65b1b1759fc2cbdbfe4ef5556fdf7d15a3c82123/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1 commit cd009ff3bf0b8c024f7d3af84ad82af370ff98b1 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 17:45:22 2017 Use ScriptElementBase::TextFromChildren() for inline script contents According to the spec, "text IDL attribute" should be used in Step 22.1 of "prepare a script". https://html.spec.whatwg.org/#prepare-a-script The text IDL attribute corresponds to TextFromChildren(), while some code blocks in Blink use TextContent() that corresponds to textContent IDL attribute instead. This CL makes all code blocks that corresponds to the Step 22.1 to use TextFromChildren(), and removes ScriptElementBase::TextContent(). Particularly, this changes the behavior of parser-blocking parser-inserted inline scripts that are controlled by HTMLParserScriptRunner (due to the change in HTMLParserScriptRunner::ProcessScriptElementInternal() and ClassicPendingScript::GetSource()). This probably doesn't change the behavior, because non-text elements cannot be inserted in HTML-parser-inserted inline scripts. This CL also removes ScriptLoader::ScriptContent() and replaces it with TextFromChildren() (no behavior changes). Bug: 686281 Change-Id: Ia50b9aa379ff18b9b0c7e5adcad967b2ef541b5e Reviewed-on: https://chromium-review.googlesource.com/554139 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#483745} [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/dom/MockScriptElementBase.h [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/dom/ScriptElementBase.h [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/html/HTMLScriptElement.cpp [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/html/HTMLScriptElement.h [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/svg/SVGScriptElement.cpp [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/svg/SVGScriptElement.h [modify] https://crrev.com/cd009ff3bf0b8c024f7d3af84ad82af370ff98b1/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/95f17ec05931807d8bc7af8cdeab5792f8aadde1 commit 95f17ec05931807d8bc7af8cdeab5792f8aadde1 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 18:00:57 2017 Assume WasCanceled() is false when |error_occurred| is false When the Resource loading is canceled, it should cause ErrorOccurred() to be true and thus the WasCanceled() check in ScriptLoader looks no-op. This CL replaces the WasCanceled() check with CHECK(), and a following CL will remove the CHECK() if not failing. Bug: 686281 Change-Id: I1e8eb3c74743ef8f69f267a901dd0f2ac8178e01 Reviewed-on: https://chromium-review.googlesource.com/556306 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#483755} [modify] https://crrev.com/95f17ec05931807d8bc7af8cdeab5792f8aadde1/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/95f17ec05931807d8bc7af8cdeab5792f8aadde1/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e7e993356ec37ca2afa5bd515bcaf1c908b55037 commit e7e993356ec37ca2afa5bd515bcaf1c908b55037 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 30 19:14:02 2017 Make PendingScriptClient GarbageCollectedMixin Preparation for https://chromium-review.googlesource.com/c/557304 where XMLDocumentParser (that is already GarbageCollected) is changed to be a subclass of PendingScriptClient. Bug: 686281, 717643, 735719, 684306 Change-Id: I700095279c4b8ab44fb725d716925663dcfe9ded Reviewed-on: https://chromium-review.googlesource.com/557302 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#483785} [modify] https://crrev.com/e7e993356ec37ca2afa5bd515bcaf1c908b55037/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/e7e993356ec37ca2afa5bd515bcaf1c908b55037/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/e7e993356ec37ca2afa5bd515bcaf1c908b55037/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/e7e993356ec37ca2afa5bd515bcaf1c908b55037/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/eb6eb71751ad10cb2d20249b058ecb7265c746d1 commit eb6eb71751ad10cb2d20249b058ecb7265c746d1 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Jul 06 00:31:42 2017 Revert "Assume WasCanceled() is false when |error_occurred| is false" This reverts commit 95f17ec05931807d8bc7af8cdeab5792f8aadde1. Reason for revert: The CHECK() is failing (crbug.com/738732). Original change's description: > Assume WasCanceled() is false when |error_occurred| is false > > When the Resource loading is canceled, it should cause ErrorOccurred() > to be true and thus the WasCanceled() check in ScriptLoader looks > no-op. > This CL replaces the WasCanceled() check with CHECK(), and a > following CL will remove the CHECK() if not failing. > > Bug: 686281 > Change-Id: I1e8eb3c74743ef8f69f267a901dd0f2ac8178e01 > Reviewed-on: https://chromium-review.googlesource.com/556306 > Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> > Reviewed-by: Kouhei Ueno <kouhei@chromium.org> > Cr-Commit-Position: refs/heads/master@{#483755} TBR=sigbjornf@opera.com,hiroshige@chromium.org,kouhei@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 686281, 738732 Change-Id: Ic7b47dc4466a226ff749b46171d60e01107ad480 Reviewed-on: https://chromium-review.googlesource.com/559004 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#484419} [modify] https://crrev.com/eb6eb71751ad10cb2d20249b058ecb7265c746d1/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/eb6eb71751ad10cb2d20249b058ecb7265c746d1/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8a589e1f43f36535e10667213f4ad19e33ad17e3 commit 8a589e1f43f36535e10667213f4ad19e33ad17e3 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 02:27:18 2017 Add comprehensive wpt tests for script load/error events These tests cover 1. all clauses of Step 23 of "prepare a script" in the spec https://html.spec.whatwg.org/#prepare-a-script, and 2. all branches around ScriptLoader/HTMLParserScriptRunner (but not XMLDocument) that correspond to 1. Bug: 686281, 739514 , 715369 Change-Id: Ib5a7077864ee213f93272c76b3cf38e2d280cc99 Reviewed-on: https://chromium-review.googlesource.com/560636 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#484800} [modify] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/TestExpectations [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/load-error-events-1.html [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/load-error-events-2.html [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/load-error-events-3.html [delete] https://crrev.com/470ac8ad6279aeecc13ea5349dbc842ab0eb39f6/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/load-event.html [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events-inline.html [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/load-error-events.html [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/load-error-events-helpers.js [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/load-error-events.py [add] https://crrev.com/8a589e1f43f36535e10667213f4ad19e33ad17e3/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/slow.py
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5cd334f5bb536f421a3321921b5543b02ce34534 commit 5cd334f5bb536f421a3321921b5543b02ce34534 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 04:39:21 2017 Set ModulePendingScript::IsExternal() to false for inline module scripts Previously, ModulePendingScript::IsExternal() always returns true, According to the spec, "from an external file" https://html.spec.whatwg.org/#concept-script-external is false for inline module scripts. This CL adjusts some DCHECK()s to also allow inline module scripts. This CL doesn't change any behavior, because currently IsExternal() is used only in DCHECK()s. Bug: 686281, 715369 Change-Id: I27b1d79269519ae6f8fdacd44929da82b9446e0c Reviewed-on: https://chromium-review.googlesource.com/558506 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#484834} [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/dom/ModulePendingScript.h [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/dom/PendingScript.cpp [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/5cd334f5bb536f421a3321921b5543b02ce34534/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e386aa019f7e95b4c0ef1da85265a07bdd738dc2 commit e386aa019f7e95b4c0ef1da85265a07bdd738dc2 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 22:01:06 2017 Introduce ScriptLoader::ExecuteScriptBlock() This CL introduces ExecuteScriptBlock() that is intended to directly corresponds to "execute a script block" in the HTML spec: https://html.spec.whatwg.org/#execute-the-script-block Upcoming CLs will replace ExecuteScript() calls with ExecuteScriptBlock() and make all script execution code paths call ExecuteScriptBlock(). This provides a spec-conformant single control point of script execution including load/error event dispatching, preparing for Issue 721914. This shouldn't change the behavior. Bug: 686281, 721914 Change-Id: Ia4d1d8a2db2b3d203db99b3a9e66be956ca9db74 Reviewed-on: https://chromium-review.googlesource.com/554098 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485065} [modify] https://crrev.com/e386aa019f7e95b4c0ef1da85265a07bdd738dc2/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/e386aa019f7e95b4c0ef1da85265a07bdd738dc2/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/278f13663a3bd8c48f962bd69b34da1eb5b299a8 commit 278f13663a3bd8c48f962bd69b34da1eb5b299a8 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 22:12:49 2017 Use ExecuteScriptBlock() in ScriptLoader::PrepareScript() Follow-up of https://chromium-review.googlesource.com/c/554098. This shouldn't change the behavior. Bug: 686281 Change-Id: Ie5bc4d5f6974c00efa13899998c6b0b225fd941c Reviewed-on: https://chromium-review.googlesource.com/554119 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485069} [modify] https://crrev.com/278f13663a3bd8c48f962bd69b34da1eb5b299a8/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/278f13663a3bd8c48f962bd69b34da1eb5b299a8/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/278f13663a3bd8c48f962bd69b34da1eb5b299a8/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/18acc84f75de252a566aad54a6b5ed459dcfe194 commit 18acc84f75de252a566aad54a6b5ed459dcfe194 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 23:01:14 2017 Use ExecuteScriptBlock() in XMLDocumentParser::EndElementNs() Follow-up of https://chromium-review.googlesource.com/c/554098. This shouldn't change the behavior. Bug: 686281 Change-Id: Ia8ba4ac41aafc2851ba58389b4dd8d7d5910a226 Reviewed-on: https://chromium-review.googlesource.com/557381 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485083} [modify] https://crrev.com/18acc84f75de252a566aad54a6b5ed459dcfe194/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/72f9a4aac2ccfdf18e0618c7fcdc25f1a88cec28 commit 72f9a4aac2ccfdf18e0618c7fcdc25f1a88cec28 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 23:29:38 2017 Do not fire load event for inline scripts in HTMLParserScriptRunner According to the spec: Step 8 of "execute a script block": https://html.spec.whatwg.org/#execute-the-script-block This CL stops firing load events for - parser-inserted inline module scripts without async in HTML, i.e. those fall into 1st Clause of Step 23 of "prepare a script" ( Issue 715369 ; This CL and [1] stop firing load events of all inline module scripts) - parser-inserted inline classic scripts that fall into 5th Clause of Step 23 of "prepare a script" ( Issue 739514 ) [1] https://chromium-review.googlesource.com/c/557978/ Bug: 686281, 739514 , 715369 Change-Id: Ia1a2e9653bccb99ff47faa1d8b8186c043e83770 Reviewed-on: https://chromium-review.googlesource.com/557972 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485100} [modify] https://crrev.com/72f9a4aac2ccfdf18e0618c7fcdc25f1a88cec28/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/72f9a4aac2ccfdf18e0618c7fcdc25f1a88cec28/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/43ce1648d0b0f165758683963f5648c86eb6b775 commit 43ce1648d0b0f165758683963f5648c86eb6b775 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jul 07 23:46:28 2017 Use ExecuteScriptBlock() in HTMLParserScriptRunner Follow-up of https://chromium-review.googlesource.com/c/554098. This shouldn't change the behavior. Bug: 686281 Change-Id: I8f98349b2ecbd8ba972189256f0dbf1c07ad73bd Reviewed-on: https://chromium-review.googlesource.com/557363 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485104} [modify] https://crrev.com/43ce1648d0b0f165758683963f5648c86eb6b775/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ed833edcf7c54725871b18ea08031fa4a5b9db6b commit ed833edcf7c54725871b18ea08031fa4a5b9db6b Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Jul 12 01:41:20 2017 Fire error event asynchronously for ScriptRunner-controlled scripts Previously, error scripts that are controlled by ScriptRunner fell into a special path in ScriptLoader::PendingScriptFinished(), and the error event is dispatched synchronously there. In order to centralize the code for script execution and error event dispatching to ScriptLoader::ExecuteScriptBlock(), this CL removes the special path, lets error scripts to be processed by ScriptRunner::NotifyScriptReady() (that eventually dispatches an error event asynchronously in ScriptLoader::ExecuteScriptBlock()), just like successful scripts. local-JavaScript-from-remote.html is fixed because it assumed the error event for a file:// script is fired synchronously. Bug: 686281 Change-Id: Iebc0f5f178d9af97a2dfb6ba47374798da382451 Reviewed-on: https://chromium-review.googlesource.com/557938 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#485779} [modify] https://crrev.com/ed833edcf7c54725871b18ea08031fa4a5b9db6b/third_party/WebKit/LayoutTests/http/tests/security/local-JavaScript-from-remote-expected.txt [modify] https://crrev.com/ed833edcf7c54725871b18ea08031fa4a5b9db6b/third_party/WebKit/LayoutTests/http/tests/security/local-JavaScript-from-remote.html [modify] https://crrev.com/ed833edcf7c54725871b18ea08031fa4a5b9db6b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/ed833edcf7c54725871b18ea08031fa4a5b9db6b/third_party/WebKit/Source/core/dom/ScriptRunner.cpp [modify] https://crrev.com/ed833edcf7c54725871b18ea08031fa4a5b9db6b/third_party/WebKit/Source/core/dom/ScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d99cd2ff4053dcd10366499bbc1695dac19a8832 commit d99cd2ff4053dcd10366499bbc1695dac19a8832 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Jul 12 04:12:38 2017 Use ExecuteScriptBlock() and PendingScript in XMLDocumentParser Previously, XMLDOcumentParser uses ScriptResource directly. This CL replaces the ScriptResource with PendingScript, in order to: - Replace a call of ScriptLoader::ExecuteScript() with ExecuteScriptBlock() to unify load/error event handling within ExecuteScriptBlock(), as follow-up of https://chromium-review.googlesource.com/c/554098 (Issue 686281), - Prepare for module script support in XHTMLs (Issue 717643), and - Enable SRI check in XHTMLs ( Issue 684306 ). Bug: 686281, 717643, 684306 Change-Id: Ibedded79223d30952dee4c8370fc9eed2201a462 Reviewed-on: https://chromium-review.googlesource.com/557304 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485842} [modify] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/shared-with-xhtml-expected.txt [modify] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/shared-with-xhtml.html [add] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-blocked-xhtml-expected.txt [add] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/LayoutTests/http/tests/security/subresourceIntegrity/subresource-integrity-blocked-xhtml.xhtml [modify] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp [modify] https://crrev.com/d99cd2ff4053dcd10366499bbc1695dac19a8832/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d947b742336d532de171537e8ce89c5fef96ed5 commit 9d947b742336d532de171537e8ce89c5fef96ed5 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Jul 12 07:49:11 2017 Make DispatchLoad/ErrorEvent() and ExecuteScript() non-public As a result of centralizing script execution and load/error event dispatching into ScriptLoader::ExecuteScriptBlock(), ExecuteScript(), DispatchLoadEvent() and DispatchErrorEvent() are now called only from ScriptLoader. Bug: 686281 Change-Id: I47f7b1c0d79d9d7bc586cb02028d72260f20be7b Reviewed-on: https://chromium-review.googlesource.com/557383 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#485893} [modify] https://crrev.com/9d947b742336d532de171537e8ce89c5fef96ed5/third_party/WebKit/Source/core/dom/ScriptElementBase.h [modify] https://crrev.com/9d947b742336d532de171537e8ce89c5fef96ed5/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2491c29c85d9a50c2b6f51aece17343aa71061c2 commit 2491c29c85d9a50c2b6f51aece17343aa71061c2 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Aug 02 18:03:34 2017 Reduce ScriptElementBase::FromElementIfPossible() calls By passing ScriptElementBase/ScriptLoader instead of Element. This CL shouldn't change the behavior. Bug: 686281 Change-Id: I903482390623d18bcff9b6358dc9ee12e1ef7495 Reviewed-on: https://chromium-review.googlesource.com/564144 Reviewed-by: Nate Chapin <japhet@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#491433} [modify] https://crrev.com/2491c29c85d9a50c2b6f51aece17343aa71061c2/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/2491c29c85d9a50c2b6f51aece17343aa71061c2/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.h [modify] https://crrev.com/2491c29c85d9a50c2b6f51aece17343aa71061c2/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp [modify] https://crrev.com/2491c29c85d9a50c2b6f51aece17343aa71061c2/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/db092e5e931ef07332a526bc843e8947dc3f9cf3 commit db092e5e931ef07332a526bc843e8947dc3f9cf3 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Aug 02 20:56:06 2017 Merge ScriptLoader::ExecuteScript() into ExecuteScriptBlock() To make it clearer that ExecuteScriptBlock() is the single entry point of script execution by removing the similarly-named ExecuteScript(), which is now only called from ExecuteScriptBlock(). No behavior changes. Bug: 686281 Change-Id: I0e2bcdcf05cc9c3141398a3a465fa6fb268b0913 Reviewed-on: https://chromium-review.googlesource.com/564301 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#491492} [modify] https://crrev.com/db092e5e931ef07332a526bc843e8947dc3f9cf3/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/db092e5e931ef07332a526bc843e8947dc3f9cf3/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d8926dbd1e40910e3a4fd5ae4f131ad223155d73 commit d8926dbd1e40910e3a4fd5ae4f131ad223155d73 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Aug 02 21:08:30 2017 Remove return value of ExecuteScriptBlock() This makes PrepareScript() return true (previously returning false) for a classic inline script blocked due to CSP (*). This causes |script_element_ = nullptr| only in XMLDocumentParser::EndElementNs() and thus no behavior changes, because this return value is only used in EndElementNs(), and ReadyToBeParserExecuted() and WillBeParserExecuted() are false in such (*) cases. Bug: 686281 Change-Id: If9bb3f9dc89ba46efd6c24a24fc8727a0174c403 Reviewed-on: https://chromium-review.googlesource.com/564200 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#491495} [modify] https://crrev.com/d8926dbd1e40910e3a4fd5ae4f131ad223155d73/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/d8926dbd1e40910e3a4fd5ae4f131ad223155d73/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e1233fcc1b4b4530011b4b427fd84b1bec466a38 commit e1233fcc1b4b4530011b4b427fd84b1bec466a38 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Aug 04 22:44:15 2017 Remove ScriptLoader::ErrorOccurred() It is no longer used. Bug: 686281 Change-Id: Ibb4a589c016334a5472903832572d64684ba8517 Reviewed-on: https://chromium-review.googlesource.com/599150 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#492157} [modify] https://crrev.com/e1233fcc1b4b4530011b4b427fd84b1bec466a38/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/12584bb92c7c4f48e5b72b831ff5127634d8d989 commit 12584bb92c7c4f48e5b72b831ff5127634d8d989 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Aug 04 22:55:47 2017 Move RecordParserBlockedOnScriptLoadDuration() calls to ExecuteScriptBlock() To centralize DocumentParserTiming calls and reduce the number of PendingScript::ErrorOccurred() calls. Bug: 686281 Change-Id: I5f29b98178d24fdacad6c501d5a1bf4b3faf9bee Reviewed-on: https://chromium-review.googlesource.com/564070 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#492163} [modify] https://crrev.com/12584bb92c7c4f48e5b72b831ff5127634d8d989/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/12584bb92c7c4f48e5b72b831ff5127634d8d989/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/12584bb92c7c4f48e5b72b831ff5127634d8d989/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/12584bb92c7c4f48e5b72b831ff5127634d8d989/third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8d7feb3382e35ff57a1838c937345a59e366d07b commit 8d7feb3382e35ff57a1838c937345a59e366d07b Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Tue Oct 24 19:03:47 2017 Do not explicitly remove intervened ScriptResource from MemoryCache Previously, we remove intervened ScriptResource from MemoryCache in two cases: 1. The ScriptResource blocked due to intervention in HTMLParserScriptRunner::PossiblyFetchBlockedDocWriteScript(), and 2. The ScriptResource requested asynchronously to the blocked script in ScriptLoader::PendingScriptFinished(). This CL stops removing the ScriptResource from MemoryCache. Correctness: Safe because: - For Case 1, the ScriptResource should be already not on MemoryCache because it is errored due to blocking, and - For Case 2, it is harmless to leave the ScriptResource on MemoryCache, because it doesn't affect the lifetime, and it doesn't break caching correctness. Resource eviction from MemoryCache: Slightly later but no persistent effects: - Before this CL: the ScriptResource that is asynchronously-fetched by document.write() intervention is evicted immediately at load finish. - After this CL: the ScriptResource is evicted in the next Oilpan GC after loading finishes. Code: Simpler by removing PendingScript::RemoveFromMemoryCache(). Bug: 777626 , 686281 Change-Id: Ic6386103b73a76c8a8440d47c2ae5e0c6de62166 Reviewed-on: https://chromium-review.googlesource.com/721250 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#511224} [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/dom/ModulePendingScript.h [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/8d7feb3382e35ff57a1838c937345a59e366d07b/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e18a5d7159cad3f1db73ff69279504d2937b661 commit 2e18a5d7159cad3f1db73ff69279504d2937b661 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Tue Oct 24 20:00:22 2017 Introduce ClassicPendingScript::is_external_ explicitly To clarify whether it is external and decouple IsExternal() (which must be constant during the ClassicPendingScript lifetime) from GetResource() (which can manipulated for Resource lifetime management or due to initialization/disposing order changes). Particularly, https://chromium-review.googlesource.com/c/chromium/src/+/730852 will create ClassicPendingScript before ScriptResource::Fetch() and thus GetResource() is nullptr when an external script is created. Migrated from https://codereview.chromium.org/2846363003 BUG: 686281, 777612 Change-Id: I9373e731cf17b4b5b2545566c6b9c565447a7699 Reviewed-on: https://chromium-review.googlesource.com/602256 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/master@{#511240} [modify] https://crrev.com/2e18a5d7159cad3f1db73ff69279504d2937b661/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/2e18a5d7159cad3f1db73ff69279504d2937b661/third_party/WebKit/Source/core/dom/ClassicPendingScript.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9f8298b5ce1a7f67d3995606d50e63d56767dc67 commit 9f8298b5ce1a7f67d3995606d50e63d56767dc67 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Tue Oct 24 22:20:23 2017 Remove ScriptLoader::GetResource() HTMLParserScriptRunner obtains classic script's URL for trace arguments via ScriptLoader::GetResource(). This CL replaces it with PendingScript::UrlForClassicScript(). This is to preparation for removing |ScriptLoader::resource_| in https://chromium-review.googlesource.com/c/chromium/src/+/730852. Bug: 686281, 777612 Change-Id: I22bdb038a84cad2fb738ae4a762e97ed7df67786 Reviewed-on: https://chromium-review.googlesource.com/734137 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Nate Chapin <japhet@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#511281} [modify] https://crrev.com/9f8298b5ce1a7f67d3995606d50e63d56767dc67/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/9f8298b5ce1a7f67d3995606d50e63d56767dc67/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0f36150300cbfd42043e81b58104d1e05393ed94 commit 0f36150300cbfd42043e81b58104d1e05393ed94 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Oct 26 01:10:31 2017 Decouple logic for sending requests to blocked scripts from ScriptLoader Previously, document.write() intervention sends an asynchronous request to a blocked script by creating a new ScriptLoader that is not referenced from the corresponding HTMLScriptElement and by running its ScriptLoader::PrepareScript(). This is not good in terms of code health because: - This makes ScriptLoaders NOT correspond one by one to script elements, - The asynchronous request should not cause script execution but ScriptLoader is the core class for script execution. To resolve these issues, this CL moves the intervention logic from ScriptLoader and HTMLParserScriptRunner to DocumentWriteIntervention. Instead of using ScriptLoader, the asynchronous request is send via FetchBlockedDocWriteScriptClient, separately from the code paths for script execution such as ClassicPendingScript, ScriptLoader, and HTMLParserScriptRunner. Bug: 777626 , 686281 Change-Id: I174bb85a184b741b41ef98c2d0d7501cab00cbb9 Reviewed-on: https://chromium-review.googlesource.com/722162 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Shivani Sharma <shivanisha@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#511678} [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/LayoutTests/http/tests/doc-write-intervention/doc-write-sync-third-party-script-block-expected.txt [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/LayoutTests/http/tests/doc-write-intervention/doc-write-sync-third-party-script-block.html [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/dom/DocumentWriteIntervention.cpp [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/dom/DocumentWriteIntervention.h [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp [modify] https://crrev.com/0f36150300cbfd42043e81b58104d1e05393ed94/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9d0b896c09461e4c1fcee17856f768d3e66880bf commit 9d0b896c09461e4c1fcee17856f768d3e66880bf Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Oct 26 22:39:56 2017 Create PendingScript when script loading is started in PrepareScript() Previously, PendingScript was created in ScriptLoader::CreatePendingScript() which could be invoked by non-ScriptLoader after ScriptLoader::PrepareScript(). This CL creates PendingScript during ScriptLoader::PrepareScript() when the script fetch is initiated. This is in order to: - Couple ScriptResource::Fetch() and SetResource() (and thus AddClient()) to make it easier to assign TaskRunner to AddClient(). (Context: https://chromium-review.googlesource.com/c/chromium/src/+/723879) - Simplify the lifetime of PendingScript, and remove glue code for bridging PrepareScript() and CreatePendingScript(). This CL renames |ScriptLoader::resource_| into |resource_keep_alive_|, because it is now used only to keep the ScriptResource alive even after script execution. This CL doesn't remove the reference from ScriptLoader to ScriptResource, because removing it makes the ScriptResource's lifetime shorter and thus evicted from MemoryCache (because it is the only reference to the ScriptResource after script execution), and causes devtools layout test failures. Bug: 777612 , 686281, 778799 Change-Id: I5ea0a393ee567520c526ee69b82e08281caa7a7d Reviewed-on: https://chromium-review.googlesource.com/730852 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Cr-Commit-Position: refs/heads/master@{#511991} [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/dom/ScriptLoader.h [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/9d0b896c09461e4c1fcee17856f768d3e66880bf/third_party/WebKit/Source/core/xml/parser/XMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/859a3de4c564c8a8f6a77704df510d325fe4d57e commit 859a3de4c564c8a8f6a77704df510d325fe4d57e Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Oct 27 21:00:31 2017 Centralize ClassicPendingScript::CreateInline() call sites This merges all ClassicPendingScript::CreateInline() call sites into one in ScriptLoader::PrepareScript(). This - reduces code duplication, - makes PendingScript always created before the last step of ScriptLoader::PrepareScript() and makes TakePrepareScript() always called, and - prepares for https://chromium-review.googlesource.com/c/chromium/src/+/736876. Behavior changes: This CL resets line numbering for nested writes for classic inline scripts controlled by {HTML,XML}ParserScriptRunner. Previously, the line numbering is reset only when the classic inline script is executed inside PrepareScript(). Bug: 771486 , 777612 , 686281 Change-Id: Ibcaf9bcfa958bb302b1d7f5b7f17c501a7ac7027 Reviewed-on: https://chromium-review.googlesource.com/737055 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#512269} [modify] https://crrev.com/859a3de4c564c8a8f6a77704df510d325fe4d57e/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/859a3de4c564c8a8f6a77704df510d325fe4d57e/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp [modify] https://crrev.com/859a3de4c564c8a8f6a77704df510d325fe4d57e/third_party/WebKit/Source/core/xml/parser/XMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9a942faab2c8850c567c50fe73dc0d4a4976e4d8 commit 9a942faab2c8850c567c50fe73dc0d4a4976e4d8 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Sat Nov 04 14:03:05 2017 Fix crashes in ClassicPendingScript::UrlForClassicScript() Follow-up / bug fix of [1]. Before [1], the URL for tracing is obtained only when ScriptLoader::GetResource() is non-null (i.e. for classic external scripts). But after [1] ClassicPendingScript::UrlForClassicScript() tries to get the URL even for classic inline scripts, and thus is crashing. This CL adds checks to avoid null-dereferencing GetResource() (i.e. returns NullURL() for classic inline scripts). [1] https://chromium-review.googlesource.com/734137 Bug: 780598 , 780412 , 686281, 777612 Change-Id: I775faa270ecb7788a448e703db0689a17ea80aee Reviewed-on: https://chromium-review.googlesource.com/754101 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#514049} [modify] https://crrev.com/9a942faab2c8850c567c50fe73dc0d4a4976e4d8/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/79872df78047d79fbdab74da35fc31ecd3c89b33 commit 79872df78047d79fbdab74da35fc31ecd3c89b33 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Nov 15 13:42:12 2017 Clean up the code around PendingScript::UrlForClassicScript() This CL - Renames PendingScript::UrlForClassicScript() to UrlForTracing() and updates its comment, as it is now used only for tracing, and - Allows calling UrlForTracing() for module scripts, and simplifies GetTraceArgsForScriptElement() conditions. No behavior changes. Bug: 686281, 777612 Change-Id: Id2d6741071d03a697d49a8573967c6a4d2557224 Reviewed-on: https://chromium-review.googlesource.com/753531 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#516685} [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/dom/ModulePendingScript.h [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp [modify] https://crrev.com/79872df78047d79fbdab74da35fc31ecd3c89b33/third_party/WebKit/Source/core/html/parser/HTMLParserScriptRunner.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fecac6bbbcc3446facba54a4fb7a404825d61c94 commit fecac6bbbcc3446facba54a4fb7a404825d61c94 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Nov 30 19:47:43 2017 Remove XMLParserScriptRunner::script_element_ and add spec comments Bug: 686281 Change-Id: I2909d2f199deec969948177770a6947ca86ddee8 Reviewed-on: https://chromium-review.googlesource.com/721843 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#520645} [modify] https://crrev.com/fecac6bbbcc3446facba54a4fb7a404825d61c94/third_party/WebKit/Source/core/xml/parser/XMLParserScriptRunner.cpp [modify] https://crrev.com/fecac6bbbcc3446facba54a4fb7a404825d61c94/third_party/WebKit/Source/core/xml/parser/XMLParserScriptRunner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/22bf150b6fad408e508eb0efcb1bd7938f2b451b commit 22bf150b6fad408e508eb0efcb1bd7938f2b451b Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Wed Dec 06 00:55:48 2017 Move context document/frame null checks earlier - It is better to do nothing when context document/frame is null. - Preparation for removing ExecuteScriptResult. kShouldFireNone is no longer used, and will be removed in https://chromium-review.googlesource.com/791473. Bug: 788828 , 686281 Change-Id: I2327e9065c9a07da0ea3658bb1d31765cbcb537f Reviewed-on: https://chromium-review.googlesource.com/791450 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#521926} [modify] https://crrev.com/22bf150b6fad408e508eb0efcb1bd7938f2b451b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5 commit c1ca4969c11ac1a7dc54f42eb61fdea907b089f5 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Dec 07 00:48:52 2017 Move Script::CheckMIMETypeBeforeRunScript() to PendingScript - Preparation for removing GetResource() from ScriptSourceCode. - Preparation for removing ExecuteScriptResult. Bug: 788828 , 686281 Change-Id: If2b4d1ca3d98a224871df38f6b01723f23cf5132 Reviewed-on: https://chromium-review.googlesource.com/791530 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#522279} [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ClassicPendingScript.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ClassicScript.cpp [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ClassicScript.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ModulePendingScript.cpp [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ModulePendingScript.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ModuleScript.cpp [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ModuleScript.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/PendingScript.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/Script.h [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/c1ca4969c11ac1a7dc54f42eb61fdea907b089f5/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/533616f25d8d44ea01e0d3ac12be99b52c62dd22 commit 533616f25d8d44ea01e0d3ac12be99b52c62dd22 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Dec 07 20:33:15 2017 Move CSP check for inline scripts to ExecuteScriptBlock() Preparation for removing ExecuteScriptResult. kShouldFireErrorEvent is no longer used, and will be removed in https://chromium-review.googlesource.com/791473. Bug: 788828 , 686281 Change-Id: Id83119633332a8592912ab6d8ca107a5134adaf7 Reviewed-on: https://chromium-review.googlesource.com/791491 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#522535} [modify] https://crrev.com/533616f25d8d44ea01e0d3ac12be99b52c62dd22/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/226a2968ba825f666b389408cd1070c66c66380b commit 226a2968ba825f666b389408cd1070c66c66380b Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Dec 07 21:07:11 2017 Merge ScriptLoader::DoExecuteScript() into ExecuteScriptBlock() Bug: 788828 , 686281 Change-Id: I2e08c5a5e31b4d38cea50ef6cec50f51575abb5d Reviewed-on: https://chromium-review.googlesource.com/791473 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#522543} [modify] https://crrev.com/226a2968ba825f666b389408cd1070c66c66380b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp [modify] https://crrev.com/226a2968ba825f666b389408cd1070c66c66380b/third_party/WebKit/Source/core/dom/ScriptLoader.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7f4ce6eb7a2f54303988e38b96248082078c0d49 commit 7f4ce6eb7a2f54303988e38b96248082078c0d49 Author: Kouhei Ueno <kouhei@chromium.org> Date: Thu Dec 07 22:34:05 2017 Clean-up ScriptSourceCode Makes most of the members of ScriptSourceCode const. Bug: 788828 , 686281 Change-Id: I112ed0a2dd8e6a6e84647f49dc61ad4a840d9413 Reviewed-on: https://chromium-review.googlesource.com/666242 Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#522580} [modify] https://crrev.com/7f4ce6eb7a2f54303988e38b96248082078c0d49/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp [modify] https://crrev.com/7f4ce6eb7a2f54303988e38b96248082078c0d49/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/70a740542455ff94e4da520a8c629112cff5f875 commit 70a740542455ff94e4da520a8c629112cff5f875 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Dec 08 00:22:42 2017 Set ScriptSourceCode::url_/source_map_url_ in ctor Preparation for removing ScriptSourceCode::resource_. Bug: 788828 , 686281 Change-Id: I278b86f0d5baf650e7468ef9f62970bd28ea4209 Reviewed-on: https://chromium-review.googlesource.com/786895 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#522638} [modify] https://crrev.com/70a740542455ff94e4da520a8c629112cff5f875/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp [modify] https://crrev.com/70a740542455ff94e4da520a8c629112cff5f875/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/945431d84342213951f61cadde27c5192fac1f70 commit 945431d84342213951f61cadde27c5192fac1f70 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Dec 08 19:33:00 2017 Replace ScriptSourceCode::GetResource() with CacheHandler() As a result of preceding refactoring CLs, ScriptSourceCode::GetResource() is no longer used, except for getting its cache handler. This CL removes GetResource() and instead introduces ScriptSourceCode::CacheHandler(), to make it clearer that ScriptSourceCode has all necessary information for compilation, evaluation and code caching, without relying on ScriptResource. Where CachedMetadataHandler was given separately, this CL sets the CachedMetadataHandler to ScriptSourceCode and removes the separate CachedMetadataHandler arguments. Bug: 788828 , 686281 Change-Id: I19555cafa7637bbb2289e9085baadd400e9987dd Reviewed-on: https://chromium-review.googlesource.com/791493 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#522841} [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/bindings/core/v8/WorkerOrWorkletScriptController.h [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/core/dom/ClassicPendingScript.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/core/exported/WebScriptSource.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/core/mojo/tests/JsToCppTest.cpp [modify] https://crrev.com/945431d84342213951f61cadde27c5192fac1f70/third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9 commit c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9 Author: Kouhei Ueno <kouhei@chromium.org> Date: Mon May 21 12:26:03 2018 retire CHECK(false) Bug: 695730 , 696775, 686281 Change-Id: Id11515ceb7ce61fa15411a57ac4a105d03f3e6e6 Reviewed-on: https://chromium-review.googlesource.com/1065559 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#560258} [modify] https://crrev.com/c365bd25d9c0c2d847bc7cc5aab378ed0d29e1c9/third_party/blink/renderer/core/script/html_parser_script_runner.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ecd28a9094b3c5f6701d48527c490212d49635b8 commit ecd28a9094b3c5f6701d48527c490212d49635b8 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Fri Jun 08 04:59:09 2018 Fire <script> error events asynchronously on URL parse errors To match the behavior with the spec. Bug: 686281 Change-Id: I7aef8035083d1d5c12f91be597c580eb90833fdf Reviewed-on: https://chromium-review.googlesource.com/1091535 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#565547} [delete] https://crrev.com/84615344b760f8b70aa96af224ea70a5c1b79aec/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/fetch-src/empty-expected.txt [delete] https://crrev.com/84615344b760f8b70aa96af224ea70a5c1b79aec/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/fetch-src/empty-with-base-expected.txt [delete] https://crrev.com/84615344b760f8b70aa96af224ea70a5c1b79aec/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/fetch-src/failure-expected.txt [modify] https://crrev.com/ecd28a9094b3c5f6701d48527c490212d49635b8/third_party/blink/renderer/core/script/script_loader.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/797bef071f78357479b715f55ad935353c07d02c commit 797bef071f78357479b715f55ad935353c07d02c Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Thu Jun 14 18:18:22 2018 Evaluate child text content at the time of #prepare-a-script, not evaluation Previously, classic inline script's source_text to be evaluated is taken from the element's child text content at the time of evaluation. However, according to the spec, this should be the element's child text content at the time of #prepare-a-script. This CL fixes this by taking the element's child text content in ClassicPendingScript's constructor, which is called inside PrepareScript(). This affects the behavior if parser-inserted classic inline <script>'s innerText is modified by JavaScript after <script> is inserted into DOM before its evaluation, and I expect this is extremely rare and doesn't have legitimate use cases. Bug: 686281 Change-Id: I0ef67dd8b71403a7862f24d02394f89c6e916bfd Reviewed-on: https://chromium-review.googlesource.com/1091912 Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#567348} [add] https://crrev.com/797bef071f78357479b715f55ad935353c07d02c/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/resources/script-text-modifications.py [add] https://crrev.com/797bef071f78357479b715f55ad935353c07d02c/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/script-text-modifications.html [modify] https://crrev.com/797bef071f78357479b715f55ad935353c07d02c/third_party/blink/renderer/core/script/classic_pending_script.cc [modify] https://crrev.com/797bef071f78357479b715f55ad935353c07d02c/third_party/blink/renderer/core/script/classic_pending_script.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3dbc3cfeab2a55589012d661336787b248ef7f6d commit 3dbc3cfeab2a55589012d661336787b248ef7f6d Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Mon Jul 23 23:34:07 2018 Split HTMLParserScriptRunner::ExecutePendingScriptAndDispatchEvent Before this CL, ExecutePendingScriptAndDispatchEvent() implements two different spec concept depending on its two call sites, and ScriptStreamer::Type parameter is used just to distinguish the two call sites. This CL splits the method into two (one for each call site), to remove unnecessary dependency to ScriptStreamer::Type and make spec correspondence clearer. Bug: 865098, 686281 Change-Id: I2ddb10ebe4c20861121d42d11d4a83cb349c3369 Reviewed-on: https://chromium-review.googlesource.com/1144462 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#577316} [modify] https://crrev.com/3dbc3cfeab2a55589012d661336787b248ef7f6d/third_party/blink/renderer/core/script/html_parser_script_runner.cc [modify] https://crrev.com/3dbc3cfeab2a55589012d661336787b248ef7f6d/third_party/blink/renderer/core/script/html_parser_script_runner.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/93c097996e3b1679a21742e73bcc95f6a4f49a63 commit 93c097996e3b1679a21742e73bcc95f6a4f49a63 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Mon Aug 20 05:50:41 2018 Do not create Script if an error occurred As a preparation for https://chromium-review.googlesource.com/1179488, this CL stops creating ClassicScript when ErrorOccurred() is true. Instead of setting |error_occurred| bool, this CL makes PendingScript::GetSource() return nullptr if an error occurred. This is consistent with the spec: - GetSource() corresponds to "the script's script". - GetSource() == nullptr (previously |error_occurred| == true) corresponds to "the script's script is null". Bug: 875153, 686281 Change-Id: I08d891ce2207894b4a8f8a2d1171f9912c79b8ce Reviewed-on: https://chromium-review.googlesource.com/1179557 Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#584371} [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/classic_pending_script.cc [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/classic_pending_script.h [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/module_pending_script.cc [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/module_pending_script.h [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/pending_script.cc [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/pending_script.h [modify] https://crrev.com/93c097996e3b1679a21742e73bcc95f6a4f49a63/third_party/blink/renderer/core/script/script_runner_test.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8c892903247dfeae7e2da02f4a51bae0d6a22a22 commit 8c892903247dfeae7e2da02f4a51bae0d6a22a22 Author: Hiroshige Hayashizaki <hiroshige@chromium.org> Date: Mon Aug 20 07:07:02 2018 Remove PendingScript::ErrorOccurred() In order to make "GetSource() == nullptr" the single source of truth for whether "the script's script is null". Bug: 686281 Change-Id: I517c22c38e0b2851722a1cb9211654216d459f13 Reviewed-on: https://chromium-review.googlesource.com/1179558 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#584374} [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/classic_pending_script.cc [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/classic_pending_script.h [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/html_parser_script_runner.cc [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/module_pending_script.cc [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/module_pending_script.h [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/pending_script.h [modify] https://crrev.com/8c892903247dfeae7e2da02f4a51bae0d6a22a22/third_party/blink/renderer/core/script/script_runner_test.cc
Comment 1 by csharrison@chromium.org
, Jan 27 2017