Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Latest commit

 

History

History
32 lines (18 loc) · 2.58 KB

HTML Integration.md

File metadata and controls

32 lines (18 loc) · 2.58 KB

HTML Integration for import.meta

The following outlines the spec changes to the HTML Standard that would be necessary to support the import.meta proposal in a web browser host environment.

Scripting processing model definitions

In the definitions section, add a new field to module scripts:

script element: A HTMLScriptElement that initiated the graph, or null if it was not initiated by a script element.

Fetching scripts

In the fetching scripts section, add an additional optional argument script element to the fetch a module script graph algorithm.

This then needs to be threaded through various algorithms, starting with fetch a module script graph and fetch the descendants of and instantiate a module script. Eventually it is passed to create a module script which sets the value in the newly-created module script's script element field.

The fetch a module worker script graph algorithm should, in contrast, pass through null as the script element to all the algorithms it calls.

Prepare a script

In the prepare a script algorithm, pass through the script element to the invocations of fetch a module script graph, create a module script, and fetch the descendants of and instantiate a module scirpt.

HostGetImportMetaProperties(moduleRecord)

To the Integration with the JavaScript module system section, add this new subsection.

JavaScript contains an implementation-defined HostResolveImportedModule abstract operation. User agents must use the following implementation: [JAVASCRIPT]

  1. Let module script be moduleRecord.[[HostDefined]].
  2. Let url be module script's base URL, serialized.
  3. Let script element be module script's script element.
  4. Return « Record { [[Key]]: "url", [[Value]]: url }, Record { [[Key]]: "scriptElement", [[Value]]: script element } ».