[APC] Trigger content extraction auto-build via DOMContentLoaded [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Jan 8, 2026, 12:25:44 PM (9 days ago) Jan 8
to Aaron Leventhal, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

AI Code Reviewer added 2 comments

File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
Line 160, Patchset 1 (Latest): WebViewImpl* web_view = document.GetPage()->GetChromeClient().GetWebView();
AI Code Reviewer . unresolved

Implicit downcast from 'WebView*' to 'WebViewImpl*' is invalid C++. Use 'static_cast<WebViewImpl*>' if the instance is known to be a WebViewImpl.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Line 1251, Patchset 1 (Latest): WrapWeakPersistent(this)));
AI Code Reviewer . unresolved

Verify namespace for BindOnce. 'PostTask' expects a 'base::OnceClosure', so 'base::BindOnce' is likely intended. 'blink::BindOnce' may not exist or is non-standard.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention set is empty
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: I61e6789337029138914ea0c10dd26de2f83e18da
Gerrit-Change-Number: 7409289
Gerrit-PatchSet: 1
Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Comment-Date: Thu, 08 Jan 2026 17:25:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Aaron Leventhal (Gerrit)

unread,
Jan 8, 2026, 3:48:40 PM (9 days ago) Jan 8
to AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

Aaron Leventhal voted and added 2 comments

Votes added by Aaron Leventhal

Commit-Queue+1

2 comments

File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
Line 160, Patchset 1 (Latest): WebViewImpl* web_view = document.GetPage()->GetChromeClient().GetWebView();
AI Code Reviewer . resolved

Implicit downcast from 'WebView*' to 'WebViewImpl*' is invalid C++. Use 'static_cast<WebViewImpl*>' if the instance is known to be a WebViewImpl.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Aaron Leventhal
Invalid: ChromeClient::GetWebView() already returns WebViewImpl* (see third_party/blink/renderer/core/page/chrome_client.h), so
there’s no downcast at third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc.
Line 1251, Patchset 1 (Latest): WrapWeakPersistent(this)));
AI Code Reviewer . resolved

Verify namespace for BindOnce. 'PostTask' expects a 'base::OnceClosure', so 'base::BindOnce' is likely intended. 'blink::BindOnce' may not exist or is non-standard.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Aaron Leventhal

blink::BindOnce is defined in third_party/blink/renderer/platform/wtf/functional.h Invalid: and returns a base::OnceCallback, which satisfies PostTask, so no namespace change needed.

Open in Gerrit

Related details

