Closed Bug 1773997 Opened 2 years ago Closed 2 years ago

Add tests for loading import maps with <base> element

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: allstars.chh, Assigned: allstars.chh)

References

Details

Attachments

(4 files)

See https://github.com/WICG/import-maps#base-element
If there's a <base> element, it will change the base URI of the document, which will also change the baseURL in import maps.
So we should have some tests to make sure import maps behaves correctly with the <base> element.
Also, the test could be used to test the speculative parsing of import maps in Bug 1762595

Attachment #9281056 - Attachment description: Bug 1773997 - Add tests for loading import maps with <base> element. → Bug 1773997 - Part 1: Add mochitests for loading import maps with <base> element.

With the <base> element, the relative path will be changed, therefore
modifying the script.src to use absolute paths if it's using relative path.

With <base> element changes the base URL to "./resources/", the baseURL
of the import map should be updated as well.
The url "log.js" in the import map will be resolved to "./resources/log.js".

Add a helper function called testInIframeInjectBase, which will include
a Javascript file, which will in turn inject a <base> element into current
document.

Attachment #9283593 - Attachment description: Bug 1773997 - Part 2: Use absolute path for script.src. → Bug 1773997 - Part 2: Use absolute path when calling static_import.py
Pushed by allstars.chh@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4c39a082c94b
Part 1: Add mochitests for loading import maps with <base> element. r=jonco
https://hg.mozilla.org/integration/autoland/rev/7754a95427ef
Part 2: Use absolute path when calling static_import.py r=jonco,yulia
https://hg.mozilla.org/integration/autoland/rev/968815f882d2
Part 3: wpt with <base> for import-maps. r=jonco,yulia
https://hg.mozilla.org/integration/autoland/rev/12620b755d6b
Part 4: wpt for injecting a <base> element for import-maps. r=jonco,yulia
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/35235 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Depends on: 1801764
No longer depends on: 1801764
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: