Moving files from core/dom to core/script

3 views
Skip to first unread message

Takayoshi Kochi

unread,
Sep 11, 2017, 9:52:32 PM9/11/17
to modul...@chromium.org, loadi...@chromium.org, Hayato Ito
Hi loading team & module-dev

As a part of reorganizing core/dom files, we identified some of the files are more
related to script execution or ES6 modules rather than pure DOM implementation,
and we'd like to propose creating a "core/script" directory and move files there.

The merit of having the separate directory is a clear separation of responsibility
between dom and script execution, and the ownership of script related classes
will be clarified.

Current candidates for core/script are (.h/.cpp/Test.cpp suffixes omitted)

* Script related
- AncestorList
- ClassicPendingScript
- ClassicScript
- ExecutionContext
- FunctionStringCallback
- PendingScript
- Script
- ScriptedIdleTaskController
- ScriptElementBase
- ScriptLoader
- ScriptRunner
- TaskRunnerHelper
- TaskTypeTraits

* ES6 modules related
- DocumentModulatorImpl
- Modulator
- ModulatorImplBase
- ModuleMap
- ModulePendingScript
- ModuleScript
- ScriptModuleResolver
- ScriptModuleResolverImpl
- WorkletModulatorImpl

For more background about core/dom reorganization, see spreadsheet (esp. row 111-134).

Any feedback is welcome.


--
Takayoshi Kochi

Hiroshige Hayashizaki

unread,
Sep 11, 2017, 11:08:00 PM9/11/17
to Takayoshi Kochi, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
Most of the files are the implementation for script elements and their associated JavaScript execution specced in the HTML spec, so the semantics of placing those files in a separate directory is clear.

Exceptions are:
- FunctionStringCallback
- ScriptedIdleTaskController
These are not related to the script elements.

- ExecutionContext
- TaskRunnerHelper
- TaskTypeTraits
These look related to more broader range of things, e.g. Blink's task posting and scheduling (not necessarily JavaScript-related).
+tzik@



--
You received this message because you are subscribed to the Google Groups "module-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to module-dev+unsubscribe@chromium.org.
To post to this group, send email to modul...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/module-dev/CADP2%3Dhoac_Fe22c3%2Bj3khB%3DXCT76%2BnVvZ4uXisR-Lr_pVCOXqw%40mail.gmail.com.

Takayoshi Kochi

unread,
Sep 11, 2017, 11:34:03 PM9/11/17
to Hiroshige Hayashizaki, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
Thanks Hiroshige-san for the comment!

> - FunctionStringCallback
Good catch, it seems to be related to datatransfer (drag & drop) and not relevant to script.

> ScriptIdleTaskController

Maybe ScriptedAnimationController either?
Some other files (IdleDeadline*, IdleRequestCallback.idl, IdleRequestOptions.idl) seem more
suitable to be in core/scheduler (or any more appropriate directory) together.

tzik@, do you have any idea where these files better fit? 
- ExecutionContext
- TaskRunnerHelper
- TaskTypeTraits

--
You received this message because you are subscribed to the Google Groups "loading-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loading-dev+unsubscribe@chromium.org.
To post to this group, send email to loadi...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/loading-dev/CAOaYce7BHjqOoSVetwwEAo7-O6rcbfkZZottUdsGoA%3D5UDDu7A%40mail.gmail.com.



--
Takayoshi Kochi

Takayoshi Kochi

unread,
Sep 14, 2017, 2:13:16 AM9/14/17
to Hiroshige Hayashizaki, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
Discussed off-list with kouhei@ and hiroshige@.

They are okay with moving files from dom to script in general, but want to get it done later as they
are doing big changes.

Regarding files to be moved, the core/script directory should be only referred from
{HTML,SVG,XML}-Script and -Parser.  Files that are not related to those
script elements and parsers should be excluded in core/script dir.

Could you check the list below if I understand the intention correct?

* Script related
- AncestorList
- ClassicPendingScript
- ClassicScript
- ExecutionContext  -> Not move
- FunctionStringCallback -> Not move
- PendingScript
- Script
- ScriptedAnimationController -> Not move
- ScriptedIdleTaskController -> Not move
- ScriptElementBase
- ScriptLoader
- ScriptRunner
- TaskRunnerHelper -> Not move
- TaskTypeTraits -> Not move

* ES6 modules related
- DocumentModulatorImpl
- Modulator
- ModulatorImplBase
- ModuleMap
- ModulePendingScript
- ModuleScript
- ScriptModuleResolver
- ScriptModuleResolverImpl
- WorkletModulatorImpl

Once big changes are done (later this year?) let me check this back  - probably files are added/removed by then.

--
Takayoshi Kochi

Hiroshige Hayashizaki

unread,
Sep 14, 2017, 2:57:10 AM9/14/17
to Takayoshi Kochi, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
> Regarding files to be moved, the core/script directory should be only referred from
> {HTML,SVG,XML}-Script and -Parser.  Files that are not related to those
> script elements and parsers should be excluded in core/script dir.

core/script corresponds to the Blink implementation for the following HTML spec sections (with some delegation to bindings/core/v8/):
By doing this way, I hope core/script is referenced only from HTML/SVGScriptElement and parser-related classes.
The list above does NOT contain the following parts of 8.1 Scripting (and thus the corresponding files aren't moved):
  • 8.1.3.5 Realms, settings objects, and global objects
    • ExecutionContext
  • 8.1.4 Event loops
    • TaskRunnerHelper, TaskTraits, ...
  • 8.1.5 Events
These are used from much broader range of spec/impl.

(How about HTMLParserScriptRunner.cpp?)





Takayoshi Kochi

unread,
Sep 15, 2017, 2:09:01 AM9/15/17
to Hiroshige Hayashizaki, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
Thanks Hiroshige-san.

Probably by the time we do real move, files to be moved could be added or removed,
and needs recheck then.

Let's revisit this when we are ready to go.
--
Takayoshi Kochi

Hiroshige Hayashizaki

unread,
Sep 21, 2017, 3:51:05 AM9/21/17
to Takayoshi Kochi, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki

Kouhei Ueno

unread,
Sep 21, 2017, 4:11:17 AM9/21/17
to Hiroshige Hayashizaki, Takayoshi Kochi, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
The slides are amazing. You should commit this as an official README once we have core/script.

Takayoshi Kochi

unread,
Sep 21, 2017, 4:22:23 AM9/21/17
to Kouhei Ueno, Hiroshige Hayashizaki, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
You can have core/script right now, and populate files later?

Hiroshige Hayashizaki

unread,
Nov 29, 2017, 9:20:45 PM11/29/17
to Takayoshi Kochi, Kouhei Ueno, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
I'm planning to send a PSA to blink-dev around next week and do the actual move mid December.

Kochi-san, did you create a script to prepare your initial CL?
If so, I'd like to use it to create a moving CL.

Takayoshi Kochi

unread,
Nov 30, 2017, 8:45:52 PM11/30/17
to Hiroshige Hayashizaki, Kouhei Ueno, module-dev, Chromium Loading Performance, Hayato Ito, Taiju Tsuiki
Hiroshige-san, I didn't do the initial CL with script, but manually moved using git mv etc., and edited .gn files etc.
Please go ahead creating a new CL ;)

Thanks!
--
Takayoshi Kochi
Reply all
Reply to author
Forward
0 new messages