[Media] Implement loading attribute for video and audio elements [chromium/src : main]

0 views
Skip to first unread message

Yoav Weiss (@Shopify) (Gerrit)

unread,
Jan 24, 2026, 3:26:13 PMJan 24
to Helmut Januschka, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
Attention needed from Helmut Januschka

Yoav Weiss (@Shopify) added 1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Yoav Weiss (@Shopify) . resolved

I haven't reviewed yet, but a couple of high level notes:

  • You probably want to send out an Intent to Ship for this
  • The feature needs to be behind a flag
Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
Gerrit-Change-Number: 7511253
Gerrit-PatchSet: 7
Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Nate Chapin <jap...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
Gerrit-Comment-Date: Sat, 24 Jan 2026 20:25:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Yoav Weiss (@Shopify) (Gerrit)

unread,
Jan 24, 2026, 3:33:31 PMJan 24
to Helmut Januschka, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
Attention needed from Helmut Januschka

Yoav Weiss (@Shopify) added 1 comment

File third_party/blink/renderer/core/html/media/html_video_element.h
Line 279, Patchset 7 (Latest): bool poster_deferred_for_lazy_load_ : 1;
Yoav Weiss (@Shopify) . unresolved

You probably also want to make sure https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/parser/html_preload_scanner.cc;l=579?q=HTMLPreloadScanner&ss=chromium%2Fchromium%2Fsrc is aware of the loading attribute. Otherwise, the resource will be loaded anyway if the tag is part of the initial HTML.

Open in Gerrit

Related details