Attention set is empty
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: I61e6789337029138914ea0c10dd26de2f83e18da
    Gerrit-Change-Number: 7409289
    Gerrit-PatchSet: 1
    Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
    Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 20:48:33 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Aaron Leventhal (Gerrit)

    unread,
    Jan 8, 2026, 3:50:27 PM (9 days ago) Jan 8
    to Khushal Sagar, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Khushal Sagar

    Aaron Leventhal voted and added 1 comment

    Votes added by Aaron Leventhal

    Commit-Queue+1

    1 comment

    Patchset-level comments
    File-level comment, Patchset 2 (Latest):
    Aaron Leventhal . resolved

    See also the followup CL in https://chromium-review.googlesource.com/c/chromium/src/+/7416700 that fixes the remaining DCHECKs caused by throttling and display locking.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Khushal Sagar
    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: I61e6789337029138914ea0c10dd26de2f83e18da
    Gerrit-Change-Number: 7409289
    Gerrit-PatchSet: 2
    Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
    Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
    Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Comment-Date: Thu, 08 Jan 2026 20:50:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Khushal Sagar (Gerrit)

    unread,
    Jan 9, 2026, 5:20:25 PM (8 days ago) Jan 9
    to Aaron Leventhal, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
    Attention needed from Aaron Leventhal

    Khushal Sagar added 7 comments

    File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.h
    Line 73, Patchset 2 (Latest):#if DCHECK_IS_ON()
    // Called by the DOMContentLoaded listener to kick off auto-build, which
    // is used by test infrastructure to ensure we run cleanly, without triggering
    // crashes or checks/dchecks.
    void RunAutoBuildAfterDOMContentLoaded();
    #endif
    Khushal Sagar . unresolved

    Could we put this stuff in another class. Make it a friend class to this one if needed but just to isolate code which is test only.

    File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
    Line 1196, Patchset 2 (Latest):#if DCHECK_IS_ON()
    Khushal Sagar . unresolved

    why is this needed? the whole function is already in a DCHECK block.

    Line 1198, Patchset 2 (Latest): // tests and browser tests. Blink unit tests assert specific lifecycle
    // invariants and are not a good target for this feature. We use a binary-name
    Khushal Sagar . unresolved

    I'd like to understand what invariants we're talking about. Maybe there's test only APIs to suppress ones which don't make sense.

    I'm also curious to see if this is an issue with the approach of using the lifecycle observer which ensures the lifecycle is in clean state. We shouldn't be hitting invariants in that case.

    Line 1199, Patchset 2 (Latest): // invariants and are not a good target for this feature. We use a binary-name
    // check (see WebTestSupport) to avoid broad unit-test fallout while keeping
    // the coverage benefits for web tests.
    Khushal Sagar . unresolved

    why are unit-tests hitting this? This is an opt-in triggered by EnableAutomaticActionableExtractionOnPageLoadForTesting. Can't we prevent unit-tests from calling this opt-in?

    Line 1223, Patchset 2 (Latest): // When tracing is active (e.g. inspector-protocol tracing tests), auto-build
    // can emit list-based HitTest trace events that change the expected trace
    // payload shape. Skip auto-build in that case to keep tracing output stable.
    Khushal Sagar . unresolved

    Sorry what tracing are we talking about here? I'm not following how that impacts the web tests.

    Line 1234, Patchset 2 (Latest): if (!AreAllDocumentsReadyForAutoBuild(*document)) {
    // Retry after a task turn so we don't re-enter from within lifecycle-
    // sensitive scopes. This keeps the auto-build loop simple while waiting
    // for lifecycle state to settle.
    const bool was_registered = is_lifecycle_observer_registered_;
    EnsureLifecycleObserverRegistered();
    if (!was_registered) {
    LocalFrameView* view = document->View();
    Page* page = document->GetPage();
    LocalFrame* frame = document->GetFrame();
    if (view && page && frame && !page->Animator().IsServicingAnimations()) {
    page->Animator().ScheduleVisualUpdate(frame);
    }
    document->GetTaskRunner(TaskType::kInternalUserInteraction)
    ->PostTask(FROM_HERE,
    blink::BindOnce(
    &AIPageContentAgent::RunAutoBuildAfterDOMContentLoaded,
    WrapWeakPersistent(this)));
    }
    return;
    }
    Khushal Sagar . unresolved

    Could we reuse the [LifecycleNotificationObserver](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/local_frame_view.h;l=156;drc=a9f09a1411a697ace066a84efd018f49c28cc8a3). It's purpose-built for work that needs to happen when the lifecycle is clean. Seems more robust than the approach here which triggers an animation frame and then posts a task hoping the document state will permit running the lifecycle using `IsDocumentReadyForAutoBuild`.

    cc-ing szager who's familiar with the lifecycle stuff and can advise on the right pattern.

    File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
    Line 2025, Patchset 2 (Latest): // Enable the auto-build path and then simulate DOMContentLoaded dispatch
    // still being in progress by forcing the parsing state to "in DCL".
    AIPageContentAgent::EnableAutomaticActionableExtractionOnPageLoadForTesting(
    *helper_.LocalMainFrame()->GetFrame());
    Khushal Sagar . unresolved

    This shouldn't be necessary since you're invoking `RunAutoBuildAfterDOMContentLoaded` after this explicitly. In fact the code has a check to ignore this call in unit-test builds?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Aaron Leventhal
    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: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 2
      Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
      Gerrit-Comment-Date: Fri, 09 Jan 2026 22:20:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Khushal Sagar (Gerrit)

      unread,
      Jan 9, 2026, 6:10:55 PM (8 days ago) Jan 9
      to Aaron Leventhal, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Aaron Leventhal

      Khushal Sagar added 1 comment

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
      Line 1234, Patchset 2 (Latest): if (!AreAllDocumentsReadyForAutoBuild(*document)) {
      // Retry after a task turn so we don't re-enter from within lifecycle-
      // sensitive scopes. This keeps the auto-build loop simple while waiting
      // for lifecycle state to settle.
      const bool was_registered = is_lifecycle_observer_registered_;
      EnsureLifecycleObserverRegistered();
      if (!was_registered) {
      LocalFrameView* view = document->View();
      Page* page = document->GetPage();
      LocalFrame* frame = document->GetFrame();
      if (view && page && frame && !page->Animator().IsServicingAnimations()) {
      page->Animator().ScheduleVisualUpdate(frame);
      }
      document->GetTaskRunner(TaskType::kInternalUserInteraction)
      ->PostTask(FROM_HERE,
      blink::BindOnce(
      &AIPageContentAgent::RunAutoBuildAfterDOMContentLoaded,
      WrapWeakPersistent(this)));
      }
      return;
      }
      Khushal Sagar . unresolved

      Could we reuse the [LifecycleNotificationObserver](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/local_frame_view.h;l=156;drc=a9f09a1411a697ace066a84efd018f49c28cc8a3). It's purpose-built for work that needs to happen when the lifecycle is clean. Seems more robust than the approach here which triggers an animation frame and then posts a task hoping the document state will permit running the lifecycle using `IsDocumentReadyForAutoBuild`.

      cc-ing szager who's familiar with the lifecycle stuff and can advise on the right pattern.

      Khushal Sagar

      Actually I realized while reviewing [here](https://chromium-review.googlesource.com/c/chromium/src/+/7416700/comment/4cb037eb_29711c34/) why we can't use the lifecycle observer. It's because we trigger invalidation by force unlocking display lock subtrees so we have to do it outside the regular lifecycle.

      Then i'm confused why we need the `AreAllDocumentsReadyForAutoBuild` check at all. Assuming we wait for dom content loaded and then post a task, we should always be able to run the extraction in that task. That's the same behaviour as production where the browser's IPC to trigger the extraction can be sent anytime [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc;l=1024;drc=f3b299d131a2d94c2bc1cae88e703f62880cf60d).

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      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: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 2
      Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Stefan Zager <sza...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
      Gerrit-Comment-Date: Fri, 09 Jan 2026 23:10:44 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Khushal Sagar <khusha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      Jan 12, 2026, 11:39:22 AM (5 days ago) Jan 12
      to Stefan Zager, Khushal Sagar, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Aaron Leventhal

      Aaron Leventhal removed a vote from this change

      Removed Commit-Queue+1 by Aaron Leventhal <aleve...@google.com>
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      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: deleteVote
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 5
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      Jan 13, 2026, 1:53:02 PM (4 days ago) Jan 13
      to AyeAye, Stefan Zager, Khushal Sagar, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Khushal Sagar

      Aaron Leventhal voted and added 7 comments

      Votes added by Aaron Leventhal

      Commit-Queue+1

      7 comments

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.h
      Line 73, Patchset 2:#if DCHECK_IS_ON()

      // Called by the DOMContentLoaded listener to kick off auto-build, which
      // is used by test infrastructure to ensure we run cleanly, without triggering
      // crashes or checks/dchecks.
      void RunAutoBuildAfterDOMContentLoaded();
      #endif
      Khushal Sagar . resolved

      Could we put this stuff in another class. Make it a friend class to this one if needed but just to isolate code which is test only.

      Aaron Leventhal

      Done

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
      Line 1196, Patchset 2:#if DCHECK_IS_ON()
      Khushal Sagar . resolved

      why is this needed? the whole function is already in a DCHECK block.

      Aaron Leventhal

      Done

      Line 1198, Patchset 2: // tests and browser tests. Blink unit tests assert specific lifecycle

      // invariants and are not a good target for this feature. We use a binary-name
      Khushal Sagar . unresolved

      I'd like to understand what invariants we're talking about. Maybe there's test only APIs to suppress ones which don't make sense.

      I'm also curious to see if this is an issue with the approach of using the lifecycle observer which ensures the lifecycle is in clean state. We shouldn't be hitting invariants in that case.

      Aaron Leventhal

      Added detailed comment.

      Line 1199, Patchset 2: // invariants and are not a good target for this feature. We use a binary-name

      // check (see WebTestSupport) to avoid broad unit-test fallout while keeping
      // the coverage benefits for web tests.
      Khushal Sagar . unresolved

      why are unit-tests hitting this? This is an opt-in triggered by EnableAutomaticActionableExtractionOnPageLoadForTesting. Can't we prevent unit-tests from calling this opt-in?

      Aaron Leventhal

      Added detailed comment.

      Here's why we turn it on carte blanch for all tests via runtime_enabled_features.json5 instead of from an opt in for specific tests: we don't know which tests should opt in, and new tests are added all the time that could break when combined with APC. Eventually the idea is to do what we have for
      accessibility, which is to have an FYI bot that turns on AutomaticActionableExtractionOnPageLoadForTesting for all web tests and browser tests. By turning it on carte blanche it casts a very wide net and finds almost all the inconsistencies in the tree building code. Actually, accessibility has a
      try bot that is triggered by changes to specific accessibility paths.

      However, there didn't seem to be any value in turning autoload on in unit tests, and trying to debug the failing ones didn't seem to have a lot of value. Sometimes the unit tests were specifically working with the document lifecycle. More details
      on why some unit tests fail in the comment.

      Line 1223, Patchset 2: // When tracing is active (e.g. inspector-protocol tracing tests), auto-build

      // can emit list-based HitTest trace events that change the expected trace
      // payload shape. Skip auto-build in that case to keep tracing output stable.
      Khushal Sagar . unresolved

      Sorry what tracing are we talking about here? I'm not following how that impacts the web tests.

      Aaron Leventhal

      Added detauked cinnebt,

      Line 1234, Patchset 2: if (!AreAllDocumentsReadyForAutoBuild(*document)) {

      // Retry after a task turn so we don't re-enter from within lifecycle-
      // sensitive scopes. This keeps the auto-build loop simple while waiting
      // for lifecycle state to settle.
      const bool was_registered = is_lifecycle_observer_registered_;
      EnsureLifecycleObserverRegistered();
      if (!was_registered) {
      LocalFrameView* view = document->View();
      Page* page = document->GetPage();
      LocalFrame* frame = document->GetFrame();
      if (view && page && frame && !page->Animator().IsServicingAnimations()) {
      page->Animator().ScheduleVisualUpdate(frame);
      }
      document->GetTaskRunner(TaskType::kInternalUserInteraction)
      ->PostTask(FROM_HERE,
      blink::BindOnce(
      &AIPageContentAgent::RunAutoBuildAfterDOMContentLoaded,
      WrapWeakPersistent(this)));
      }
      return;
      }
      Khushal Sagar . resolved

      Could we reuse the [LifecycleNotificationObserver](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/local_frame_view.h;l=156;drc=a9f09a1411a697ace066a84efd018f49c28cc8a3). It's purpose-built for work that needs to happen when the lifecycle is clean. Seems more robust than the approach here which triggers an animation frame and then posts a task hoping the document state will permit running the lifecycle using `IsDocumentReadyForAutoBuild`.

      cc-ing szager who's familiar with the lifecycle stuff and can advise on the right pattern.

      Khushal Sagar

      Actually I realized while reviewing [here](https://chromium-review.googlesource.com/c/chromium/src/+/7416700/comment/4cb037eb_29711c34/) why we can't use the lifecycle observer. It's because we trigger invalidation by force unlocking display lock subtrees so we have to do it outside the regular lifecycle.

      Then i'm confused why we need the `AreAllDocumentsReadyForAutoBuild` check at all. Assuming we wait for dom content loaded and then post a task, we should always be able to run the extraction in that task. That's the same behaviour as production where the browser's IPC to trigger the extraction can be sent anytime [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc;l=1024;drc=f3b299d131a2d94c2bc1cae88e703f62880cf60d).

      Aaron Leventhal

      Fixed

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
      Line 2025, Patchset 2: // Enable the auto-build path and then simulate DOMContentLoaded dispatch

      // still being in progress by forcing the parsing state to "in DCL".
      AIPageContentAgent::EnableAutomaticActionableExtractionOnPageLoadForTesting(
      *helper_.LocalMainFrame()->GetFrame());
      Khushal Sagar . resolved

      This shouldn't be necessary since you're invoking `RunAutoBuildAfterDOMContentLoaded` after this explicitly. In fact the code has a check to ignore this call in unit-test builds?

      Aaron Leventhal

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Khushal Sagar
      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: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 12
      Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Stefan Zager <sza...@chromium.org>
      Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Comment-Date: Tue, 13 Jan 2026 18:52:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Khushal Sagar <khusha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Khushal Sagar (Gerrit)

      unread,
      Jan 14, 2026, 1:53:34 AM (3 days ago) Jan 14
      to Aaron Leventhal, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Aaron Leventhal

      Khushal Sagar added 6 comments

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
      Line 1137, Patchset 12 (Latest):void AutoBuildHelper::RunAfterDOMContentLoaded() {
      Khushal Sagar . unresolved

      nit: Define it where the class is declared above?

      Line 1199, Patchset 2: // invariants and are not a good target for this feature. We use a binary-name
      // check (see WebTestSupport) to avoid broad unit-test fallout while keeping
      // the coverage benefits for web tests.
      Khushal Sagar . unresolved

      why are unit-tests hitting this? This is an opt-in triggered by EnableAutomaticActionableExtractionOnPageLoadForTesting. Can't we prevent unit-tests from calling this opt-in?

      Aaron Leventhal

      Added detailed comment.

      Here's why we turn it on carte blanch for all tests via runtime_enabled_features.json5 instead of from an opt in for specific tests: we don't know which tests should opt in, and new tests are added all the time that could break when combined with APC. Eventually the idea is to do what we have for
      accessibility, which is to have an FYI bot that turns on AutomaticActionableExtractionOnPageLoadForTesting for all web tests and browser tests. By turning it on carte blanche it casts a very wide net and finds almost all the inconsistencies in the tree building code. Actually, accessibility has a
      try bot that is triggered by changes to specific accessibility paths.

      However, there didn't seem to be any value in turning autoload on in unit tests, and trying to debug the failing ones didn't seem to have a lot of value. Sometimes the unit tests were specifically working with the document lifecycle. More details
      on why some unit tests fail in the comment.

      Khushal Sagar

      Thanks for the detailed comment. I agree with you about not running it for unit-tests. Do you mind pulling out the unit-test suppression into a separate CL? I'm not a fan of using the test name (we also have blink_platform_unittests not covered right now) for that detection but also don't have a better suggestion. Probably one of the VIRTUAL_OWNERS would know a better way to enable a runtime_enabled_feature only for web tests.

      It should also not be an immediate concern. It'll only be when you have to turn it on for all web tests in an FYI bot. Until then it'll be turned on for the content_extration VirtualTestSuite only.

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
      Line 2041, Patchset 12 (Latest): // Confirm the document satisfies the auto-build readiness gates before
      // running the deferred task.
      EXPECT_TRUE(document->HasFinishedParsing());
      EXPECT_FALSE(document->InStyleRecalc());
      EXPECT_FALSE(document->InvalidationDisallowed());
      EXPECT_FALSE(document->Lifecycle().LifecyclePostponed());
      EXPECT_GE(document->Lifecycle().GetState(), DocumentLifecycle::kLayoutClean);
      EXPECT_FALSE(document->NeedsLayoutTreeUpdate());
      // Ensure there are no child frames or popups that could block readiness.
      int child_view_count = 0;
      document->View()->ForAllChildLocalFrameViews(
      [&](LocalFrameView&) { ++child_view_count; });
      EXPECT_EQ(child_view_count, 0);
      Khushal Sagar . unresolved

      Not necessary anymore

      Line 2057, Patchset 12 (Latest): if (base::TrackEvent::IsEnabled()) {
      GTEST_SKIP()
      << "Auto-build is disabled while tracing is active in this harness.";
      }
      Khushal Sagar . unresolved

      Is this conditionally true on some bots?

      Line 2062, Patchset 12 (Latest): // Re-run the auto-build entry point now that parsing is finished. This should
      // synchronously execute the auto-build path without crashing.
      agent->RunAutoBuildAfterDOMContentLoadedForTesting();
      test::RunPendingTasks();
      Khushal Sagar . unresolved

      I'm not following how are we validating that this ran the auto-build but the one on l2030 didn't.

      Line 2068, Patchset 12 (Latest):TEST_F(AIPageContentAgentTest, AutoBuildDefersDuringStyleRecalc) {
      Khushal Sagar . unresolved

      This test is no longer necessary.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      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: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 12
      Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Stefan Zager <sza...@chromium.org>
      Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 06:53:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Aaron Leventhal <aleve...@google.com>
      Comment-In-Reply-To: Khushal Sagar <khusha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Aaron Leventhal (Gerrit)

      unread,
      Jan 14, 2026, 2:20:41 PM (3 days ago) Jan 14
      to AyeAye, Stefan Zager, Khushal Sagar, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Khushal Sagar

      Aaron Leventhal added 6 comments

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
      Line 1137, Patchset 12:void AutoBuildHelper::RunAfterDOMContentLoaded() {
      Khushal Sagar . resolved

      nit: Define it where the class is declared above?

      Aaron Leventhal

      Done

      Line 1199, Patchset 2: // invariants and are not a good target for this feature. We use a binary-name
      // check (see WebTestSupport) to avoid broad unit-test fallout while keeping
      // the coverage benefits for web tests.
      Khushal Sagar . resolved

      why are unit-tests hitting this? This is an opt-in triggered by EnableAutomaticActionableExtractionOnPageLoadForTesting. Can't we prevent unit-tests from calling this opt-in?

      Aaron Leventhal

      Added detailed comment.

      Here's why we turn it on carte blanch for all tests via runtime_enabled_features.json5 instead of from an opt in for specific tests: we don't know which tests should opt in, and new tests are added all the time that could break when combined with APC. Eventually the idea is to do what we have for
      accessibility, which is to have an FYI bot that turns on AutomaticActionableExtractionOnPageLoadForTesting for all web tests and browser tests. By turning it on carte blanche it casts a very wide net and finds almost all the inconsistencies in the tree building code. Actually, accessibility has a
      try bot that is triggered by changes to specific accessibility paths.

      However, there didn't seem to be any value in turning autoload on in unit tests, and trying to debug the failing ones didn't seem to have a lot of value. Sometimes the unit tests were specifically working with the document lifecycle. More details
      on why some unit tests fail in the comment.

      Khushal Sagar

      Thanks for the detailed comment. I agree with you about not running it for unit-tests. Do you mind pulling out the unit-test suppression into a separate CL? I'm not a fan of using the test name (we also have blink_platform_unittests not covered right now) for that detection but also don't have a better suggestion. Probably one of the VIRTUAL_OWNERS would know a better way to enable a runtime_enabled_feature only for web tests.

      It should also not be an immediate concern. It'll only be when you have to turn it on for all web tests in an FYI bot. Until then it'll be turned on for the content_extration VirtualTestSuite only.

      Aaron Leventhal

      Done

      File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
      Line 2041, Patchset 12: // Confirm the document satisfies the auto-build readiness gates before

      // running the deferred task.
      EXPECT_TRUE(document->HasFinishedParsing());
      EXPECT_FALSE(document->InStyleRecalc());
      EXPECT_FALSE(document->InvalidationDisallowed());
      EXPECT_FALSE(document->Lifecycle().LifecyclePostponed());
      EXPECT_GE(document->Lifecycle().GetState(), DocumentLifecycle::kLayoutClean);
      EXPECT_FALSE(document->NeedsLayoutTreeUpdate());
      // Ensure there are no child frames or popups that could block readiness.
      int child_view_count = 0;
      document->View()->ForAllChildLocalFrameViews(
      [&](LocalFrameView&) { ++child_view_count; });
      EXPECT_EQ(child_view_count, 0);
      Khushal Sagar . resolved

      Not necessary anymore

      Aaron Leventhal

      Done

      Line 2057, Patchset 12: if (base::TrackEvent::IsEnabled()) {

      GTEST_SKIP()
      << "Auto-build is disabled while tracing is active in this harness.";
      }
      Khushal Sagar . resolved

      Is this conditionally true on some bots?

      Aaron Leventhal

      Removed

      Line 2062, Patchset 12: // Re-run the auto-build entry point now that parsing is finished. This should

      // synchronously execute the auto-build path without crashing.
      agent->RunAutoBuildAfterDOMContentLoadedForTesting();
      test::RunPendingTasks();
      Khushal Sagar . resolved

      I'm not following how are we validating that this ran the auto-build but the one on l2030 didn't.

      Aaron Leventhal

      Ok I've added some assertions that I'll look to improve in the the CL that restores the unit test guard. Added a TODO for that improvement.

      Line 2068, Patchset 12:TEST_F(AIPageContentAgentTest, AutoBuildDefersDuringStyleRecalc) {
      Khushal Sagar . resolved

      This test is no longer necessary.

      Aaron Leventhal

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Khushal Sagar
      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: I61e6789337029138914ea0c10dd26de2f83e18da
      Gerrit-Change-Number: 7409289
      Gerrit-PatchSet: 12
      Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Stefan Zager <sza...@chromium.org>
      Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Comment-Date: Wed, 14 Jan 2026 19:20:32 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Khushal Sagar (Gerrit)

      unread,
      Jan 15, 2026, 2:14:33 AM (2 days ago) Jan 15
      to Aaron Leventhal, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
      Attention needed from Aaron Leventhal

      Khushal Sagar voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Aaron Leventhal
      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: I61e6789337029138914ea0c10dd26de2f83e18da
        Gerrit-Change-Number: 7409289
        Gerrit-PatchSet: 13
        Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Stefan Zager <sza...@chromium.org>
        Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 07:14:13 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Aaron Leventhal (Gerrit)

        unread,
        Jan 15, 2026, 10:10:43 AM (2 days ago) Jan 15
        to Khushal Sagar, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Khushal Sagar

        Aaron Leventhal voted and added 1 comment

        Votes added by Aaron Leventhal

        Auto-Submit+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 14 (Latest):
        Aaron Leventhal . resolved

        Simplified for now. Looks like we won't turn on auto extraction for browser tests.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Khushal Sagar
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement 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: I61e6789337029138914ea0c10dd26de2f83e18da
        Gerrit-Change-Number: 7409289
        Gerrit-PatchSet: 14
        Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Stefan Zager <sza...@chromium.org>
        Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Comment-Date: Thu, 15 Jan 2026 15:10:32 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Khushal Sagar (Gerrit)

        unread,
        Jan 15, 2026, 4:47:17 PM (2 days ago) Jan 15
        to Aaron Leventhal, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
        Attention needed from Aaron Leventhal

        Khushal Sagar voted

        Code-Review+1
        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Aaron Leventhal
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement 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: I61e6789337029138914ea0c10dd26de2f83e18da
          Gerrit-Change-Number: 7409289
          Gerrit-PatchSet: 15
          Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
          Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
          Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Stefan Zager <sza...@chromium.org>
          Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
          Gerrit-Comment-Date: Thu, 15 Jan 2026 21:47:03 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Aaron Leventhal (Gerrit)

          unread,
          Jan 15, 2026, 4:50:02 PM (2 days ago) Jan 15
          to Khushal Sagar, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
          Attention needed from Khushal Sagar

          Aaron Leventhal voted and added 2 comments

          Votes added by Aaron Leventhal

          Auto-Submit+1

          2 comments

          File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
          Line 1198, Patchset 2: // tests and browser tests. Blink unit tests assert specific lifecycle

          // invariants and are not a good target for this feature. We use a binary-name
          Khushal Sagar . resolved

          I'd like to understand what invariants we're talking about. Maybe there's test only APIs to suppress ones which don't make sense.

          I'm also curious to see if this is an issue with the approach of using the lifecycle observer which ensures the lifecycle is in clean state. We shouldn't be hitting invariants in that case.

          Aaron Leventhal

          Added detailed comment.

          Aaron Leventhal

          Done

          Line 1223, Patchset 2: // When tracing is active (e.g. inspector-protocol tracing tests), auto-build
          // can emit list-based HitTest trace events that change the expected trace
          // payload shape. Skip auto-build in that case to keep tracing output stable.
          Khushal Sagar . resolved

          Sorry what tracing are we talking about here? I'm not following how that impacts the web tests.

          Aaron Leventhal

          Added detauked cinnebt,

          Aaron Leventhal

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Khushal Sagar
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • 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: I61e6789337029138914ea0c10dd26de2f83e18da
            Gerrit-Change-Number: 7409289
            Gerrit-PatchSet: 15
            Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Stefan Zager <sza...@chromium.org>
            Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Comment-Date: Thu, 15 Jan 2026 21:49:54 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Aaron Leventhal (Gerrit)

            unread,
            Jan 15, 2026, 4:50:07 PM (2 days ago) Jan 15
            to Khushal Sagar, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, Chromium LUCI CQ, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Khushal Sagar

            Aaron Leventhal voted Commit-Queue+2

            Commit-Queue+2
            Gerrit-Comment-Date: Thu, 15 Jan 2026 21:49:58 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            open
            diffy

            Chromium LUCI CQ (Gerrit)

            unread,
            Jan 15, 2026, 4:53:33 PM (2 days ago) Jan 15
            to Aaron Leventhal, Khushal Sagar, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org

            Chromium LUCI CQ submitted the change

            Change information

            Commit message:
            [APC] Trigger content extraction auto-build via DOMContentLoaded

            Refactor test-only APC auto-build to run after DOMContentLoaded and
            only when documents are lifecycle-safe. The new readiness gate checks
            parsing finished, style recalc, invalidation, and layout-clean states
            across the main document, local child frames, and popups. Auto-build
            also skips the initial empty document and avoids running inside blink
            unit test binaries.

            Add DCHECK-only unit tests that verify auto-build defers while parsing
            or style recalc is in progress, and remove the update-data crash
            expectations for the auto-build web test flag.

            This change fixes at least one lifecycle-related issue in web tests
            and gets us closer to being able to turn on
            AIPageContentBuildOnLoadForTesting for an FYI bot and stay green.

            More fixes are necessary via future CLs as there continue to be flakes
            with geometry checks when auto build is turned on, likely caused by the
            difference between the layout viewport and visual viewport.

            Test: AIPageContentAgentTest.AutoBuildDefersUntilParsingFinished:
            AIPageContentAgentTest.AutoBuildDefersDuringStyleRecalc
            fast/dom/HTMLObjectElement/update-data.html
            Bug: 474330989
            Change-Id: I61e6789337029138914ea0c10dd26de2f83e18da
            Cq-Do-Not-Cancel-Tryjobs: true
            Reviewed-by: Khushal Sagar <khusha...@chromium.org>
            Auto-Submit: Aaron Leventhal <aleve...@google.com>
            Commit-Queue: Aaron Leventhal <aleve...@google.com>
            Cr-Commit-Position: refs/heads/main@{#1569998}
            Files:
            • M third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.cc
            • M third_party/blink/renderer/modules/content_extraction/ai_page_content_agent.h
            • M third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
            • M third_party/blink/web_tests/FlagExpectations/content-extraction
            • M third_party/blink/web_tests/TestExpectations
            Change size: M
            Delta: 5 files changed, 198 insertions(+), 42 deletions(-)
            Branch: refs/heads/main
            Submit Requirements:
            • requirement satisfiedCode-Review: +1 by Khushal Sagar
            Open in Gerrit
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: merged
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I61e6789337029138914ea0c10dd26de2f83e18da
            Gerrit-Change-Number: 7409289
            Gerrit-PatchSet: 16
            Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            open
            diffy
            satisfied_requirement

            Alex Gough (Gerrit)

            unread,
            Jan 16, 2026, 6:16:07 PM (18 hours ago) Jan 16
            to Aaron Leventhal, Chromium LUCI CQ, Alex Gough, Khushal Sagar, AyeAye, Stefan Zager, AI Code Reviewer, chromium...@chromium.org, browser-comp...@chromium.org, jmedle...@chromium.org, aleventh...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, mfoltz+wa...@chromium.org
            Attention needed from Aaron Leventhal

            Alex Gough added 1 comment

            File third_party/blink/renderer/modules/content_extraction/ai_page_content_agent_unittest.cc
            Line 21, Patchset 16 (Latest):#include "third_party/blink/public/mojom/content_extraction/ai_page_content.mojom-data-view.h"
            Alex Gough . unresolved

            this change was not necessary as you are not using any dataview types directly - can you let me know which editors or iwyu steps you are using as this should not be happening? (I'll upload a fix - but I'd like to know why these are creeping in!)

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Aaron Leventhal
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement satisfiedCode-Owners
            • requirement satisfiedCode-Review
            • 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: I61e6789337029138914ea0c10dd26de2f83e18da
            Gerrit-Change-Number: 7409289
            Gerrit-PatchSet: 16
            Gerrit-Owner: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Aaron Leventhal <aleve...@google.com>
            Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
            Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Alex Gough <aj...@chromium.org>
            Gerrit-CC: Stefan Zager <sza...@chromium.org>
            Gerrit-Attention: Aaron Leventhal <aleve...@google.com>
            Gerrit-Comment-Date: Fri, 16 Jan 2026 23:15:57 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages