[Indigo] Ensure elements with tracked subrects draw content and paint [chromium/src : main]

0 views
Skip to first unread message

William Liu (Gerrit)

unread,
Jun 24, 2026, 2:40:35 PM (6 days ago) Jun 24
to Dave Tapuska, Khushal Sagar, Adithya Srinivasan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
Attention needed from Adithya Srinivasan and Khushal Sagar

William Liu added 2 comments

File chrome/browser/indigo/indigo_browsertest.cc
Line 536, Patchset 21: StopObservingState(kVisualStateUpdated),
Adithya Srinivasan . resolved

might be a silly question: Why does `WaitForShow(IndigoToolbar::kToolbarElementId)` on its own not work? It sounds like the toolbar should eventually show (and this is a WaitFor as opposed to expecting the toolbar to be immediately shown)

William Liu

Okay I actually can't quite pinpoint why the OOPIF does not submit a frame if we don't force one.

The sequence we have is:
```
---- time --->

Main renderer -------- frame0 embeds the OOPIF's surface layer with empty rect
OOPIF -------- surface layer emits frame1 with our rect
```
so technically we shouldn't need to force anything and this is the case in production (as in the recording).

@khusha...@chromium.org do you know?

Khushal Sagar

Sorry, missed this earlier. I'm missing detail on how the whole thing works but from your comment it sounds like `kToolbarElementId` showing up depends on the renderer sending a tracked element rect. And `WaitForShow` blocks until a frame with that rect has reached the browser. I agree that we shouldn't need to force a frame here, that might mask a production bug if there's no frame trigger.

The tracking rect is associated with the main Document's compositor frame itself (even with the current PS moving that to the OOPIF's SurfaceLayer). So I'm not sure how the OOPIF not submitting a frame could impact this.

I suspect the fix in the other comment to ensure background painting phase for replaced elements with tracking rects will avoid the need for this.

William Liu

Obsolete.

File third_party/blink/renderer/core/frame/remote_frame_view.cc
Line 391, Patchset 23: // For out-of-process iframes (RemoteFrame), the frame owner element (e.g.
Khushal Sagar . resolved

Instead of adding the rects to the layer directly, better to follow the pattern [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/exported/web_plugin_container_impl.cc;l=198;drc=cedb6902cdefa33e500ef38eca6227a8f50c9502) which creates a paint chunk before recording the display item for the foreign layer.

_________

Actually digging into this more, we're just missing a condition similar to region capture [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/paint/replaced_painter.cc;l=142;drc=cedb6902cdefa33e500ef38eca6227a8f50c9502) to force background painting if there's any element rects to track. Can you try that instead? I suspect that will also avoid the need to switch from tracking the image element to its OOPIF (which is also unnecessary complexity).

William Liu

TYSM! background paint works with a little addition 😊

Open in Gerrit

Related details

Attention is currently required from:
  • Adithya Srinivasan
  • 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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
Gerrit-Change-Number: 7945488
Gerrit-PatchSet: 25
Gerrit-Owner: William Liu <liuwi...@chromium.org>
Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
Gerrit-Comment-Date: Wed, 24 Jun 2026 18:40:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: William Liu <liuwi...@chromium.org>
Comment-In-Reply-To: Khushal Sagar <khusha...@chromium.org>
Comment-In-Reply-To: Adithya Srinivasan <adit...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Khushal Sagar (Gerrit)

unread,
Jun 24, 2026, 3:39:43 PM (6 days ago) Jun 24
to William Liu, Dave Tapuska, Adithya Srinivasan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
Attention needed from Adithya Srinivasan and William Liu

Khushal Sagar added 1 comment

File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
Line 135, Patchset 25 (Latest): (!drawable_bounds.IsEmpty() || tracked_element_rects);
Khushal Sagar . unresolved

Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

Open in Gerrit

Related details