Attention is currently required from:
  • Helmut Januschka
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
    Gerrit-Change-Number: 7511253
    Gerrit-PatchSet: 7
    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
    Gerrit-CC: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
    Gerrit-Comment-Date: Sat, 24 Jan 2026 20:33:12 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Yoav Weiss (@Shopify) (Gerrit)

    unread,
    Jan 24, 2026, 3:58:12 PMJan 24
    to Helmut Januschka, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
    Attention needed from Helmut Januschka

    Yoav Weiss (@Shopify) added 2 comments

    File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
    Line 1, Patchset 7 (Latest):// Copyright 2025 The Chromium Authors
    Yoav Weiss (@Shopify) . unresolved

    2026..

    Line 86, Patchset 7 (Latest): return settings->GetLazyLoadingMediaMarginPx2G();
    Yoav Weiss (@Shopify) . unresolved

    Can you help me understand where this is defined?

    Gerrit-Comment-Date: Sat, 24 Jan 2026 20:57:53 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Helmut Januschka (Gerrit)

    unread,
    Jan 24, 2026, 5:26:57 PMJan 24
    to Helmut Januschka, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
    Attention needed from Yoav Weiss (@Shopify)

    Helmut Januschka added 4 comments

    Patchset-level comments
    File-level comment, Patchset 8 (Latest):
    Helmut Januschka . resolved

    thanks for taking a first look 🤗

    File third_party/blink/renderer/core/html/media/html_video_element.h
    Line 279, Patchset 7: bool poster_deferred_for_lazy_load_ : 1;
    Yoav Weiss (@Shopify) . resolved

    You probably also want to make sure https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/parser/html_preload_scanner.cc;l=579?q=HTMLPreloadScanner&ss=chromium%2Fchromium%2Fsrc is aware of the loading attribute. Otherwise, the resource will be loaded anyway if the tag is part of the initial HTML.

    Helmut Januschka

    done, thanks for the hint! also added a WPT to validate

    File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
    Line 1, Patchset 7:// Copyright 2025 The Chromium Authors
    Yoav Weiss (@Shopify) . resolved

    2026..

    Helmut Januschka

    Done

    Line 86, Patchset 7: return settings->GetLazyLoadingMediaMarginPx2G();
    Yoav Weiss (@Shopify) . resolved

    Can you help me understand where this is defined?

    Helmut Januschka

    they are defined in `settings.json5`. getters are auto generated, following the same pattern as the existing lazy-loading image margins here (thought it would make sense to have own settings)

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Yoav Weiss (@Shopify)
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
      Gerrit-Change-Number: 7511253
      Gerrit-PatchSet: 8
      Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
      Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
      Gerrit-CC: Nate Chapin <jap...@chromium.org>
      Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
      Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
      Gerrit-Comment-Date: Sat, 24 Jan 2026 22:26:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Yoav Weiss (@Shopify) <yoav...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Yoav Weiss (@Shopify) (Gerrit)

      unread,
      Jan 26, 2026, 4:13:50 AMJan 26
      to Helmut Januschka, Chromium Metrics Reviews, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
      Attention needed from Helmut Januschka

      Yoav Weiss (@Shopify) added 10 comments

      File third_party/blink/renderer/core/frame/settings.json5
      Yoav Weiss (@Shopify) . unresolved

      Are these values matching what we're doing for images/iframes?

      File third_party/blink/renderer/core/html/media/html_media_element.h
      Line 221, Patchset 16 (Latest): void LoadDeferredMediaInternal();
      Yoav Weiss (@Shopify) . unresolved

      The Internal one should be protected/private, right?

      File third_party/blink/renderer/core/html/media/html_media_element.cc
      Line 814, Patchset 16 (Latest): // If the loading attribute is changed to eager while deferred, load now
      Yoav Weiss (@Shopify) . unresolved

      Nit: period (.) at the end of the comment.

      Line 817, Patchset 16 (Latest): LoadDeferredMedia();
      Yoav Weiss (@Shopify) . unresolved

      I'm not super familiar with media element loading. Can you describe the high level flow here? Who loads the media when there's no loading attribute, or when the flag is disabled?

      Line 817, Patchset 16 (Latest): LoadDeferredMedia();
      Yoav Weiss (@Shopify) . unresolved

      The name `LoadDeferredMedia` is not ideal here, as the media is not deferred..

      Line 2875, Patchset 16 (Latest): GetDocument().GetAgent().event_loop()->EnqueueMicrotask(BindOnce(
      Yoav Weiss (@Shopify) . unresolved

      Is this specified?

      File third_party/blink/renderer/core/html/media/html_video_element.h
      Line 279, Patchset 16 (Latest): bool poster_deferred_for_lazy_load_ : 1;
      Yoav Weiss (@Shopify) . unresolved

      Can we appease ClangTidy here? (I'm not sure we can, given the `: 1` and our language support limitations)

      File third_party/blink/renderer/core/html/media/html_video_element.cc
      Yoav Weiss (@Shopify) . unresolved

      The bots claim that this is not covered by tests. Is it?

      File third_party/blink/renderer/platform/runtime_enabled_features.json5
      Yoav Weiss (@Shopify) . unresolved

      I think it's fair to make this "experimental", to make it easier for interested developers to test this

      File third_party/blink/web_tests/VirtualTestSuites
      Line 1900, Patchset 16 (Latest): "prefix": "lazy-load-media",
      Yoav Weiss (@Shopify) . unresolved
      Attention is currently required from:
      • Helmut Januschka
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
        Gerrit-Change-Number: 7511253
        Gerrit-PatchSet: 16
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Fredrik Söderquist <f...@opera.com>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Comment-Date: Mon, 26 Jan 2026 09:13:37 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Helmut Januschka (Gerrit)

        unread,
        Jan 26, 2026, 8:03:23 AMJan 26
        to Helmut Januschka, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Helmut Januschka added 10 comments

        File third_party/blink/renderer/core/frame/settings.json5
        Line 1092, Patchset 16: //
        Yoav Weiss (@Shopify) . resolved

        Are these values matching what we're doing for images/iframes?

        Helmut Januschka

        yes they match the images ones, keeping them separate still makes sense i guess to be able to separatly tune in the future!

        File third_party/blink/renderer/core/html/media/html_media_element.h
        Line 221, Patchset 16: void LoadDeferredMediaInternal();
        Yoav Weiss (@Shopify) . resolved

        The Internal one should be protected/private, right?

        Helmut Januschka

        Done

        File third_party/blink/renderer/core/html/media/html_media_element.cc
        Line 814, Patchset 16: // If the loading attribute is changed to eager while deferred, load now
        Yoav Weiss (@Shopify) . resolved

        Nit: period (.) at the end of the comment.

        Helmut Januschka

        Done

        Line 817, Patchset 16: LoadDeferredMedia();
        Yoav Weiss (@Shopify) . unresolved

        The name `LoadDeferredMedia` is not ideal here, as the media is not deferred..

        Helmut Januschka

        how about EnsureMediaLoading?

        Line 817, Patchset 16: LoadDeferredMedia();
        Yoav Weiss (@Shopify) . resolved

        I'm not super familiar with media element loading. Can you describe the high level flow here? Who loads the media when there's no loading attribute, or when the flag is disabled?

        Helmut Januschka

        **Normal flow (flag disabled or no loading attr):**
        `load()` -> `LoadInternal()` -> `SelectMediaResource()` proceeds immediately with network loading.

        **With lazy loading enabled + loading="lazy":**
        At the start of `SelectMediaResource()`, we check `LazyMediaHelper::ShouldDeferMediaLoad()`. If true, we set state to `kDeferred`, start IntersectionObserver monitoring, and return early (no network request yet).


        When the element becomes visible (or loading attr changes to "eager"), `EnsureMediaLoading()` resumes `SelectMediaResource()` to do the actual load.

        Line 2875, Patchset 16: GetDocument().GetAgent().event_loop()->EnqueueMicrotask(BindOnce(
        Yoav Weiss (@Shopify) . unresolved

        Is this specified?

        Helmut Januschka

        The microtask posting follows the same pattern as lazy-loaded images (to avoid re-entrancy when called from IntersectionObserver callbacks or during attribute parsing). havent done a spec update so far, where should i add this? or should i ping scott about it?

        File third_party/blink/renderer/core/html/media/html_video_element.h
        Line 279, Patchset 16: bool poster_deferred_for_lazy_load_ : 1;
        Yoav Weiss (@Shopify) . resolved

        Can we appease ClangTidy here? (I'm not sure we can, given the `: 1` and our language support limitations)

        Helmut Januschka

        well it does not work! also it would break existign patterns with default initialized fields. so guess we'd need to keep it as is.

        File third_party/blink/renderer/core/html/media/html_video_element.cc
        Line 188, Patchset 16: return;
        Yoav Weiss (@Shopify) . resolved

        The bots claim that this is not covered by tests. Is it?

        Helmut Januschka

        added tests! should be covered now

        File third_party/blink/renderer/platform/runtime_enabled_features.json5
        Line 3222, Patchset 16: status: "test",
        Yoav Weiss (@Shopify) . resolved

        I think it's fair to make this "experimental", to make it easier for interested developers to test this

        Helmut Januschka

        Done

        File third_party/blink/web_tests/VirtualTestSuites
        Line 1900, Patchset 16: "prefix": "lazy-load-media",
        Yoav Weiss (@Shopify) . resolved
        Helmut Januschka

        thx, forgot about experimental being run :/

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Yoav Weiss (@Shopify)
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
        Gerrit-Change-Number: 7511253
        Gerrit-PatchSet: 17
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Fredrik Söderquist <f...@opera.com>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-Comment-Date: Mon, 26 Jan 2026 13:03:07 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Yoav Weiss (@Shopify) (Gerrit)

        unread,
        Jan 26, 2026, 8:44:09 AMJan 26
        to Helmut Januschka, Chromium Metrics Reviews, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
        Attention needed from Helmut Januschka

        Yoav Weiss (@Shopify) added 2 comments

        File third_party/blink/renderer/core/html/media/html_media_element.cc
        Line 817, Patchset 16: LoadDeferredMedia();
        Yoav Weiss (@Shopify) . unresolved

        The name `LoadDeferredMedia` is not ideal here, as the media is not deferred..

        Helmut Januschka

        how about EnsureMediaLoading?

        Yoav Weiss (@Shopify)

        Your flow explanation actually convinced me that `LoadDeferredMedia` (or `LoadDeferredMediaIfNeeded`) is actually better 😊

        Apologies for the noise!

        Line 2875, Patchset 16: GetDocument().GetAgent().event_loop()->EnqueueMicrotask(BindOnce(
        Yoav Weiss (@Shopify) . unresolved

        Is this specified?

        Helmut Januschka

        The microtask posting follows the same pattern as lazy-loaded images (to avoid re-entrancy when called from IntersectionObserver callbacks or during attribute parsing). havent done a spec update so far, where should i add this? or should i ping scott about it?

        Yoav Weiss (@Shopify)

        This should be part of the spec that Scott is pushing.

        If this is needed here, it's probably needed in the specification as well (As I'm guessing the spec also relies on IntersectionObserver concepts). Also, this would be observable, so we should make sure it's as interoperable as it can be.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Helmut Januschka
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
        Gerrit-Change-Number: 7511253
        Gerrit-PatchSet: 17
        Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
        Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
        Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
        Gerrit-CC: Fredrik Söderquist <f...@opera.com>
        Gerrit-CC: Nate Chapin <jap...@chromium.org>
        Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
        Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
        Gerrit-Comment-Date: Mon, 26 Jan 2026 13:43:55 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Helmut Januschka (Gerrit)

        unread,
        Jan 28, 2026, 4:20:01 PMJan 28
        to Helmut Januschka, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
        Attention needed from Yoav Weiss (@Shopify)

        Helmut Januschka added 3 comments

        Patchset-level comments
        File-level comment, Patchset 24 (Latest):
        Helmut Januschka . resolved

        also synced the wpt tests from PR

        File third_party/blink/renderer/core/html/media/html_media_element.cc
        Line 817, Patchset 16: LoadDeferredMedia();
        Yoav Weiss (@Shopify) . resolved

        The name `LoadDeferredMedia` is not ideal here, as the media is not deferred..

        Helmut Januschka

        how about EnsureMediaLoading?

        Yoav Weiss (@Shopify)

        Your flow explanation actually convinced me that `LoadDeferredMedia` (or `LoadDeferredMediaIfNeeded`) is actually better 😊

        Apologies for the noise!

        Helmut Januschka

        Done

        Line 2875, Patchset 16: GetDocument().GetAgent().event_loop()->EnqueueMicrotask(BindOnce(
        Yoav Weiss (@Shopify) . resolved

        Is this specified?

        Helmut Januschka

        The microtask posting follows the same pattern as lazy-loaded images (to avoid re-entrancy when called from IntersectionObserver callbacks or during attribute parsing). havent done a spec update so far, where should i add this? or should i ping scott about it?

        Yoav Weiss (@Shopify)

        This should be part of the spec that Scott is pushing.

        If this is needed here, it's probably needed in the specification as well (As I'm guessing the spec also relies on IntersectionObserver concepts). Also, this would be observable, so we should make sure it's as interoperable as it can be.

        Helmut Januschka

        forwarded and talked with scott

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Yoav Weiss (@Shopify)
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
          Gerrit-Change-Number: 7511253
          Gerrit-PatchSet: 24
          Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
          Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: Fredrik Söderquist <f...@opera.com>
          Gerrit-CC: Nate Chapin <jap...@chromium.org>
          Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
          Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
          Gerrit-Comment-Date: Wed, 28 Jan 2026 21:19:44 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Yoav Weiss (@Shopify) (Gerrit)

          unread,
          Feb 11, 2026, 12:33:48 AM (yesterday) Feb 11
          to Helmut Januschka, Dale Curtis, Chromium Metrics Reviews, Fredrik Söderquist, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
          Attention needed from Dale Curtis and Helmut Januschka

          Yoav Weiss (@Shopify) added 4 comments

          Yoav Weiss (@Shopify) . resolved

          Dale - the overall approach seems reasonable to me, but can you take a closer look at the media loading bits? I think you're more familiar with them than me 😊

          File third_party/blink/renderer/core/html/media/html_video_element.cc
          Yoav Weiss (@Shopify) . unresolved

          Is this covered by tests? The bots are complaining..

          Line 247, Patchset 29 (Latest): poster_deferred_for_lazy_load_ = true;
          Yoav Weiss (@Shopify) . unresolved

          Is this covered by tests?

          File third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
          Yoav Weiss (@Shopify) . unresolved

          Is this covered by tests?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Dale Curtis
          • Helmut Januschka
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
            Gerrit-Change-Number: 7511253
            Gerrit-PatchSet: 29
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Fredrik Söderquist <f...@opera.com>
            Gerrit-CC: Nate Chapin <jap...@chromium.org>
            Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
            Gerrit-Comment-Date: Wed, 11 Feb 2026 05:33:30 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Dale Curtis (Gerrit)

            unread,
            Feb 11, 2026, 1:43:27 PM (11 hours ago) Feb 11
            to Helmut Januschka, Benjamin Keen, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
            Attention needed from Benjamin Keen and Helmut Januschka

            Dale Curtis added 8 comments

            File third_party/blink/renderer/core/html/media/html_media_element.cc
            Line 816, Patchset 29 (Latest): if (loading == LoadingAttributeValue::kEager) {
            Dale Curtis . unresolved

            Did you want to check that the old_value wasn't already eager?

            Line 1252, Patchset 29 (Latest): // Check for lazy loading - defer resource selection if loading=lazy
            Dale Curtis . unresolved

            This could use some more explanation. The header suggest that LazyMediaLoadState::kNone means lazy loading isn't used, so some notes on why we're switching to lazy loading here would be helpful.

            Line 2874, Patchset 29 (Latest): if (lazy_media_load_state_ != LazyMediaLoadState::kDeferred) {
            Dale Curtis . unresolved

            DCHECK runtime feature is enabled?

            Line 2891, Patchset 29 (Latest): // Check that we're still in the right state (element may have been removed
            Dale Curtis . unresolved

            DCHECk feature enabled.

            File third_party/blink/renderer/core/html/media/html_video_element.h
            Line 288, Patchset 29 (Latest): bool poster_deferred_for_lazy_load_ : 1;
            Dale Curtis . unresolved

            Please fix this WARNING reported by ClangTidy: check: modernize-use-default-member-init

            use default member initializer for 'po...

            check: modernize-use-default-member-init

            use default member initializer for 'poster_deferred_for_lazy_load_' (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)

            (Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-default-member-init` footer to the CL description to skip the check)

            (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

            File third_party/blink/renderer/core/html/media/html_video_element.cc
            Line 176, Patchset 29 (Latest): !FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
            Dale Curtis . unresolved

            Do you also need to check that it has no source children?

            Line 252, Patchset 29 (Latest): if (!FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
            Dale Curtis . unresolved

            Ditto on source elements

            File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
            Line 25, Patchset 29 (Latest): if (!lazy_load_intersection_observer_) {
            Dale Curtis . unresolved

            We already have a couple other intersection observers attached to the video element. I'm wondering if we should be sharing these instead of adding new ones. This does use params the others don't though.

            https://source.chromium.org/search?ss=chromium&q=IntersectionObserver::Create%20file:media%2F

            We even already have one called lazy load intersection observer:

            We should at least differentiate between that last one.

            IIRC, each of these has a non-trivial cost. @bk...@google.com for his thoughts since he implemented MediaVideoVisibilityTracker.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Benjamin Keen
            • Helmut Januschka
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
            Gerrit-Change-Number: 7511253
            Gerrit-PatchSet: 29
            Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
            Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
            Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
            Gerrit-CC: Benjamin Keen <bk...@google.com>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: Fredrik Söderquist <f...@opera.com>
            Gerrit-CC: Nate Chapin <jap...@chromium.org>
            Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
            Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
            Gerrit-Attention: Benjamin Keen <bk...@google.com>
            Gerrit-Comment-Date: Wed, 11 Feb 2026 18:43:16 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Benjamin Keen (Gerrit)

            unread,
            Feb 11, 2026, 2:58:00 PM (10 hours ago) Feb 11
            to Helmut Januschka, Dale Curtis, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
            Attention needed from Helmut Januschka

            Benjamin Keen added 1 comment

            File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
            Line 25, Patchset 29 (Latest): if (!lazy_load_intersection_observer_) {
            Dale Curtis . unresolved

            We already have a couple other intersection observers attached to the video element. I'm wondering if we should be sharing these instead of adding new ones. This does use params the others don't though.

            https://source.chromium.org/search?ss=chromium&q=IntersectionObserver::Create%20file:media%2F

            We even already have one called lazy load intersection observer:

            We should at least differentiate between that last one.

            IIRC, each of these has a non-trivial cost. @bk...@google.com for his thoughts since he implemented MediaVideoVisibilityTracker.

            Benjamin Keen

            I am not too concerned here. The cost increases significantly when tracking visibility, and this observer is not created using the `track_visibility` param.

            I also share Dale's concern regarding the various intersection observers we have. For the scope of this CL, I wonder if we could just have one observer for image/media lazy load, since the [lazy_load_image_observer](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/lazy_load_image_observer.h;drc=899b3f1c8d928409caee3a12d17c62691fec793c) is very similar to this one.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Helmut Januschka
            Gerrit-Comment-Date: Wed, 11 Feb 2026 19:57:52 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Helmut Januschka (Gerrit)

            unread,
            Feb 11, 2026, 5:42:26 PM (7 hours ago) Feb 11
            to Helmut Januschka, Benjamin Keen, Dale Curtis, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
            Attention needed from Benjamin Keen, Dale Curtis and Yoav Weiss (@Shopify)

            Helmut Januschka voted and added 11 comments

            Votes added by Helmut Januschka

            Commit-Queue+1

            11 comments

            File third_party/blink/renderer/core/html/media/html_media_element.cc
            Line 816, Patchset 29: if (loading == LoadingAttributeValue::kEager) {
            Dale Curtis . resolved

            Did you want to check that the old_value wasn't already eager?

            Helmut Januschka

            Done. Added a check that the old value wasn't already eager before calling LoadDeferredMediaIfNeeded().

            Line 1252, Patchset 29: // Check for lazy loading - defer resource selection if loading=lazy
            Dale Curtis . resolved

            This could use some more explanation. The header suggest that LazyMediaLoadState::kNone means lazy loading isn't used, so some notes on why we're switching to lazy loading here would be helpful.

            Helmut Januschka

            Done. Expanded the comment to explain that kNone is the initial state before any lazy loading decision.

            Line 2874, Patchset 29: if (lazy_media_load_state_ != LazyMediaLoadState::kDeferred) {
            Dale Curtis . resolved

            DCHECK runtime feature is enabled?

            Helmut Januschka

            Done

            Line 2891, Patchset 29: // Check that we're still in the right state (element may have been removed
            Dale Curtis . resolved

            DCHECk feature enabled.

            Helmut Januschka

            Done

            File third_party/blink/renderer/core/html/media/html_video_element.h
            Line 288, Patchset 29: bool poster_deferred_for_lazy_load_ : 1;
            Dale Curtis . resolved

            Please fix this WARNING reported by ClangTidy: check: modernize-use-default-member-init

            use default member initializer for 'po...

            check: modernize-use-default-member-init

            use default member initializer for 'poster_deferred_for_lazy_load_' (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)

            (Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-default-member-init` footer to the CL description to skip the check)

            (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

            Helmut Januschka

            Done

            File third_party/blink/renderer/core/html/media/html_video_element.cc
            Line 176, Patchset 29: !FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
            Dale Curtis . resolved

            Do you also need to check that it has no source children?

            Helmut Januschka

            Done.

            Line 220, Patchset 29: return;
            Yoav Weiss (@Shopify) . resolved

            Is this covered by tests? The bots are complaining..

            Helmut Januschka

            Done. The new `PosterDeferredViaUpdatePosterImageInternal` test in html_video_element_test.cc covers this path.

            Line 247, Patchset 29: poster_deferred_for_lazy_load_ = true;
            Yoav Weiss (@Shopify) . resolved

            Is this covered by tests?

            Helmut Januschka

            Done. The `PosterDeferredViaUpdatePosterImageInternal` test covers `UpdatePosterImageInternal()`

            Line 252, Patchset 29: if (!FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
            Dale Curtis . resolved

            Ditto on source elements

            Helmut Januschka

            Done

            File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
            Line 25, Patchset 29: if (!lazy_load_intersection_observer_) {
            Dale Curtis . resolved

            We already have a couple other intersection observers attached to the video element. I'm wondering if we should be sharing these instead of adding new ones. This does use params the others don't though.

            https://source.chromium.org/search?ss=chromium&q=IntersectionObserver::Create%20file:media%2F

            We even already have one called lazy load intersection observer:

            We should at least differentiate between that last one.

            IIRC, each of these has a non-trivial cost. @bk...@google.com for his thoughts since he implemented MediaVideoVisibilityTracker.

            Benjamin Keen

            I am not too concerned here. The cost increases significantly when tracking visibility, and this observer is not created using the `track_visibility` param.

            I also share Dale's concern regarding the various intersection observers we have. For the scope of this CL, I wonder if we could just have one observer for image/media lazy load, since the [lazy_load_image_observer](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/lazy_load_image_observer.h;drc=899b3f1c8d928409caee3a12d17c62691fec793c) is very similar to this one.

            Helmut Januschka

            good idea, merged them into LazyLoadMediaObserver with one IntersectionObserver per document, handling images, video, and audio. Deleted LazyLoadImageObserver entirely. Reusing the existing image margin settings for all media types.

            File third_party/blink/renderer/core/html/parser/html_preload_scanner.cc
            Line 355, Patchset 29: return nullptr;
            Yoav Weiss (@Shopify) . resolved

            Is this covered by tests?

            Helmut Januschka

            Done. Added `LazyLoadVideoPoster` test in `html_preload_scanner_test.cc` that verifies the preload scanner skips video poster preloads when `loading="lazy"` is set, and allows them for eager/auto/no-attribute cases.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Benjamin Keen
            • Dale Curtis
            • Yoav Weiss (@Shopify)
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
              Gerrit-Change-Number: 7511253
              Gerrit-PatchSet: 31
              Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
              Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
              Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
              Gerrit-CC: Benjamin Keen <bk...@google.com>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: Fredrik Söderquist <f...@opera.com>
              Gerrit-CC: Nate Chapin <jap...@chromium.org>
              Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
              Gerrit-Attention: Benjamin Keen <bk...@google.com>
              Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
              Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
              Gerrit-Comment-Date: Wed, 11 Feb 2026 22:42:09 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: Yes
              Comment-In-Reply-To: Benjamin Keen <bk...@google.com>
              Comment-In-Reply-To: Yoav Weiss (@Shopify) <yoav...@chromium.org>
              Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Dale Curtis (Gerrit)

              unread,
              Feb 11, 2026, 5:54:53 PM (7 hours ago) Feb 11
              to Helmut Januschka, Benjamin Keen, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
              Attention needed from Benjamin Keen, Helmut Januschka and Yoav Weiss (@Shopify)

              Dale Curtis added 4 comments

              File third_party/blink/renderer/core/html/media/html_video_element.h
              Line 288, Patchset 29: bool poster_deferred_for_lazy_load_ : 1;
              Dale Curtis . unresolved

              Please fix this WARNING reported by ClangTidy: check: modernize-use-default-member-init

              use default member initializer for 'po...

              check: modernize-use-default-member-init

              use default member initializer for 'poster_deferred_for_lazy_load_' (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)

              (Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-default-member-init` footer to the CL description to skip the check)

              (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

              Helmut Januschka

              Done

              Dale Curtis

              I'd go ahead and fix all the nearby ones too, but up to you.

              File third_party/blink/renderer/core/html/media/html_video_element.cc
              Line 176, Patchset 29: !FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
              Dale Curtis . unresolved

              Do you also need to check that it has no source children?

              Helmut Januschka

              Done.

              Dale Curtis

              I'm surprised we don't have a HasSources() type method already. Since you use this in a couple places, a helper function to share this logic would be helpful.

              File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
              Line 25, Patchset 29: if (!lazy_load_intersection_observer_) {
              Dale Curtis . unresolved

              We already have a couple other intersection observers attached to the video element. I'm wondering if we should be sharing these instead of adding new ones. This does use params the others don't though.

              https://source.chromium.org/search?ss=chromium&q=IntersectionObserver::Create%20file:media%2F

              We even already have one called lazy load intersection observer:

              We should at least differentiate between that last one.

              IIRC, each of these has a non-trivial cost. @bk...@google.com for his thoughts since he implemented MediaVideoVisibilityTracker.

              Benjamin Keen

              I am not too concerned here. The cost increases significantly when tracking visibility, and this observer is not created using the `track_visibility` param.

              I also share Dale's concern regarding the various intersection observers we have. For the scope of this CL, I wonder if we could just have one observer for image/media lazy load, since the [lazy_load_image_observer](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/lazy_load_image_observer.h;drc=899b3f1c8d928409caee3a12d17c62691fec793c) is very similar to this one.

              Helmut Januschka

              good idea, merged them into LazyLoadMediaObserver with one IntersectionObserver per document, handling images, video, and audio. Deleted LazyLoadImageObserver entirely. Reusing the existing image margin settings for all media types.

              Line 31, Patchset 31 (Latest):bool IsElementInInvisibleSubTree(const Element& element) {
              Dale Curtis . unresolved

              Does `Element::checkVisibility` do what you want to do here?

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Benjamin Keen
              • Helmut Januschka
              • Yoav Weiss (@Shopify)
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
                Gerrit-Change-Number: 7511253
                Gerrit-PatchSet: 31
                Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
                Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
                Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                Gerrit-CC: Benjamin Keen <bk...@google.com>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                Gerrit-CC: Nate Chapin <jap...@chromium.org>
                Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
                Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
                Gerrit-Attention: Benjamin Keen <bk...@google.com>
                Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                Gerrit-Comment-Date: Wed, 11 Feb 2026 22:54:38 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: Helmut Januschka <hel...@januschka.com>
                Comment-In-Reply-To: Benjamin Keen <bk...@google.com>
                Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Helmut Januschka (Gerrit)

                unread,
                Feb 11, 2026, 7:26:53 PM (6 hours ago) Feb 11
                to Helmut Januschka, Benjamin Keen, Dale Curtis, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
                Attention needed from Benjamin Keen, Dale Curtis and Yoav Weiss (@Shopify)

                Helmut Januschka added 4 comments

                File third_party/blink/renderer/core/html/media/html_video_element.h
                Line 288, Patchset 29: bool poster_deferred_for_lazy_load_ : 1;
                Dale Curtis . resolved

                Please fix this WARNING reported by ClangTidy: check: modernize-use-default-member-init

                use default member initializer for 'po...

                check: modernize-use-default-member-init

                use default member initializer for 'poster_deferred_for_lazy_load_' (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-default-member-init.html)

                (Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-default-member-init` footer to the CL description to skip the check)

                (Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

                Helmut Januschka

                Done

                Dale Curtis

                I'd go ahead and fix all the nearby ones too, but up to you.

                Helmut Januschka

                Done. Moved `is_persistent_`, `is_auto_picture_in_picture_`, `is_effectively_fullscreen_`, `video_has_played_`, and `mostly_filling_viewport_` to use default member initializers in the header and removed them from the constructor initializer list.

                File third_party/blink/renderer/core/html/media/html_video_element.cc
                Line 176, Patchset 29: !FastHasAttribute(html_names::kSrcAttr) && GetDocument().GetFrame()) {
                Dale Curtis . resolved

                Do you also need to check that it has no source children?

                Helmut Januschka

                Done.

                Dale Curtis

                I'm surprised we don't have a HasSources() type method already. Since you use this in a couple places, a helper function to share this logic would be helpful.

                Helmut Januschka

                Done. Added `HasMediaSources()` to `HTMLMediaElement` that checks for src attribute, srcObject, or `<source>` child elements. Replaced the two occurrences in `html_video_element.cc`.

                File third_party/blink/renderer/core/html/media/lazy_load_media_observer.cc
                Line 25, Patchset 29: if (!lazy_load_intersection_observer_) {
                Dale Curtis . resolved

                We already have a couple other intersection observers attached to the video element. I'm wondering if we should be sharing these instead of adding new ones. This does use params the others don't though.

                https://source.chromium.org/search?ss=chromium&q=IntersectionObserver::Create%20file:media%2F

                We even already have one called lazy load intersection observer:

                We should at least differentiate between that last one.

                IIRC, each of these has a non-trivial cost. @bk...@google.com for his thoughts since he implemented MediaVideoVisibilityTracker.

                Benjamin Keen

                I am not too concerned here. The cost increases significantly when tracking visibility, and this observer is not created using the `track_visibility` param.

                I also share Dale's concern regarding the various intersection observers we have. For the scope of this CL, I wonder if we could just have one observer for image/media lazy load, since the [lazy_load_image_observer](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/lazy_load_image_observer.h;drc=899b3f1c8d928409caee3a12d17c62691fec793c) is very similar to this one.

                Helmut Januschka

                good idea, merged them into LazyLoadMediaObserver with one IntersectionObserver per document, handling images, video, and audio. Deleted LazyLoadImageObserver entirely. Reusing the existing image margin settings for all media types.

                Dale Curtis

                This is mostly done, but https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/media/html_video_element.cc;l=439;drc=56fe0f6dc9d67cc5fef1036a7e58aea477aa26a0 still needs to be differentiated somehow.

                Helmut Januschka

                Done

                Line 31, Patchset 31:bool IsElementInInvisibleSubTree(const Element& element) {
                Dale Curtis . resolved

                Does `Element::checkVisibility` do what you want to do here?

                Helmut Januschka

                Replaced `IsElementInInvisibleSubTree` with `Element::checkVisibility()` and removed the custom function entirely.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Benjamin Keen
                • Dale Curtis
                • Yoav Weiss (@Shopify)
                Submit Requirements:
                  • requirement satisfiedCode-Coverage
                  • requirement is not satisfiedCode-Owners
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedReview-Enforcement
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: chromium/src
                  Gerrit-Branch: main
                  Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
                  Gerrit-Change-Number: 7511253
                  Gerrit-PatchSet: 32
                  Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
                  Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                  Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
                  Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                  Gerrit-CC: Benjamin Keen <bk...@google.com>
                  Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                  Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                  Gerrit-CC: Nate Chapin <jap...@chromium.org>
                  Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
                  Gerrit-Attention: Benjamin Keen <bk...@google.com>
                  Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                  Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
                  Gerrit-Comment-Date: Thu, 12 Feb 2026 00:26:33 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Dale Curtis (Gerrit)

                  unread,
                  Feb 11, 2026, 7:35:21 PM (5 hours ago) Feb 11
                  to Helmut Januschka, Benjamin Keen, Chromium Metrics Reviews, Fredrik Söderquist, Yoav Weiss (@Shopify), AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Nate Chapin, srirama chandra sekhar, cblume...@chromium.org, devtools...@chromium.org, penghuan...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, silv...@chromium.org, gl...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, gavinp...@chromium.org, jmedle...@chromium.org, loading...@chromium.org
                  Attention needed from Benjamin Keen, Helmut Januschka and Yoav Weiss (@Shopify)

                  Dale Curtis voted and added 4 comments

                  Votes added by Dale Curtis

                  Code-Review+1

                  4 comments

                  Patchset-level comments
                  File-level comment, Patchset 32 (Latest):
                  Dale Curtis . resolved

                  lgtm % some minor nits.

                  File third_party/blink/renderer/core/html/media/html_media_element.cc
                  Line 1256, Patchset 32 (Latest): // We only defer when lazy_media_load_state_ is kNone, which is the initial
                  Dale Curtis . unresolved

                  back ticks around lazy_media_load_state_

                  File third_party/blink/renderer/core/html/media/html_video_element.h
                  Line 275, Patchset 32 (Latest): bool in_overlay_fullscreen_video_ : 1;
                  Dale Curtis . unresolved

                  Give this a default value of `false` while you're here?

                  File third_party/blink/renderer/core/html/media/html_video_element.cc
                  Line 98, Patchset 32 (Latest): remoting_interstitial_(nullptr),
                  Dale Curtis . unresolved

                  Remove these nullptr since that's the default.

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Benjamin Keen
                  • Helmut Januschka
                  • Yoav Weiss (@Shopify)
                  Submit Requirements:
                    • requirement satisfiedCode-Coverage
                    • requirement is not satisfiedCode-Owners
                    • requirement satisfiedCode-Review
                    • requirement is not satisfiedNo-Unresolved-Comments
                    • requirement satisfiedReview-Enforcement
                    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                    Gerrit-MessageType: comment
                    Gerrit-Project: chromium/src
                    Gerrit-Branch: main
                    Gerrit-Change-Id: I4ace957d4f94352596f6e23459bf83c6e96ca11c
                    Gerrit-Change-Number: 7511253
                    Gerrit-PatchSet: 32
                    Gerrit-Owner: Helmut Januschka <hel...@januschka.com>
                    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
                    Gerrit-Reviewer: Helmut Januschka <hel...@januschka.com>
                    Gerrit-Reviewer: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                    Gerrit-CC: Benjamin Keen <bk...@google.com>
                    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                    Gerrit-CC: Nate Chapin <jap...@chromium.org>
                    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
                    Gerrit-Attention: Helmut Januschka <hel...@januschka.com>
                    Gerrit-Attention: Benjamin Keen <bk...@google.com>
                    Gerrit-Attention: Yoav Weiss (@Shopify) <yoav...@chromium.org>
                    Gerrit-Comment-Date: Thu, 12 Feb 2026 00:35:10 +0000
                    Gerrit-HasComments: Yes
                    Gerrit-Has-Labels: Yes
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy
                    Reply all
                    Reply to author
                    Forward
                    0 new messages