Closed Bug 1976912 Opened 2 months ago Closed 1 month ago

[wpt-sync] Sync PR 53719 - [source-phase-imports] Don't clear Data buffer for Wasm Script Resources

Categories

(Core :: JavaScript: WebAssembly, task, P4)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 53719 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/53719
Details from upstream follow.

Luis Pardo <lpardosixtos@microsoft.com> wrote:

[source-phase-imports] Don't clear Data buffer for Wasm Script Resources

When a resource is requested as a classic script, the source is decoded
into a ParkableString, cached in the corresponding ScriptResource and
the corresponding Data buffer from the ScriptResource is cleared.
When a Wasm resource is loaded as an ESM module, it is not decoded nor
cached, instead it gets the source bytes from the ScriptResource's Data
buffer without clearing it. As a side-effect Wasm modules always expect
the Data buffer to not be cleared, which could cause issues if the same
resource was first requested as a classic Script.

This CL:

  • Adds logic to only clear the Data buffer if the mime type is not
    application/wasm.
  • Disabled streaming for scripts with mime type application/wasm
    because streamed-scripts directly cache the decoded source text
    into the corresponding ScriptResource.

Drive-by: Add a WPT test for loading WASM sources that cannot be
encoded as UTF8 strings.

Bug: 42204365
Change-Id: I18343d0f079275f32b8cf325a8b1be94d4fe7125
Fixed: 425682456
Reviewed-on: https://chromium-review.googlesource.com/6681088
WPT-Export-Revision: 10446228efe18605c34f5a6084f7990d6b84e5d5

Component: web-platform-tests → JavaScript: WebAssembly
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests

Status Summary

Firefox

TIMEOUT: 2
ERROR : 1

Chrome

TIMEOUT: 2
ERROR : 1

Safari

TIMEOUT: 2
ERROR : 1

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
You need to log in before you can comment on or make changes to this bug.