Attention is currently required from:
  • Adithya Srinivasan
  • William Liu
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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
    Gerrit-Change-Number: 7945488
    Gerrit-PatchSet: 25
    Gerrit-Owner: William Liu <liuwi...@chromium.org>
    Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
    Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
    Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: William Liu <liuwi...@chromium.org>
    Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
    Gerrit-Comment-Date: Wed, 24 Jun 2026 19:39:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    William Liu (Gerrit)

    unread,
    Jun 24, 2026, 4:05:17 PM (6 days ago) Jun 24
    to Dave Tapuska, Khushal Sagar, Adithya Srinivasan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
    Attention needed from Adithya Srinivasan and Khushal Sagar

    William Liu voted and added 1 comment

    Votes added by William Liu

    Commit-Queue+1

    1 comment

    File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
    Line 135, Patchset 25: (!drawable_bounds.IsEmpty() || tracked_element_rects);
    Khushal Sagar . resolved

    Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

    William Liu

    It's in the CL description but basically the region captures are set on CFMetadata. So even if we don't generate a RenderFrame, a CF is always generated.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adithya Srinivasan
    • 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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
      Gerrit-Change-Number: 7945488
      Gerrit-PatchSet: 25
      Gerrit-Owner: William Liu <liuwi...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
      Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 20:05:03 +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,
      Jun 24, 2026, 5:09:22 PM (6 days ago) Jun 24
      to William Liu, Dave Tapuska, Adithya Srinivasan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan and William Liu

      Khushal Sagar added 1 comment

      File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
      Line 135, Patchset 25: (!drawable_bounds.IsEmpty() || tracked_element_rects);
      Khushal Sagar . resolved

      Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

      William Liu

      It's in the CL description but basically the region captures are set on CFMetadata. So even if we don't generate a RenderFrame, a CF is always generated.

      Khushal Sagar

      This seems like a bug we should fix in CC then. CC should be sending rects for layers even if drawing is skipping them consistently to CF and RenderFrameMetadata.

      Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • William Liu
      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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
      Gerrit-Change-Number: 7945488
      Gerrit-PatchSet: 26
      Gerrit-Owner: William Liu <liuwi...@chromium.org>
      Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
      Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
      Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: William Liu <liuwi...@chromium.org>
      Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 21:09:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      William Liu (Gerrit)

      unread,
      Jun 25, 2026, 10:10:25 AM (5 days ago) Jun 25
      to Dave Tapuska, Khushal Sagar, Adithya Srinivasan, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
      Attention needed from Adithya Srinivasan and Khushal Sagar

      William Liu added 1 comment

      File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
      Line 135, Patchset 25: (!drawable_bounds.IsEmpty() || tracked_element_rects);
      Khushal Sagar . unresolved

      Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

      William Liu

      It's in the CL description but basically the region captures are set on CFMetadata. So even if we don't generate a RenderFrame, a CF is always generated.

      Khushal Sagar

      This seems like a bug we should fix in CC then. CC should be sending rects for layers even if drawing is skipping them consistently to CF and RenderFrameMetadata.

      Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

      William Liu

      Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

      Yup. So we shall also keep the layers w/o drawable content but with rects?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Adithya Srinivasan
      • 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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
        Gerrit-Change-Number: 7945488
        Gerrit-PatchSet: 26
        Gerrit-Owner: William Liu <liuwi...@chromium.org>
        Gerrit-Reviewer: Adithya Srinivasan <adit...@chromium.org>
        Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
        Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
        Gerrit-Attention: Adithya Srinivasan <adit...@chromium.org>
        Gerrit-Comment-Date: Thu, 25 Jun 2026 14:10:16 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        William Liu (Gerrit)

        unread,
        Jun 25, 2026, 12:06:39 PM (5 days ago) Jun 25
        to Adithya Srinivasan, Dave Tapuska, Khushal Sagar, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
        Attention needed from Khushal Sagar

        William Liu voted and added 1 comment

        Votes added by William Liu

        Commit-Queue+1

        1 comment

        File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
        Line 135, Patchset 25: (!drawable_bounds.IsEmpty() || tracked_element_rects);
        Khushal Sagar . resolved

        Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

        William Liu

        It's in the CL description but basically the region captures are set on CFMetadata. So even if we don't generate a RenderFrame, a CF is always generated.

        Khushal Sagar

        This seems like a bug we should fix in CC then. CC should be sending rects for layers even if drawing is skipping them consistently to CF and RenderFrameMetadata.

        Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

        William Liu

        Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

        Yup. So we shall also keep the layers w/o drawable content but with rects?

        William Liu

        okay I uploaded another patchset... let's hope CQ is happy about the change..

        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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
          Gerrit-Change-Number: 7945488
          Gerrit-PatchSet: 28
          Gerrit-Owner: William Liu <liuwi...@chromium.org>
          Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
          Gerrit-CC: Adithya Srinivasan <adit...@chromium.org>
          Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Khushal Sagar <khusha...@chromium.org>
          Gerrit-Comment-Date: Thu, 25 Jun 2026 16:06:29 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Khushal Sagar (Gerrit)

          unread,
          Jun 25, 2026, 1:04:27 PM (5 days ago) Jun 25
          to William Liu, Adithya Srinivasan, Dave Tapuska, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-revi...@chromium.org, cc-...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org
          Attention needed from William Liu

          Khushal Sagar added 1 comment

          File third_party/blink/renderer/platform/graphics/paint/paint_chunk.h
          Line 135, Patchset 25: (!drawable_bounds.IsEmpty() || tracked_element_rects);
          Khushal Sagar . unresolved

          Can you figure out why this wasn't necessary for the `GetRegionCaptureCropId` case?

          William Liu

          It's in the CL description but basically the region captures are set on CFMetadata. So even if we don't generate a RenderFrame, a CF is always generated.

          Khushal Sagar

          This seems like a bug we should fix in CC then. CC should be sending rects for layers even if drawing is skipping them consistently to CF and RenderFrameMetadata.

          Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

          William Liu

          Is this happening because the layer iteration we're doing using EffectTreeLayerListIterator skips layers with no drawable content?

          Yup. So we shall also keep the layers w/o drawable content but with rects?

          William Liu

          okay I uploaded another patchset... let's hope CQ is happy about the change..

          Khushal Sagar

          So we used the walk in PrepareToDraw as an optimization to avoid more layer walks per frame just to check if there's any tracked rects. Didn't realize that it skips layers which don't have drawable content but the fix shouldn't be to force these layers to draw. That'll turn off a bunch of other optimizations.

          Maybe we can add a walk over all layers in that function to cache state that needs to visit layers which don'r draw. And use it both for tracked elements and CollectRegionCaptureBounds. Because that one also unconditionally walks over all layers every frame. So at least we'll have one spot going forward to go through all the layers and do stuff later on for features which are rarely used.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • William Liu
          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: I4cad62438143b9e80a43d0a1bd55e27fe0a06ef4
            Gerrit-Change-Number: 7945488
            Gerrit-PatchSet: 28
            Gerrit-Owner: William Liu <liuwi...@chromium.org>
            Gerrit-Reviewer: Khushal Sagar <khusha...@chromium.org>
            Gerrit-Reviewer: William Liu <liuwi...@chromium.org>
            Gerrit-CC: Adithya Srinivasan <adit...@chromium.org>
            Gerrit-CC: Dave Tapuska <dtap...@chromium.org>
            Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
            Gerrit-CC: Stephen Chenney <sche...@chromium.org>
            Gerrit-Attention: William Liu <liuwi...@chromium.org>
            Gerrit-Comment-Date: Thu, 25 Jun 2026 17:04:14 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy
            Reply all
            Reply to author
            Forward
            0 new messages