Skip to content

WPT analysis #86

Open
Open

Description

@lucacasonato

AbortSignal

  • AbortController
  • AbortSignal
+dom/abort/*
-dom/abort/reason-constructor.html

Web Crypto API

  • Crypto
  • CryptoKey
  • SubtleCrypto
  • globalThis.crypto
+WebCryptoAPI/*
-historical.any.*
-algorithm-discards-context.https.window.*

Console

  • globalThis.console
+console/*

Tests are very sparse, and so is spec - it is unclear what side-effects console.log should have across runtimes.

Streams

  • ByteLengthQueuingStrategy
  • CountQueuingStrategy
  • ReadableByteStreamController
  • ReadableStream
  • ReadableStreamBYOBReader
  • ReadableStreamBYOBRequest
  • ReadableStreamDefaultController
  • ReadableStreamDefaultReader
  • TransformStream
  • TransformStreamDefaultController
  • WritableStream
  • WritableStreamDefaultController
  • WritableStreamDefaultWriter
+streams/*
-streams/readable-streams/cross-realm-crash.window.html

streams/transferable/* needs investigation.

(De)compression streams

  • CompressionStream
  • DecompressionStream
+compression/*

Text encoding

  • TextDecoder
  • TextDecoderStream
  • TextEncoder
  • TextEncoderStream
+encoding/*
-encoding/streams/realms.window.html
-encoding/streams/invalid-realm.window.html
-encoding/unsupported-encodings.any.*
-encoding/single-byte-decoder.window.html
-encoding/unsupported-labels.window.html

URL

  • URL
  • URLSearchParams
+url/*
-url/url-setters-a-area.window.html
-url/a-element-origin.html
-url/a-element.html
-url/data-uri-fragment.html
-url/failure.html

Note, a lot of tests in this directory also test using <a> and <area> tags from HTML. It would be good to split those into seperate files.

URLPattern

  • URLPattern
+urlpattern/urlpattern.any.*
+urlpattern/urlpattern-https.any.*
+urlpattern/urlpattern-hasregexpgroups.any.*

File API

  • Blob
  • File
+FileAPI/blob/*
-FileAPI/blob/Blob-constructor-dom.window.html
+FileAPI/file/*
-FileAPI/file/send-file-form-*
+FileAPI/url/url-format.any.*
+FileAPI/url/url-with-fetch.any.*
+FileAPI/unicode.html

A lot of these tests rely on FileReader existing. Should we add this?

Activity

  1. andreubotella commented on Mar 21, 2025

    @andreubotella
    Member

    This is great! A couple comments:

    • In the meeting it was mentioned that some stream methods required workers, which aren't in the minimum common API, and aren't planned to be added since runtimes like Cloudflare Workers won't support them. It seems like any specified cross-agent interactions should not apply to any runtime that doesn't support cross-agent transferring; and for the rest, we could mark a subset of tests as needing the Worker API in order to run (for example, by polyfilling it on top of worker_threads as Node.js does in its WPT runner).
      • That said, this came up for the transferable stream tests, and transferring can be done with structuredClone without needing another agent. We should see which of those tests are specific to cross-agent interactions, and whether any can be replaced with structuredClone.
    • As for FileReader, my understanding is that a lot of those tests were written before the stream/text/arrayBuffer/bytes methods existed, so they can probably be updated to use those.
  2. jasnell commented on Mar 21, 2025

    @jasnell
    Contributor

    Interestingly, while we don't support the web workers API, Cloudflare Workers does support a form of transferring streams across worker-like boundaries in our jsrpc mechanism. Basically we can do things like env.FOO.doSomething(readable) where doSomething(...) is an RPC call to a different worker (running a different isolate) and the readable is a ReadableStream. For that ReadableStream the observable effect of this should be the same as postMessage(...)ing that ReadableStream to a web worker. Given that, I wonder if there's some way of abstracting exactly how these tests handle the transfer.

    Ironically, tho, we don't actually support using structuredClone() to transfer streams even within the same isolate. That's something we can likely add fairly easily tho.

  3. lucacasonato commented on May 1, 2025

    @lucacasonato
    MemberAuthor

    Structured Clone

    • structuredClone

    More analysis needed: to be done by @andreubotella. web-platform-tests/wpt#49282

    DOMException

    • DOMException
    +webidl/ecmascript-binding/es-exceptions/DOMException-*
    

    WASM

    • WebAssembly
    +wasm/*
    -wasm/serialization/module/*
    

    We need to write some dedicated tests for wasm structured clone that do not involve DOM / HTML.

    navigator

    • navigator

    No existing tests that we can use.

    Create a new test for just user-agent to check it's a string. maybe also check that fetch sets the user-agent test.

    performance.now

    • performance.now
    +hr-time/idlharness.any.*
    +hr-time/basic.any.*
    +hr-time/monotonic-clock.any.*
    

    queueMicrotask

    • queueMicrotask
    +html/webappapis/microtask-queuing/queue-microtask.any.*
    +html/webappapis/microtask-queuing/queue-microtask-exceptions.any.*
    

    setInterval/setTimeout

    • setInterval
    • clearInterval
    • setTimeout
    • clearTimeout
    +html/webappapis/timers/*
    -html/webappapis/timers/setinterval-cross-realm-callback-report-exception.html
    -html/webappapis/timers/settimeout-cross-realm-callback-report-exception.html
    

    atob/btoa

    • atob
    • btoa
    +html/webappapis/atob/*
    
  4. lucacasonato commented on May 2, 2025

    @lucacasonato
    MemberAuthor
  5. andreubotella commented on May 9, 2025

    @andreubotella
    Member

    Structured Clone

    * `structuredClone`
    

    More analysis needed: to be done by @andreubotella. web-platform-tests/wpt#49282

    It seems like that PR might not be able to land until there's interest from browsers in shipping ShadowRealm. We might need to make a new PR with the subset of changes that's needed for the minimum common API (e.g. Blob tests can stay, since they're exposed in the mcAPI but not in ShadowRealm) and land that first.

  6. andreubotella commented on May 15, 2025

    @andreubotella
    Member

    FormData

    (constructor.any.js depends on what we decide to do with the arguments, see #63)

    +xhr/formdata
    -xhr/formdata/append-formelement.html
    -xhr/formdata/constructor-formelement.html
    -xhr/formdata/constructor-submitter-coordinate.html
    -xhr/formdata/constructor-submitter.html
    -xhr/formdata/delete-formelement.html
    -xhr/formdata/get-formelement.html
    -xhr/formdata/has-formelement.html
    -xhr/formdata/set-formelement.html
    
  7. Ms2ger commented on Dec 15, 2025

    @Ms2ger

    I've been reviewing the sets of tests listed in this issue, and I'd like to propose excluding at a minimum the following tests, which either are designed to test browser features not included in the minimum common api, or if there's something in them that might be relevant, would need to be completely rewritten to work in minimum common api runtimes:

    streams/queuing-strategies-size-function-per-global.window.js
    streams/readable-streams/cross-realm-crash.window.js
    streams/readable-streams/global.html
    streams/readable-streams/owning-type-video-frame.any.js
    streams/readable-streams/read-task-handling.window.js
    streams/transferable/deserialize-error.window.js
    streams/transferable/transfer-with-messageport.window.js
    streams/transferable/worker.html
    streams/transform-streams/invalid-realm.tentative.window.js
    encoding/big5-encoder.html
    encoding/bom-handling.html
    encoding/iso-2022-jp-encoder.html
    encoding/legacy-mb-japanese/*
    encoding/legacy-mb-korean/*
    encoding/legacy-mb-schinese/*
    encoding/legacy-mb-tchinese/*
    encoding/remove-only-one-bom.html
    encoding/sniffing.html
    encoding/streams/invalid-realm.window.js
    encoding/streams/realms.window.js
    encoding/utf-32-from-win1252.html
    encoding/utf-32.html
    url/a-element-origin-xhtml.xhtml
    url/a-element-xhtml.xhtml
    url/javascript-urls.window.js
    url/percent-encoding.window.js
    url/url-setters-a-area.window.js
    wasm/serialization/arraybuffer/transfer.window.js
    wasm/webapi/historical.any.js
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions