Skip to content

script: Implement fetching request for track elements - #46289

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:implement-text-track-fetching
Jul 7, 2026
Merged

script: Implement fetching request for track elements#46289
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:implement-text-track-fetching

Conversation

@TimvdLippe

Copy link
Copy Markdown
Contributor

This is the first step of support for track elements. Now, at the appropriate times, a request is sent out. The result of the request is ignored for now, since this PR is already big enough of its own.

To do so, a text track needs to keep track of whether it is part of a track element. Then, at the various decision points, it starts the processing model. This is mostly implemented in terms of machinery, but not all of its parallel steps. That's because I have yet to figure out what they actually mean with "wait until X", whether that just means to reboot the algorithm or not.

Part of #46288

Testing: new WPT tests passing/running.

@TimvdLippe
TimvdLippe requested a review from gterzian as a code owner July 5, 2026 19:10
@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Jul 5, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 5, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

🔨 Triggering try run (#28751756328) for Linux (WPT)

@TimvdLippe

Copy link
Copy Markdown
Contributor Author

I started implementation after investigating missing test coverage for media-src in CSP. Turns out a whole rabbit hole that I enjoyed implementing. Planning to implementing the last part as well.

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

Test results for linux-wpt from try job (#28751756328):

Flaky unexpected result (33)
  • TIMEOUT [expected OK] /_webgl/conformance/reading/read-pixels-test.html
  • TIMEOUT [expected OK] /_webgl/conformance/textures/misc/tex-image-and-sub-image-2d-with-array-buffer-view.html
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
    • NOTRUN [expected PASS] subtest: Overall test
  • CRASH [expected OK] /_webgl/conformance2/extensions/promoted-extensions.html
  • TIMEOUT [expected OK] /_webgl/conformance2/sync/sync-webgl-specific.html
  • TIMEOUT /content-security-policy/inheritance/auxiliary-blank-document.html (#44821)
    • FAIL [expected PASS] subtest: For transient doc, violation event occurs in auxiliary, not opener window.

      assert_equals: expected Document node with 1 child but got Document node with 1 child
      

  • OK /cookies/partitioned-cookies/partitioned-cookies-samesite-attribute.https.html (#45255)
    • FAIL [expected PASS] subtest: In embedded cross-site contexts, partitioned cookies can only be set with explicit SameSite=None

      assert_equals: expected 0 but got 3
      

  • FAIL [expected PASS] /css/css-backgrounds/background-size-041.html
  • FAIL [expected PASS] /css/css-sizing/dynamic-available-size-iframe.html (#45763)
  • CRASH [expected ERROR] /css/filter-effects/parsing/flood-opacity-invalid.svg
  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • TIMEOUT [expected OK] /fetch/content-encoding/zstd/big-zstd-body.https.any.html
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-site - Not sent to non-trustworthy same-origin destination

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/005.html (#27062)
    • PASS [expected FAIL] subtest: Link with onclick navigation and href navigation
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • OK /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
    • FAIL [expected PASS] subtest: opener of discarded auxiliary browsing context

      assert_object_equals: property "get" expected function "function opener() {
          [native code]
      }" got function "function opener() {
          [native code]
      }"
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_navigate_other_frame_popup.sub.html (#39702)
    • TIMEOUT [expected FAIL] subtest: Sandboxed iframe can not navigate other frame's popup

      Test timed out
      

  • TIMEOUT [expected OK] /html/syntax/parsing/html5lib_write_single.html?file=tests1
    • TIMEOUT [expected PASS] subtest: <!COM--MENT>

      Test timed out
      

  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • TIMEOUT [expected OK] /infrastructure/testdriver/click_nested.html (#43887)
    • NOTRUN [expected FAIL] subtest: TestDriver click method with multiple windows and nested iframe
  • OK /mixed-content/tentative/autoupgrades/video-upgrade.https.sub.html (#41135)
    • FAIL [expected PASS] subtest: Video of other host autoupgraded

      assert_equals: Length. Other host expected 1 but got Infinity
      

  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?touch (#45445)
    • FAIL [expected PASS] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.

      assert_true: Timed out waiting for lostpointercapture expected true got false
      

    • FAIL [expected PASS] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.

      assert_array_equals: Received events: innerFrame received pointerdown,innerFrame received pointermove,innerFrame received pointerup,innerFrame received lostpointercapture lengths differ, expected array ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup"] length 3, got ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup", "innerFrame received lostpointercapture"] length 4
      

  • OK /preload/prefetch-document.html (#37210)
    • FAIL [expected PASS] subtest: different-site document prefetch with 'as=document' should not be consumed

      assert_equals: expected 2 but got 1
      

  • OK /resource-timing/buffer-full-then-increased.html (#44408)
    • PASS [expected FAIL] subtest: Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event
  • CRASH [expected OK] /trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.html
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?01-05 (#38975)
    • PASS [expected TIMEOUT] subtest: Navigate a window via anchor with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via anchor with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via anchor with javascript:-urls in enforcing mode.
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?16-20 (#44835)
    • FAIL [expected PASS] subtest: Navigate a frame via area with javascript:-urls in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • TIMEOUT [expected PASS] subtest: Navigate a frame via area with javascript:-urls w/ default policy in report-only mode.

      Test timed out
      

  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?26-30 (#38807)
    • PASS [expected TIMEOUT] subtest: Navigate a window via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls in enforcing mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in enforcing mode.
  • OK /upgrade-insecure-requests/gen/sharedworker-module-data.meta/upgrade/xhr.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to cross-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to cross-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to cross-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to same-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to same-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for xhr to same-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

Stable unexpected results that are known to be intermittent (21)
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • FAIL [expected PASS] subtest: WebGL test #45

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #47

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #49

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #51

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • PASS [expected FAIL] subtest: WebGL test #53
    • PASS [expected FAIL] subtest: WebGL test #55
    • PASS [expected FAIL] subtest: WebGL test #57
    • PASS [expected FAIL] subtest: WebGL test #59
    • FAIL [expected PASS] subtest: WebGL test #61

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #63

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • And 6 more unexpected results...
  • TIMEOUT [expected OK] /credential-management/credentialscontainer-frame-basics.https.html (#39430)
    • TIMEOUT [expected FAIL] subtest: navigator.credentials should be undefined in documents generated from data: URLs.

      Test timed out
      

  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove new parent

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

    • PASS [expected FAIL] subtest: moveBefore(): cross-origin iframe is preserved: remove self
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self via replaceChildren()

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • TIMEOUT /fetch/metadata/generated/css-images.https.sub.tentative.html (#42229)
    • FAIL [expected PASS] subtest: content sec-fetch-site - Cross-Site -> Same-Site

      assert_unreached: Reached unreachable code
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html (#44099)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by submitButton.click()

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement=" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20const%20button%20%3D%20document.createElement(%22button%22)%3B%0A%20%20%20%20button.type%20%3D%20%22submit%22%3B%0A%20%20%20%20form.append(button)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20button.click()%3B%0A%20%20"
      

  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html (#44028)
  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Host element with delegatesFocus should support autofocus

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • FAIL [expected TIMEOUT] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks

      assert_array_equals: animationFrame lengths differ, expected array ["autofocus", "scroll", "animationFrame"] length 3, got ["animationFrame"] length 1
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/src_object_blob.html (#40340)
    • PASS [expected TIMEOUT] subtest: HTMLMediaElement.srcObject blob
  • TIMEOUT /html/syntax/parsing/html5lib_write.html?file=processing-instructions (#46205)
    • TIMEOUT [expected FAIL] subtest: <body><?module-handler data>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?view-port>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?view-port data>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?config-v2>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?config-v2 data>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?x>

      Test timed out
      

  • TIMEOUT /html/syntax/parsing/html5lib_write_single.html?file=processing-instructions (#46206)
    • TIMEOUT [expected FAIL] subtest: <body><?x>

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: <body><?r2-d2>

      Test timed out
      

  • OK /resource-timing/buffer-full-add-then-clear.html (#40819)
    • FAIL [expected PASS] subtest: Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one

      assert_equals: Number of entries does not match the expected value. expected 3 but got 0
      

  • OK /resource-timing/test_resource_timing.https.html (#25216)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest)
  • OK /touch-events/hover-state-caused-by-compatibility-mouse-events.tentative.html (#46277)
    • FAIL [expected PASS] subtest: The compatibility mouse events should set :hover: The compatibility mouse events should be fired

      assert_equals: expected "[{ type: \"mouseover\", target: div.target },{ type: \"mousemove\", target: div.target },{ type: \"mousedown\", target: div.target },{ type: \"mouseup\", target: div.target },{ type: \"click\", target: div.target }]" but got "[]"
      

    • FAIL [expected PASS] subtest: The compatibility mouse events should set :hover, but shouldn't be preserved after the target is replaced: The compatibility mouse events should be fired

      assert_equals: expected "[{ type: \"mouseover\", target: div.target },{ type: \"mousemove\", target: div.target },{ type: \"mousedown\", target: div.target },{ type: \"mouseup\", target: div.target },{ type: \"click\", target: div.target }]" but got "[]"
      

  • OK /touch-events/single-tap-when-touchend-listener-use-sync-xhr.html (#41175)
    • FAIL [expected PASS] subtest: Click event should be fired when touchend opens synchronous XHR

      assert_equals: expected "touchend@div, mousedown@div, mouseup@div, click@div" but got "touchend@div, mousedown@div"
      

  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?11-15 (#44834)
    • PASS [expected TIMEOUT] subtest: Navigate a window via area with javascript:-urls in report-only mode.
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • TIMEOUT [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.
    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.
    • NOTRUN [expected FAIL] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.
  • OK /visual-viewport/resize-event-order.html (#41981)
    • FAIL [expected PASS] subtest: Popup: DOMWindow resize fired before VisualViewport.

      assert_equals: expected "window-attribute,window-addEventListener,visualViewport-attribute,visualViewport-addEventListener" but got ""
      

  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • TIMEOUT [expected FAIL] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      Test timed out
      

Stable unexpected results (68)
  • OK [expected TIMEOUT] /fetch/metadata/track.https.sub.html
    • PASS [expected TIMEOUT] subtest: Same-Origin track
    • PASS [expected NOTRUN] subtest: Same-Site track
    • PASS [expected NOTRUN] subtest: Cross-Site track
    • PASS [expected NOTRUN] subtest: Same-Origin, CORS track
    • FAIL [expected PASS] subtest: Same-Origin, CORS track: sec-fetch-mode

      assert_equals: expected "same-origin" but got "no-cors"
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrack/addCue.html
    • FAIL [expected TIMEOUT] subtest: TextTrack.addCue(), adding a cue associated with a track element to other track

      Value is not an object.
      

  • OK /html/semantics/embedded-content/media-elements/interfaces/TextTrack/cues.html
    • PASS [expected FAIL] subtest: TextTrack.cues, default attribute
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrack/removeCue.html
    • FAIL [expected TIMEOUT] subtest: TextTrack.removeCue(), cue from track element

      assert_throws_dom: listed in track.track, remove from t1 function "function() { t1.removeCue(cue); }" threw object "TypeError: Value is not an object." that is not a DOMException NOT_FOUND_ERR: property "code" is equal to undefined, expected 8
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCue.endTime, parsed cue

      can't access property "endTime", c[0] is undefined
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCue.id, parsed cue

      can't access property "id", c[0] is undefined
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCue.pauseOnExit, parsed cue

      can't access property "pauseOnExit", c1 is undefined
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCue.startTime, parsed cue

      can't access property "startTime", c[0] is undefined
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCue.track, parsed cue

      can't access property "track", c is undefined
      

  • OK /html/semantics/embedded-content/media-elements/interfaces/TextTrackList/length.html
    • PASS [expected FAIL] subtest: TextTrackList.length
  • TIMEOUT /html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html
    • FAIL [expected TIMEOUT] subtest: track element cloneNode, loaded

      assert_equals: elm.readyState after setting src expected 0 but got 1
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/no-cuechange-before-play.html
    • PASS [expected TIMEOUT] subtest: Ensure that the 'cuechange' event is not fired before video playback has begun.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-add-remove-cue.html
    • FAIL [expected TIMEOUT] subtest: TextTrack's addCue and removeCue

      assert_equals: expected 4 but got 0
      

  • OK /html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html
    • PASS [expected FAIL] subtest: Count track list
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable-fragment.html
    • FAIL [expected TIMEOUT] subtest: Cue fragment is mutable

      can't access property "text", testCue is undefined
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html
    • FAIL [expected TIMEOUT] subtest: Modifying attributes of a VTTCue

      can't access property "startTime", textCue is null
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cue-negative-timestamp.html
    • FAIL [expected TIMEOUT] subtest: Negative timestamps

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html
    • FAIL [expected TIMEOUT] subtest: Events are triggered for missed (skipped) cues during normal playback

      assert_equals: expected 7 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cues-pause-on-exit.html
    • FAIL [expected TIMEOUT] subtest: Video is paused after cues having pause-on-exit flag are processed

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cues-seeking.html
    • FAIL [expected TIMEOUT] subtest: TextTrack's activeCues are indexed and updated during video playback

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-cues-sorted-before-dispatch.html
    • FAIL [expected TIMEOUT] subtest: All events are triggered in chronological order

      assert_equals: expected 8 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-data-url.html
    • FAIL [expected TIMEOUT] subtest: track element data: URL No CORS

      assert_equals: expected 1 but got 0
      

    • FAIL [expected TIMEOUT] subtest: track element data: URL anonymous

      assert_equals: expected 1 but got 0
      

    • FAIL [expected TIMEOUT] subtest: track element data: URL use-credentials

      assert_equals: expected 1 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-default-attribute.html
    • PASS [expected TIMEOUT] subtest: A track with the "default" attribute loads automatically
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-delete-during-setup.html
    • PASS [expected TIMEOUT] subtest: Track deletion during setup
  • OK /html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html
    • PASS [expected FAIL] subtest: Disabling a track
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change-error.html
    • FAIL [expected TIMEOUT] subtest: HTMLTrackElement 'src' attribute mutations

      assert_equals: Number of cues after first loading of the track expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html
    • FAIL [expected TIMEOUT] subtest: HTMLTrackElement 'src' attribute mutations

      assert_equals: Number of cues after first loading of the track expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-large-timestamp.html
    • FAIL [expected TIMEOUT] subtest: Very large timestamp is parsed correctly

      assert_equals: expected 1 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-load-from-element-readyState.html
    • PASS [expected TIMEOUT] subtest: Load event on HTMLTrackElement and LOADED readyState on TextTrack when src is set on the element
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-load-from-src-readyState.html
    • PASS [expected TIMEOUT] subtest: Load event on HTMLTrackElement and LOADED readyState on TextTrack when src is set from JavaScript
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html
    • FAIL [expected TIMEOUT] subtest: A track appended after the initial track configuration does not change other tracks

      assert_equals: expected 12 but got 0
      

  • OK /html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html
    • PASS [expected FAIL] subtest: Add and remove track node
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html
    • TIMEOUT [expected FAIL] subtest: Tests that the 'removetrack' event is NOT fired for inband TextTrack on a failed load.

      Test timed out
      

  • OK /html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html
    • PASS [expected FAIL] subtest: Tests that the 'removetrack' event is fired when an out-of-band TextTrack is removed.
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html
    • FAIL [expected TIMEOUT] subtest: TextTrackCueList functionality: length, operator[], and getCueById()

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-alignment.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/alignment.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/alignment-ltr.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/alignment-bad.vtt

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-blank-lines.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cues.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cues-no-separation.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-bom.html
    • FAIL [expected TIMEOUT] subtest: Parser properly ignores a UTF-8 BOM character at the beginning of a file and all other cues are properly parsed

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-class-markup.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/class.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/class-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-cue-identifiers.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-id.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-id-error.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-cue-no-id.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-no-id.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-no-id-error.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-cue-recovery.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-recovery-header.vtt

      assert_equals: expected 2 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-recovery-note.vtt

      assert_equals: expected 2 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-recovery-cuetext.vtt

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-cue-size-align.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-size-align.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-size-align-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-cue-size.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-size.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/cue-size-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-degenerate-cues.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/degenerate-cues.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-empty-cue.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/empty-cue.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-entities.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/entities.vtt

      assert_equals: expected 7 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/entities-wrong.vtt

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-header-comment.html
    • FAIL [expected TIMEOUT] subtest: Optional comment area under the "WEBVTT" file header is properly ignored and also, default settings and styling are currently ignored (treated as faulty cues)

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-interspersed-non-cue.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/interspersed-non-cue.vtt

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-markup.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/markup.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/markup-bad.vtt

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-newlines.html
    • FAIL [expected TIMEOUT] subtest: A cue with no newline at eof is parsed properly

      assert_equals: expected 1 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-no-timings.html
    • PASS [expected TIMEOUT] subtest: Cue without timings are ignored
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-positioning.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/positioning.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/positioning-ltr.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/positioning-bad.vtt

      assert_equals: expected 8 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-settings.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/settings.vtt

      assert_equals: expected 4 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/settings-bad-separation.vtt

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-timestamp.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/timestamp.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/timestamp-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-timings-hour.html
    • FAIL [expected TIMEOUT] subtest: Cue timings and various syntax errors in timings, with hours

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-timings-no-hours.html
    • FAIL [expected TIMEOUT] subtest: Cue timings and various syntax errors in timings, without hours

      assert_equals: expected 4 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-timings-whitespace.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/timings-whitespace.vtt

      assert_equals: expected 12 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-unsupported-markup.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/unsupported-markup.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-utf8.html
    • FAIL [expected TIMEOUT] subtest: UTF-8 encoded characters are recognized properly and different encodings (iconv) are not recognized as a WebVTT file

      assert_equals: expected 2 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-valign.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/valign.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/valign-ltr.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/valign-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-voice.html
    • FAIL [expected TIMEOUT] subtest: Check cues from resources/voice.vtt

      assert_equals: expected 3 but got 0
      

    • FAIL [expected TIMEOUT] subtest: Check cues from resources/voice-bad.vtt

      assert_equals: expected 3 but got 0
      

  • OK /resource-timing/initiator-type/video.html
    • PASS [expected FAIL] subtest: The initiator type for <track src> must be 'track'
  • OK [expected TIMEOUT] /webvtt/api/VTTCue/align.html
    • FAIL [expected TIMEOUT] subtest: VTTCue.align, parsed cue

      can't access property "align", c1 is undefined
      

  • OK [expected TIMEOUT] /webvtt/api/VTTCue/line.html
    • FAIL [expected TIMEOUT] subtest: VTTCue.line, parsed cue

      can't access property "line", c1 is undefined
      

  • OK [expected TIMEOUT] /webvtt/api/VTTCue/snapToLines.html
    • FAIL [expected TIMEOUT] subtest: VTTCue.snapToLines, parsed cue

      can't access property "snapToLines", c1 is undefined
      

  • OK [expected TIMEOUT] /webvtt/api/VTTCue/text.html
    • FAIL [expected TIMEOUT] subtest: VTTCue.text, parsed cue

      can't access property "text", c[0] is undefined
      

  • OK [expected TIMEOUT] /webvtt/api/VTTCue/vertical.html
    • FAIL [expected TIMEOUT] subtest: VTTCue.vertical, parsed cue

      can't access property "vertical", c1 is undefined
      

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

⚠️ Try run (#28751756328) failed!

@TimvdLippe
TimvdLippe force-pushed the implement-text-track-fetching branch 2 times, most recently from 547e2b3 to 29443cd Compare July 6, 2026 07:06
Comment thread components/script/dom/html/htmltrackelement.rs Outdated
Comment thread components/script/dom/html/htmltrackelement.rs
Comment on lines +153 to +155
// Step 8. ⌛ If the track element's parent is a media element,
// then let corsAttributeState be the state of the parent media element's
// crossorigin content attribute. Otherwise, let corsAttributeState be No CORS.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a spec issue? We've returned in step 3 if the parent wasn't a media element.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I am not sure yet how to read the spec here. I think the spec means "this step might run asynchronously and at that point the parent might no longer be a media element". I was planning on asking WHATWG on how to read the spec and then get back to it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point. This makes sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +275 to +277
// Step 3. If value is not the empty string,
// then set trackURL to the result of encoding-parsing-and-serializing a URL given value,
// relative to the element's node document.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind rewrapping this so that line length is more consistent? When all lines flow together without newlines, it is very hard to see where one step starts and another begins with inconsistent line lengths. Editors almost always have rewrapping functionality to do this automatically.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I use VS Code which doesn't appear to do auto-wrapping of text comments. I have updated this text and done my best here to make it readable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd. The vim keybindings in VS Code support this out of the box, but the Rewrap extension seems to do it as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we consider turning on wrap_comments on rustfmt to do this automatically for us? rust-lang/rustfmt#3347

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. I'm not sure it would handle the case where a line was shorter than expected, but it would be an improvement.

Comment thread components/script/dom/html/htmltrackelement.rs Outdated
Comment thread components/script/dom/html/htmltrackelement.rs Outdated
Comment thread components/script/dom/html/htmltrackelement.rs Outdated
Comment on lines +459 to +462
// > If fetching does not fail, and the file was successfully processed,
// > then the final task that is queued by the networking task source,
// > after it has finished parsing the data, must change the text track readiness state to loaded,
// > and fire an event named load at the track element.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that processing here refers to parsing a subtitle file or something of that nature?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is part of the first paragraph of step 10 of https://html.spec.whatwg.org/multipage/media.html#start-the-track-processing-model

The tasks queued by the fetching algorithm on the networking task source to process the data as it is being fetched must determine the type of the resource. If the type of the resource is not a supported text track format, the load will fail, as described below. Otherwise, the resource's data must be passed to the appropriate parser (e.g., the WebVTT parser) as it is received, with the text track list of cues being used for that parser's output. [WEBVTT]

Comment thread components/script/dom/webvtt/texttracklist.rs Outdated
pub(crate) fn tracks_for_kinds(
&self,
text_track_kinds: Vec<TextTrackKind>,
) -> Vec<DomRoot<TextTrack>> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to avoid an allocation here by returning impl Iterators<Item=DomRoot<TextTrack>> and then avoiding the collect(). The caller will have to be a bit careful because all() / any() have tricky semantics when an iterators is empty. I think it might be worth it though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I did consider it, but am not yet well-versed with Rust iterators yet. I will get back to this when we need to implement sorting (https://html.spec.whatwg.org/multipage/media.html#list-of-text-tracks) which we don't do yet. The sorting would fit nicely with an iterator I think.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jul 7, 2026
@TimvdLippe

Copy link
Copy Markdown
Contributor Author

Thank you so much for taking the time to review this @mrobinson !

This is the first step of support for track elements. Now,
at the appropriate times, a request is sent out. The result
of the request is ignored for now, since this PR is already
big enough of its own.

To do so, a text track needs to keep track of whether it is
part of a track element. Then, at the various decision
points, it starts the processing model. This is mostly
implemented in terms of machinery, but not all of its
parallel steps. That's because I have yet to figure out what
they actually mean with "wait until X", whether that just
means to reboot the algorithm or not.

Part of servo#46288

Testing: new WPT tests passing/running.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
@TimvdLippe
TimvdLippe force-pushed the implement-text-track-fetching branch from 29443cd to 548c383 Compare July 7, 2026 09:46
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 7, 2026
@TimvdLippe
TimvdLippe enabled auto-merge July 7, 2026 09:46
@TimvdLippe
TimvdLippe added this pull request to the merge queue Jul 7, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 7, 2026
Merged via the queue into servo:main with commit 065beaf Jul 7, 2026
34 checks passed
@TimvdLippe
TimvdLippe deleted the implement-text-track-fetching branch July 7, 2026 11:14
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants