ElementTiming/ContainerTiming: report paints of images in pseudo element contents [chromium/src : main]

0 views
Skip to first unread message

José Dapena Paz (Gerrit)

unread,
Jun 19, 2025, 11:56:45 AM6/19/25
to chromium...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org

José Dapena Paz has uploaded the change for review

Commit message

ElementTiming/ContainerTiming: report paints of images in pseudo element contents

Added support for reporting the paints of images that are declared in the
content property of pseudo elements.

To implement it, we find the generating node:
- First, for anonymous nodes, we find the enclosing node that is not anonymous.
- Then, if it is a pseudo element, then we fetch the ultimate originating
element.

This is the element that is reported as lastPaintedElement in container timing
and as element in element timing.

Ticket for the discussion of what should happen with pseudo elements:
https://github.com/w3c/element-timing/issues/74
Bug: 382422286
Change-Id: I8f810ac5fb118f2d66c78f29d371348d13c45375

Change diff


Change information

Files:
  • M third_party/blink/renderer/core/paint/image_painter.cc
  • M third_party/blink/renderer/core/paint/timing/image_element_timing.cc
  • A third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-image-before-in-container-timing.html
  • A third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-with-image-content-in-container-timing.html
Change size: M
Delta: 4 files changed, 104 insertions(+), 6 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I8f810ac5fb118f2d66c78f29d371348d13c45375
Gerrit-Change-Number: 6656960
Gerrit-PatchSet: 1
Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

José Dapena Paz (Gerrit)

unread,
Jun 20, 2025, 1:21:37 PM6/20/25
to chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org

Message from José Dapena Paz

Set Ready For Review

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I8f810ac5fb118f2d66c78f29d371348d13c45375
Gerrit-Change-Number: 6656960
Gerrit-PatchSet: 3
Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
Gerrit-Comment-Date: Fri, 20 Jun 2025 17:21:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

José Dapena Paz (Gerrit)

unread,
Jun 20, 2025, 2:22:16 PM6/20/25
to David Baron, Chromium LUCI CQ, Michal Mocny, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from David Baron, José Dapena Paz and Michal Mocny

José Dapena Paz voted and added 1 comment

Votes added by José Dapena Paz

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
José Dapena Paz . resolved

This is an early review request, to check if I am in the right path for supporting the failing pseudos.

Open in Gerrit

Related details

Attention is currently required from:
  • David Baron
  • José Dapena Paz
  • Michal Mocny
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
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: I8f810ac5fb118f2d66c78f29d371348d13c45375
Gerrit-Change-Number: 6656960
Gerrit-PatchSet: 3
Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
Gerrit-Reviewer: David Baron <dba...@chromium.org>
Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
Gerrit-Attention: David Baron <dba...@chromium.org>
Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
Gerrit-Comment-Date: Fri, 20 Jun 2025 18:21:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

David Baron (Gerrit)

unread,
Jun 20, 2025, 2:47:52 PM6/20/25
to José Dapena Paz, David Baron, Chromium LUCI CQ, Michal Mocny, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from José Dapena Paz and Michal Mocny

David Baron added 7 comments

Patchset-level comments
José Dapena Paz . resolved

This is an early review request, to check if I am in the right path for supporting the failing pseudos.

David Baron

I think if it works then it seems fine to me.

File third_party/blink/renderer/core/paint/image_painter.cc
Line 264, Patchset 3 (Latest): if (image_content &&
(IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
(!node && layout_image_.IsAnonymous())) &&
David Baron . unresolved

I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

  • the `<object>` element
  • the `<input type=image>` element
  • the `<picture>` element (maybe)
  • images from the `list-style-image` property

It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

File third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-image-before-in-container-timing.html
David Baron . unresolved

Maybe this filename should have `background` in it somewhere, since from the filename I'd have expected this test be related to `content` rather than `background`.

Line 4, Patchset 3 (Latest):<body>
David Baron . unresolved

Please drop this `<body>` and let the `<style>` and `<script>` elements be in the `head`.

(Same for the other tests.)

Line 11, Patchset 3 (Latest): background: url('/container-timing/resources/square100.png');
width: 100px;
height: 100px;
David Baron . unresolved

This seems like it's a slightly more interesting test if the width and height are bigger than 100 and the image gets tiled. (Right now, it doesn't test *which* size is reported.)

Same for the element timing test.

Line 22, Patchset 3 (Latest): let beforeRender;
David Baron . unresolved

I think this `let` could, and probably should, be one scope further in (that is, inside the anonymous function passed to `async_test`).

File third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-with-image-content-in-container-timing.html
Line 10, Patchset 3 (Latest): content: url('/container-timing/resources/square100.png');
width: 100px;
height: 100px;
David Baron . unresolved

This seems like it's a slightly more interesting test if the width and height are bigger than 100 and the image doesn't fill the element. (Right now, it doesn't test *which* size is reported.)

Same for the element timing test.

Open in Gerrit

Related details

Attention is currently required from:
  • José Dapena Paz
  • Michal Mocny
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I8f810ac5fb118f2d66c78f29d371348d13c45375
    Gerrit-Change-Number: 6656960
    Gerrit-PatchSet: 3
    Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: David Baron <dba...@chromium.org>
    Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
    Gerrit-Comment-Date: Fri, 20 Jun 2025 18:47:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: José Dapena Paz <jda...@igalia.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jun 30, 2025, 8:08:54 AM6/30/25
    to José Dapena Paz, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from José Dapena Paz

    Michal Mocny added 2 comments

    Patchset-level comments
    Michal Mocny . resolved

    This is excellent! Thanks for actually getting to do it.

    (I still haven't reviewed tests, and, I trust David's review of the implementation because for GeneratingNode etc, since I don't understand this area)

    One note: the fix is for Element/Container timings, but for images we have a separate detector for LCP. I think its fine to land here first, but I want to try to consolidate these two image paint timing detectors together, same as for text.

    File third_party/blink/renderer/core/paint/image_painter.cc
    Line 264, Patchset 3 (Latest): if (image_content &&
    (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
    (!node && layout_image_.IsAnonymous())) &&
    David Baron . unresolved

    I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

    • the `<object>` element
    • the `<input type=image>` element
    • the `<picture>` element (maybe)
    • images from the `list-style-image` property

    It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

    Michal Mocny

    I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

    Open in Gerrit

    Related details

    Attention is currently required from:
    • José Dapena Paz
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I8f810ac5fb118f2d66c78f29d371348d13c45375
    Gerrit-Change-Number: 6656960
    Gerrit-PatchSet: 3
    Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: David Baron <dba...@chromium.org>
    Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
    Gerrit-Comment-Date: Mon, 30 Jun 2025 12:08:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: David Baron <dba...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    José Dapena Paz (Gerrit)

    unread,
    Jul 4, 2025, 5:53:03 AM7/4/25
    to David Baron, Chromium LUCI CQ, Michal Mocny, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Baron and Michal Mocny

    José Dapena Paz added 1 comment

    File third_party/blink/renderer/core/paint/image_painter.cc
    Line 264, Patchset 3 (Latest): if (image_content &&
    (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
    (!node && layout_image_.IsAnonymous())) &&
    David Baron . unresolved

    I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

    • the `<object>` element
    • the `<input type=image>` element
    • the `<picture>` element (maybe)
    • images from the `list-style-image` property

    It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

    Michal Mocny

    I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

    José Dapena Paz

    Picture was apparently already working. It will report the img node inside (and that's where we should add the elementtiming. `containertiming` is going to allow getting that from `picture` node.

    `<input type=image>`, `<object>` and `list-style-image` work with this change (last one also requiring pseudo support).

    I will provide additional tests, and do the suggested clean ups. Finally, thanks to reducing this condition, the results are going to be more generic and we will get element timing support for more scenarios.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Baron
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    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: I8f810ac5fb118f2d66c78f29d371348d13c45375
    Gerrit-Change-Number: 6656960
    Gerrit-PatchSet: 3
    Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: David Baron <dba...@chromium.org>
    Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: David Baron <dba...@chromium.org>
    Gerrit-Comment-Date: Fri, 04 Jul 2025 09:52:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    Comment-In-Reply-To: David Baron <dba...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    José Dapena Paz (Gerrit)

    unread,
    Jul 4, 2025, 2:08:26 PM7/4/25
    to David Baron, Chromium LUCI CQ, Michal Mocny, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Baron and Michal Mocny

    José Dapena Paz added 5 comments

    File third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-image-before-in-container-timing.html
    File-level comment, Patchset 3:
    David Baron . resolved

    Maybe this filename should have `background` in it somewhere, since from the filename I'd have expected this test be related to `content` rather than `background`.

    José Dapena Paz

    Done

    Line 4, Patchset 3:<body>
    David Baron . resolved

    Please drop this `<body>` and let the `<style>` and `<script>` elements be in the `head`.

    (Same for the other tests.)

    José Dapena Paz

    Done

    Line 11, Patchset 3: background: url('/container-timing/resources/square100.png');
    width: 100px;
    height: 100px;
    David Baron . resolved

    This seems like it's a slightly more interesting test if the width and height are bigger than 100 and the image gets tiled. (Right now, it doesn't test *which* size is reported.)

    Same for the element timing test.

    José Dapena Paz

    Done

    Line 22, Patchset 3: let beforeRender;
    David Baron . resolved

    I think this `let` could, and probably should, be one scope further in (that is, inside the anonymous function passed to `async_test`).

    José Dapena Paz

    Done

    File third_party/blink/web_tests/external/wpt/container-timing/tentative/pseudo-with-image-content-in-container-timing.html
    Line 10, Patchset 3: content: url('/container-timing/resources/square100.png');
    width: 100px;
    height: 100px;
    David Baron . resolved

    This seems like it's a slightly more interesting test if the width and height are bigger than 100 and the image doesn't fill the element. (Right now, it doesn't test *which* size is reported.)

    Same for the element timing test.

    José Dapena Paz

    Done

    Gerrit-Comment-Date: Fri, 04 Jul 2025 18:08:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: David Baron <dba...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    José Dapena Paz (Gerrit)

    unread,
    Jul 4, 2025, 2:13:52 PM7/4/25
    to David Baron, Chromium LUCI CQ, Michal Mocny, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Baron and Michal Mocny

    José Dapena Paz added 1 comment

    File third_party/blink/renderer/core/paint/image_painter.cc
    Line 264, Patchset 3: if (image_content &&

    (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
    (!node && layout_image_.IsAnonymous())) &&
    David Baron . resolved

    I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

    • the `<object>` element
    • the `<input type=image>` element
    • the `<picture>` element (maybe)
    • images from the `list-style-image` property

    It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

    Michal Mocny

    I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

    José Dapena Paz

    Picture was apparently already working. It will report the img node inside (and that's where we should add the elementtiming. `containertiming` is going to allow getting that from `picture` node.

    `<input type=image>`, `<object>` and `list-style-image` work with this change (last one also requiring pseudo support).

    I will provide additional tests, and do the suggested clean ups. Finally, thanks to reducing this condition, the results are going to be more generic and we will get element timing support for more scenarios.

    José Dapena Paz

    Finally took the approach of removing all the checks so it includes more cases. So far it works.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Baron
    • Michal Mocny
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    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: I8f810ac5fb118f2d66c78f29d371348d13c45375
    Gerrit-Change-Number: 6656960
    Gerrit-PatchSet: 4
    Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: David Baron <dba...@chromium.org>
    Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
    Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
    Gerrit-Attention: David Baron <dba...@chromium.org>
    Gerrit-Comment-Date: Fri, 04 Jul 2025 18:13:39 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
    Comment-In-Reply-To: David Baron <dba...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Michal Mocny (Gerrit)

    unread,
    Jul 6, 2025, 9:08:11 AM7/6/25
    to José Dapena Paz, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Baron and José Dapena Paz

    Michal Mocny added 4 comments

    Patchset-level comments
    File-level comment, Patchset 5 (Latest):
    Michal Mocny . resolved

    This is great! And appreciate the new tests.

    Do you think you might be interested in updating the LCP image paint timing detector to match, after this?

    File third_party/blink/renderer/core/paint/image_painter.cc
    Line 264, Patchset 3: if (image_content &&
    (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
    (!node && layout_image_.IsAnonymous())) &&
    David Baron . resolved

    I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

    • the `<object>` element
    • the `<input type=image>` element
    • the `<picture>` element (maybe)
    • images from the `list-style-image` property

    It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

    Michal Mocny

    I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

    José Dapena Paz

    Picture was apparently already working. It will report the img node inside (and that's where we should add the elementtiming. `containertiming` is going to allow getting that from `picture` node.

    `<input type=image>`, `<object>` and `list-style-image` work with this change (last one also requiring pseudo support).

    I will provide additional tests, and do the suggested clean ups. Finally, thanks to reducing this condition, the results are going to be more generic and we will get element timing support for more scenarios.

    José Dapena Paz

    Finally took the approach of removing all the checks so it includes more cases. So far it works.

    Michal Mocny

    I know this is a small change-- but I wonder if this is one that could be carved out into a finch experiment, to assess how many new candidates we get and what timing shift it causes.

    Or, at least add a UseCounter for how often we arrive inside this branch, but None of the old conditions are met, so its a new source.

    File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
    Line 35, Patchset 5 (Latest): // Do not use LayoutObject::EnclosingNode as it does not check properly if
    Michal Mocny . resolved

    Q: should EnclosingNode be fixed, instead, or is this on purpose?

    Line 39, Patchset 5 (Latest): enclosing_node = e;
    Michal Mocny . unresolved

    Nit: you could just check if `IsPseudoElement()` here and return `UltimateOriginatingElement()` or `e`, then outside of the loop you `return nullptr`

    Then you don't need `enclosing_node` or `break`

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Baron
    • José Dapena Paz
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      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: I8f810ac5fb118f2d66c78f29d371348d13c45375
      Gerrit-Change-Number: 6656960
      Gerrit-PatchSet: 5
      Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
      Gerrit-Reviewer: David Baron <dba...@chromium.org>
      Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
      Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
      Gerrit-Attention: David Baron <dba...@chromium.org>
      Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
      Gerrit-Comment-Date: Sun, 06 Jul 2025 13:07:59 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Michal Mocny (Gerrit)

      unread,
      Jul 6, 2025, 9:08:14 AM7/6/25
      to José Dapena Paz, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
      Attention needed from David Baron and José Dapena Paz

      Michal Mocny voted Code-Review+1

      Code-Review+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • David Baron
      • José Dapena Paz
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I8f810ac5fb118f2d66c78f29d371348d13c45375
        Gerrit-Change-Number: 6656960
        Gerrit-PatchSet: 5
        Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
        Gerrit-Reviewer: David Baron <dba...@chromium.org>
        Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Attention: David Baron <dba...@chromium.org>
        Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
        Gerrit-Comment-Date: Sun, 06 Jul 2025 13:08:04 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Michal Mocny (Gerrit)

        unread,
        Jul 6, 2025, 9:08:40 AM7/6/25
        to José Dapena Paz, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from David Baron and José Dapena Paz

        Michal Mocny added 1 comment

        File third_party/blink/renderer/core/paint/image_painter.cc
        Line 264, Patchset 3: if (image_content &&
        (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
        (!node && layout_image_.IsAnonymous())) &&
        David Baron . unresolved

        I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

        • the `<object>` element
        • the `<input type=image>` element
        • the `<picture>` element (maybe)
        • images from the `list-style-image` property

        It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

        Michal Mocny

        I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

        José Dapena Paz

        Picture was apparently already working. It will report the img node inside (and that's where we should add the elementtiming. `containertiming` is going to allow getting that from `picture` node.

        `<input type=image>`, `<object>` and `list-style-image` work with this change (last one also requiring pseudo support).

        I will provide additional tests, and do the suggested clean ups. Finally, thanks to reducing this condition, the results are going to be more generic and we will get element timing support for more scenarios.

        José Dapena Paz

        Finally took the approach of removing all the checks so it includes more cases. So far it works.

        Michal Mocny

        I know this is a small change-- but I wonder if this is one that could be carved out into a finch experiment, to assess how many new candidates we get and what timing shift it causes.

        Or, at least add a UseCounter for how often we arrive inside this branch, but None of the old conditions are met, so its a new source.

        Michal Mocny

        Marked as unresolved.

        Gerrit-Comment-Date: Sun, 06 Jul 2025 13:08:28 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        José Dapena Paz (Gerrit)

        unread,
        Jul 7, 2025, 7:29:58 AM7/7/25
        to Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from David Baron

        José Dapena Paz added 1 comment

        File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
        Line 35, Patchset 5 (Latest): // Do not use LayoutObject::EnclosingNode as it does not check properly if
        Michal Mocny . resolved

        Q: should EnclosingNode be fixed, instead, or is this on purpose?

        José Dapena Paz

        Yes, I tried to avoid a working function that assumes it will not get nullptr to be changed. Though, now you say this, I have doubts this could be really a good idea.

        I checked, and the crash happens, as an example, when we get image finished event for a layout object that is not inserted yet in the layout tree and has no DOM node. I.e. the list markers, when added, and the image is cached and ready to paint, get the image finished event, and there is no node and we cannot resolve the pseudo either.

        Maybe, question could be: would that mean we are getting, for some cases, the image finished event too much early, so we don't get then the timing event? I need to figure out the case for testing that reliably, but I suspect we may be missing events in that situation.

        The solution would be checking when we add a layout object to a container if it may be interesting for element or container timing, and send the finished event at that point. Usually it will be accurate as when we get that scenario, we will complete the layout and paint later.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Baron
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        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: I8f810ac5fb118f2d66c78f29d371348d13c45375
        Gerrit-Change-Number: 6656960
        Gerrit-PatchSet: 5
        Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
        Gerrit-Reviewer: David Baron <dba...@chromium.org>
        Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
        Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
        Gerrit-Attention: David Baron <dba...@chromium.org>
        Gerrit-Comment-Date: Mon, 07 Jul 2025 11:29:40 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        José Dapena Paz (Gerrit)

        unread,
        Jul 7, 2025, 11:52:42 AM7/7/25
        to Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
        Attention needed from David Baron and Michal Mocny

        José Dapena Paz added 3 comments

        Patchset-level comments
        Michal Mocny . resolved

        This is great! And appreciate the new tests.

        Do you think you might be interested in updating the LCP image paint timing detector to match, after this?

        José Dapena Paz

        Not a priority here, though I could try. Though, I'd love to get some guidance on where in LCP we are processing the layout images that could get discarded?

        File third_party/blink/renderer/core/paint/image_painter.cc
        Line 264, Patchset 3: if (image_content &&
        (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
        (!node && layout_image_.IsAnonymous())) &&
        David Baron . unresolved

        I'm wondering whether this condition should be here at all. If I'm skimming the code correctly it looks like the remaining things that are excluded here are:

        • the `<object>` element
        • the `<input type=image>` element
        • the `<picture>` element (maybe)
        • images from the `list-style-image` property

        It's not clear to me why any of these should be skipped given the rationale for this change. Would it make sense to drop this condition entirely (so the code is just `if (image_content && image_content->IsLoaded())`, and add some brief tests for the above?

        Michal Mocny

        I am okay with this change for Element timing, though I'll try to dig into the original motivations. Perhaps it was as simple as the original patch for HTML Video support got this wrong, but maybe we had some specific use cases to restrict for images...

        José Dapena Paz

        Picture was apparently already working. It will report the img node inside (and that's where we should add the elementtiming. `containertiming` is going to allow getting that from `picture` node.

        `<input type=image>`, `<object>` and `list-style-image` work with this change (last one also requiring pseudo support).

        I will provide additional tests, and do the suggested clean ups. Finally, thanks to reducing this condition, the results are going to be more generic and we will get element timing support for more scenarios.

        José Dapena Paz

        Finally took the approach of removing all the checks so it includes more cases. So far it works.

        Michal Mocny

        I know this is a small change-- but I wonder if this is one that could be carved out into a finch experiment, to assess how many new candidates we get and what timing shift it causes.

        Or, at least add a UseCounter for how often we arrive inside this branch, but None of the old conditions are met, so its a new source.

        Michal Mocny

        Marked as unresolved.

        José Dapena Paz

        I guess UseCounter would be simpler, and it looks interesting to add it anyway. I guess it would be adding to ImageElementTiming::NotifyImageFinished, after checking it is needed for timing, so it counts only the elements that are matched because of the new conditions?

        Finch seems more interesting though. What's the process to create a finch trial? Would it be just adding a runtime blink feature?

        File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
        Line 39, Patchset 5: enclosing_node = e;
        Michal Mocny . unresolved

        Nit: you could just check if `IsPseudoElement()` here and return `UltimateOriginatingElement()` or `e`, then outside of the loop you `return nullptr`

        Then you don't need `enclosing_node` or `break`

        José Dapena Paz

        I will finally still reuse EnclosingNode(), but avoid the failing condition. We should not even try to get it if there is no node and no parent layout.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • David Baron
        • Michal Mocny
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 5
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: David Baron <dba...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Comment-Date: Mon, 07 Jul 2025 15:52:25 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 9, 2025, 3:53:58 AM7/9/25
          to Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron and Michal Mocny

          José Dapena Paz added 1 comment

          File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
          Line 39, Patchset 5: enclosing_node = e;
          Michal Mocny . unresolved

          Nit: you could just check if `IsPseudoElement()` here and return `UltimateOriginatingElement()` or `e`, then outside of the loop you `return nullptr`

          Then you don't need `enclosing_node` or `break`

          José Dapena Paz

          I will finally still reuse EnclosingNode(), but avoid the failing condition. We should not even try to get it if there is no node and no parent layout.

          José Dapena Paz

          So, after trying again, another test is crashing. I will finally move to modify `LayoutObject::EnclosingNode` to return `nullptr` instead of crashing. I don't expect big performance problems as `LayoutObject::EnclosingNode` is not used in many places (and traversals are not expected to be long).

          I guess the right solution would be actually knowing a condition we could check that will tell us that a DOM tree is detached by reading its child. But this solution is simpler for now.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Baron
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 6
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: David Baron <dba...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Comment-Date: Wed, 09 Jul 2025 07:53:39 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
          Comment-In-Reply-To: José Dapena Paz <jda...@igalia.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Michal Mocny (Gerrit)

          unread,
          Jul 9, 2025, 9:34:26 AM7/9/25
          to José Dapena Paz, David Baron, Chromium LUCI CQ, chromium...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron and José Dapena Paz

          Michal Mocny added 3 comments

          Patchset-level comments
          Michal Mocny . resolved

          This is great! And appreciate the new tests.

          Do you think you might be interested in updating the LCP image paint timing detector to match, after this?

          José Dapena Paz

          Not a priority here, though I could try. Though, I'd love to get some guidance on where in LCP we are processing the layout images that could get discarded?

          Michal Mocny

          Oh, it looks like we already don't constrain LCP candidates on these types, this is just an extra constraint added for Element Timing only.

          Even more-so LGTM to remove to make consistent.

          File third_party/blink/renderer/core/paint/image_painter.cc
          Michal Mocny

          runtime enabled feature is all you need, yes. Then there is an internal system for configuring experiments which I could help set up. I think you might also not have access to chrome histogram data, but I could help verify any metric shifts.

          I think a runtime flag would help qualify how much metrics shifted if we expect a significant effect of this change, while a UseCounter would just help confirm that this change rarely triggers and overall behaviour is similar to baseline.

          ---

          IMHO for Element Timing, where we expect explicit opt-in for measures, and especially because LCP already doesn't constrain on these and is the more popular and default mechanism for Element Timing -- a single UseCounter is sufficient and should rarely trigger.

          File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
          Line 39, Patchset 5: enclosing_node = e;
          Michal Mocny . unresolved

          Nit: you could just check if `IsPseudoElement()` here and return `UltimateOriginatingElement()` or `e`, then outside of the loop you `return nullptr`

          Then you don't need `enclosing_node` or `break`

          José Dapena Paz

          I will finally still reuse EnclosingNode(), but avoid the failing condition. We should not even try to get it if there is no node and no parent layout.

          José Dapena Paz

          So, after trying again, another test is crashing. I will finally move to modify `LayoutObject::EnclosingNode` to return `nullptr` instead of crashing. I don't expect big performance problems as `LayoutObject::EnclosingNode` is not used in many places (and traversals are not expected to be long).

          I guess the right solution would be actually knowing a condition we could check that will tell us that a DOM tree is detached by reading its child. But this solution is simpler for now.

          Michal Mocny

          I'm not familiar enough to offer suggestions in this area-- defer to other reviewers

          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Baron
          • José Dapena Paz
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 7
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: David Baron <dba...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
          Gerrit-Comment-Date: Wed, 09 Jul 2025 13:34:18 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
          Comment-In-Reply-To: David Baron <dba...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 9, 2025, 11:51:46 AM7/9/25
          to Chromium Metrics Reviews, Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron and Michal Mocny

          José Dapena Paz added 1 comment

          File third_party/blink/renderer/core/paint/image_painter.cc
          José Dapena Paz

          I added both. Specially to have a kill switch... Maybe it would be better to set it already to enabled by default?

          The problem: now there are several tests that fail with the default configuration. I need to find how to link tests with specific configuration flags.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Baron
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 8
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: David Baron <dba...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Comment-Date: Wed, 09 Jul 2025 15:51:30 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 9, 2025, 12:05:57 PM7/9/25
          to Chromium Metrics Reviews, Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          File third_party/blink/renderer/core/paint/image_painter.cc
          José Dapena Paz

          Maybe adding a blink feature with the same name, and making it "experimental"?

          Gerrit-Comment-Date: Wed, 09 Jul 2025 16:05:38 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 11, 2025, 7:12:44 AM7/11/25
          to Chromium Metrics Reviews, Michal Mocny, David Baron, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron and Michal Mocny

          José Dapena Paz added 3 comments

          File third_party/blink/renderer/core/paint/image_painter.cc
          Line 41, Patchset 8 (Latest): base::FEATURE_DISABLED_BY_DEFAULT);
          José Dapena Paz . unresolved

          I will move to use a runtime enabled feature for this. This way it will be enabled by default.

          José Dapena Paz

          I will do this. Runtime feature set as experimetnal.

          Line 283, Patchset 8 (Latest): if (is_image_or_video_element) {
          José Dapena Paz . unresolved

          Typo, should be `!image_or_video_element`.

          Gerrit-Comment-Date: Fri, 11 Jul 2025 11:12:25 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Michal Mocny (Gerrit)

          unread,
          Jul 11, 2025, 8:26:04 AM7/11/25
          to José Dapena Paz, Chromium Metrics Reviews, David Baron, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron and José Dapena Paz

          Michal Mocny added 1 comment

          Patchset-level comments
          File-level comment, Patchset 8 (Latest):
          Michal Mocny . resolved

          (Patch is coming along great-- I didnt find anything beyond your own self-review comments)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Baron
          • José Dapena Paz
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 8
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: David Baron <dba...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
          Gerrit-Comment-Date: Fri, 11 Jul 2025 12:25:54 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Ian Kilpatrick (Gerrit)

          unread,
          Jul 11, 2025, 2:25:25 PM7/11/25
          to José Dapena Paz, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from José Dapena Paz

          Ian Kilpatrick added 1 comment

          File third_party/blink/renderer/core/layout/layout_image.cc
          Line 77, Patchset 8 (Latest):void LayoutImage::InsertedIntoTree() {
          Ian Kilpatrick . unresolved

          LayoutImage also is a <video> and other things, is this desired for these objects as well?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • José Dapena Paz
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 8
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
          Gerrit-Comment-Date: Fri, 11 Jul 2025 18:25:17 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 15, 2025, 7:38:02 AM7/15/25
          to Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick

          José Dapena Paz added 1 comment

          File third_party/blink/renderer/core/layout/layout_image.cc
          Line 77, Patchset 8 (Latest):void LayoutImage::InsertedIntoTree() {
          Ian Kilpatrick . unresolved

          LayoutImage also is a <video> and other things, is this desired for these objects as well?

          José Dapena Paz

          To me, ideally yes. Though, I would actually like to verify how it works. Any example I could use to see how it works? Is it just adding a video node? Do I need to make it autoplay?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 8
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Comment-Date: Tue, 15 Jul 2025 11:37:44 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 15, 2025, 11:45:11 AM7/15/25
          to Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from David Baron, Ian Kilpatrick and Michal Mocny

          José Dapena Paz added 3 comments

          File third_party/blink/renderer/core/paint/image_painter.cc
          Line 41, Patchset 8: base::FEATURE_DISABLED_BY_DEFAULT);
          José Dapena Paz . resolved

          I will move to use a runtime enabled feature for this. This way it will be enabled by default.

          José Dapena Paz

          Done

          Line 264, Patchset 3: if (image_content &&
          (IsA<HTMLImageElement>(node) || IsA<HTMLVideoElement>(node) ||
          (!node && layout_image_.IsAnonymous())) &&
          David Baron . resolved
          José Dapena Paz

          Done

          Line 283, Patchset 8: if (is_image_or_video_element) {
          José Dapena Paz . resolved

          Typo, should be `!image_or_video_element`.

          José Dapena Paz

          Done

          Open in Gerrit

          Related details

          Attention is currently required from:
          • David Baron
          • Ian Kilpatrick
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 9
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: David Baron <dba...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Comment-Date: Tue, 15 Jul 2025 15:44:56 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 24, 2025, 4:54:06 AM7/24/25
          to Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick and Michal Mocny

          José Dapena Paz added 2 comments

          File third_party/blink/renderer/core/layout/layout_image.cc
          Line 77, Patchset 8:void LayoutImage::InsertedIntoTree() {
          Ian Kilpatrick . unresolved

          LayoutImage also is a <video> and other things, is this desired for these objects as well?

          José Dapena Paz

          To me, ideally yes. Though, I would actually like to verify how it works. Any example I could use to see how it works? Is it just adding a video node? Do I need to make it autoplay?

          José Dapena Paz

          After testing with <video>, I see elementtiming and containertiming both report if there is a `poster`. But not for the video contents themselves.

          I think this is correct, and fits well with the purpose of showing any kind of image content.

          Ideally in the future, we could add support for video contents in both. But for now it is not implemented (and should likely be another task and commit).

          I will add tests for both container timing and element timing getting information from a video poster.

          File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
          Line 39, Patchset 5: enclosing_node = e;
          Michal Mocny . resolved

          Nit: you could just check if `IsPseudoElement()` here and return `UltimateOriginatingElement()` or `e`, then outside of the loop you `return nullptr`

          Then you don't need `enclosing_node` or `break`

          José Dapena Paz

          I will finally still reuse EnclosingNode(), but avoid the failing condition. We should not even try to get it if there is no node and no parent layout.

          José Dapena Paz

          So, after trying again, another test is crashing. I will finally move to modify `LayoutObject::EnclosingNode` to return `nullptr` instead of crashing. I don't expect big performance problems as `LayoutObject::EnclosingNode` is not used in many places (and traversals are not expected to be long).

          I guess the right solution would be actually knowing a condition we could check that will tell us that a DOM tree is detached by reading its child. But this solution is simpler for now.

          Michal Mocny

          I'm not familiar enough to offer suggestions in this area-- defer to other reviewers

          José Dapena Paz

          I finally adjusted the LayoutObject method to return nullptr in that case.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 9
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Comment-Date: Thu, 24 Jul 2025 08:53:51 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
          Comment-In-Reply-To: Ian Kilpatrick <ikilp...@chromium.org>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Jul 24, 2025, 5:32:11 AM7/24/25
          to Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick and Michal Mocny

          José Dapena Paz added 1 comment

          File third_party/blink/renderer/core/layout/layout_image.cc
          Line 77, Patchset 8:void LayoutImage::InsertedIntoTree() {
          Ian Kilpatrick . resolved

          LayoutImage also is a <video> and other things, is this desired for these objects as well?

          José Dapena Paz

          To me, ideally yes. Though, I would actually like to verify how it works. Any example I could use to see how it works? Is it just adding a video node? Do I need to make it autoplay?

          José Dapena Paz

          After testing with <video>, I see elementtiming and containertiming both report if there is a `poster`. But not for the video contents themselves.

          I think this is correct, and fits well with the purpose of showing any kind of image content.

          Ideally in the future, we could add support for video contents in both. But for now it is not implemented (and should likely be another task and commit).

          I will add tests for both container timing and element timing getting information from a video poster.

          José Dapena Paz

          My mistake here: <video> poster is already supported without this patch. And this patch makes no difference with it. So I will not introduce a test for that here.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          • Michal Mocny
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 9
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Comment-Date: Thu, 24 Jul 2025 09:31:57 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Michal Mocny (Gerrit)

          unread,
          Jul 24, 2025, 8:59:21 AM7/24/25
          to José Dapena Paz, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick and José Dapena Paz

          Michal Mocny added 1 comment

          File third_party/blink/renderer/core/layout/layout_image.cc
          Line 77, Patchset 8:void LayoutImage::InsertedIntoTree() {
          Ian Kilpatrick . resolved

          LayoutImage also is a <video> and other things, is this desired for these objects as well?

          José Dapena Paz

          To me, ideally yes. Though, I would actually like to verify how it works. Any example I could use to see how it works? Is it just adding a video node? Do I need to make it autoplay?

          José Dapena Paz

          After testing with <video>, I see elementtiming and containertiming both report if there is a `poster`. But not for the video contents themselves.

          I think this is correct, and fits well with the purpose of showing any kind of image content.

          Ideally in the future, we could add support for video contents in both. But for now it is not implemented (and should likely be another task and commit).

          I will add tests for both container timing and element timing getting information from a video poster.

          José Dapena Paz

          My mistake here: <video> poster is already supported without this patch. And this patch makes no difference with it. So I will not introduce a test for that here.

          Michal Mocny

          This is I think a gap between element timing and LCP. LCP does support video, beyond poster images.

          There are still some issues, and I've just updated Issue 372929290.

          Perhaps this is yet another reason to merge image element and lcp timing detectors...

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          • José Dapena Paz
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 10
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
          Gerrit-Comment-Date: Thu, 24 Jul 2025 12:59:12 +0000
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          José Dapena Paz (Gerrit)

          unread,
          Aug 5, 2025, 2:11:40 PM8/5/25
          to Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Michal Mocny, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick

          José Dapena Paz added 1 comment

          Patchset-level comments
          José Dapena Paz . resolved

          To the attention of the reviewers... Any other further action required? Maybe adding extra owners for specific reviews?

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          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: I8f810ac5fb118f2d66c78f29d371348d13c45375
          Gerrit-Change-Number: 6656960
          Gerrit-PatchSet: 11
          Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
          Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
          Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
          Gerrit-CC: David Baron <dba...@chromium.org>
          Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
          Gerrit-Comment-Date: Tue, 05 Aug 2025 18:11:24 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Michal Mocny (Gerrit)

          unread,
          Aug 6, 2025, 9:29:57 AM8/6/25
          to José Dapena Paz, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
          Attention needed from Ian Kilpatrick and José Dapena Paz

          Michal Mocny voted and added 1 comment

          Votes added by Michal Mocny

          Code-Review+1

          1 comment

          Patchset-level comments
          File-level comment, Patchset 11 (Latest):
          Michal Mocny . resolved

          This looks good to me, but patch needs to resolve merge conflict.

          I still think the next followup is to see if the image paint timing detector used for LCP needs to be updated to match this new behaviour to reduce the differences (and ideally we just merge detectors completely)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Ian Kilpatrick
          • José Dapena Paz
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            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: I8f810ac5fb118f2d66c78f29d371348d13c45375
            Gerrit-Change-Number: 6656960
            Gerrit-PatchSet: 11
            Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: David Baron <dba...@chromium.org>
            Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
            Gerrit-Comment-Date: Wed, 06 Aug 2025 13:29:49 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            José Dapena Paz (Gerrit)

            unread,
            Aug 6, 2025, 3:20:01 PM8/6/25
            to Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
            Attention needed from Ian Kilpatrick

            José Dapena Paz added 1 comment

            Patchset-level comments
            Michal Mocny . resolved

            This looks good to me, but patch needs to resolve merge conflict.

            I still think the next followup is to see if the image paint timing detector used for LCP needs to be updated to match this new behaviour to reduce the differences (and ideally we just merge detectors completely)

            José Dapena Paz

            Updated. Usual conflict with the metrics/web feature pair.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ian Kilpatrick
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            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: I8f810ac5fb118f2d66c78f29d371348d13c45375
            Gerrit-Change-Number: 6656960
            Gerrit-PatchSet: 11
            Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: David Baron <dba...@chromium.org>
            Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Comment-Date: Wed, 06 Aug 2025 19:19:42 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            José Dapena Paz (Gerrit)

            unread,
            Aug 28, 2025, 3:07:33 PM8/28/25
            to Koji Ishii, Philip Rogers, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
            Attention needed from Ian Kilpatrick, Koji Ishii and Philip Rogers

            José Dapena Paz added 1 comment

            José Dapena Paz . resolved

            Adding reviewers for specific paths:

            • Koji Ishii for core/layout
            • Philip Rogers for core/paint
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ian Kilpatrick
            • Koji Ishii
            • Philip Rogers
            Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement satisfiedCode-Review
            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: I8f810ac5fb118f2d66c78f29d371348d13c45375
            Gerrit-Change-Number: 6656960
            Gerrit-PatchSet: 13
            Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
            Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
            Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
            Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
            Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
            Gerrit-CC: David Baron <dba...@chromium.org>
            Gerrit-Attention: Koji Ishii <ko...@chromium.org>
            Gerrit-Attention: Philip Rogers <p...@chromium.org>
            Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
            Gerrit-Comment-Date: Thu, 28 Aug 2025 19:07:13 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Philip Rogers (Gerrit)

            unread,
            Aug 28, 2025, 5:00:07 PM8/28/25
            to José Dapena Paz, Koji Ishii, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
            Attention needed from Ian Kilpatrick, José Dapena Paz and Koji Ishii

            Philip Rogers added 2 comments

            File third_party/blink/renderer/core/layout/layout_image.cc
            Line 77, Patchset 13 (Latest):void LayoutImage::InsertedIntoTree() {
            Philip Rogers . unresolved

            Is this a bugfix which is somewhat separate from the overall patch? If so, can you break this out into its own change and tests?

            File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
            Line 33, Patchset 13 (Latest):inline Node* GetGeneratingNode(const LayoutObject& layout_object) {
            Philip Rogers . unresolved

            Does this differ from `LayoutObject::GeneratingNode`? It seems like we should try to unify the logic, or document how it is different. I think it's possible that the existing function of the same name is missing some cases you are covering here.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Ian Kilpatrick
            • José Dapena Paz
            • Koji Ishii
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              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: I8f810ac5fb118f2d66c78f29d371348d13c45375
              Gerrit-Change-Number: 6656960
              Gerrit-PatchSet: 13
              Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
              Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
              Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
              Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
              Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
              Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: David Baron <dba...@chromium.org>
              Gerrit-Attention: Koji Ishii <ko...@chromium.org>
              Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
              Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
              Gerrit-Comment-Date: Thu, 28 Aug 2025 20:59:56 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              José Dapena Paz (Gerrit)

              unread,
              Aug 29, 2025, 5:04:17 AM8/29/25
              to Koji Ishii, Philip Rogers, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
              Attention needed from Ian Kilpatrick, Koji Ishii and Philip Rogers

              José Dapena Paz added 2 comments

              File third_party/blink/renderer/core/layout/layout_image.cc
              Line 77, Patchset 13 (Latest):void LayoutImage::InsertedIntoTree() {
              Philip Rogers . unresolved

              Is this a bugfix which is somewhat separate from the overall patch? If so, can you break this out into its own change and tests?

              José Dapena Paz

              From the patchset (6) that added this change:

              Yes, I tried to avoid a working function that assumes it will not get nullptr to be changed. Though, now you say this, I have doubts this could be really a good idea.
              >I checked, and the crash happens, as an example, when we get image finished event for a layout object that is not inserted yet in the layout tree and has no DOM node. I.e. the list markers, when added, and the image is cached and ready to paint, get the image finished event, and there is no node and we cannot resolve the pseudo either.
              > Maybe, question could be: would that mean we are getting, for some cases, the image finished event too much early, so we don't get then the timing event? I need to figure out the case for testing that reliably, but I suspect we may be missing events in that situation.
              > The solution would be checking when we add a layout object to a container if it may be interesting for element or container timing, and send the finished event at that point. Usually it will be accurate as when we get that scenario, we will complete the layout and paint later.

              The solution for this problem was in two parts:

              • One was making sure we do not crash if there is still no element
              • Then considering the timing once we have the element information, and we know it should generate a paint.

              The problem is that the case I found was very specific about being a pseudo element (list markers). But I could try to find a similar case, checking if containertiming is obtained. This would be elements that would not be considered for timing events (they do not have elementtiming or containertiming), but when added to the tree, are considered at that point.

              So, I will try to find a reproducing case so I can split this change from the pseudo element support. If I cannot, I can still have this patch coming after landing pseudo element support, and add a specific case for it.

              File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
              Line 33, Patchset 13 (Latest):inline Node* GetGeneratingNode(const LayoutObject& layout_object) {
              Philip Rogers . unresolved

              Does this differ from `LayoutObject::GeneratingNode`? It seems like we should try to unify the logic, or document how it is different. I think it's possible that the existing function of the same name is missing some cases you are covering here.

              José Dapena Paz

              Sure, there are a few differences:

              • LayoutObject::GeneratingNode assumes GetNode() is not null. Here, as it does not act at the same points, GetNode() could be null. And this could be done in anonymous nodes also.
              • For when we find a pseudo element, we use the specific element that originates it.

              So, in the end, it is quite different. Originally this was a kind of safer GeneratingNode for this case, but it evolved a lot at later stages of the implementation.

              What do you think if, instead, we rename this method to be more explicit about its use: `GetTimingNode()`?

              We could also still add a comment explaining a bit the logic.

              In the end this method does two different things:

              • Finding an enclosing node (this is the part that `LayoutObject::GeneratingNode` is not doing).
              • The part for pseudo elements about finding the ultimate originating element. This is a bit richer as it traverses more pseudo element ancestors, and also will check shadow host nodes, not only parent nodes. This part... may be interesting to add in `LayoutObject::GeneratingNode()`. In this case, we could just call `LayoutObjectGeneratingNode()` here. But, for that change, the risk is higher, as we would do a change that impacts all the callers of `GeneratingNode()`.
              Open in Gerrit

              Related details

              Attention is currently required from:
              • Ian Kilpatrick
              • Koji Ishii
              • Philip Rogers
              Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              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: I8f810ac5fb118f2d66c78f29d371348d13c45375
              Gerrit-Change-Number: 6656960
              Gerrit-PatchSet: 13
              Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
              Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
              Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
              Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
              Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
              Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
              Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
              Gerrit-CC: David Baron <dba...@chromium.org>
              Gerrit-Attention: Koji Ishii <ko...@chromium.org>
              Gerrit-Attention: Philip Rogers <p...@chromium.org>
              Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
              Gerrit-Comment-Date: Fri, 29 Aug 2025 09:04:01 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              José Dapena Paz (Gerrit)

              unread,
              Aug 29, 2025, 10:22:40 AM8/29/25
              to Koji Ishii, Philip Rogers, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
              Attention needed from Ian Kilpatrick, Koji Ishii and Philip Rogers

              José Dapena Paz added 1 comment

              File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
              Line 33, Patchset 13 (Latest):inline Node* GetGeneratingNode(const LayoutObject& layout_object) {
              Philip Rogers . unresolved

              Does this differ from `LayoutObject::GeneratingNode`? It seems like we should try to unify the logic, or document how it is different. I think it's possible that the existing function of the same name is missing some cases you are covering here.

              José Dapena Paz

              Sure, there are a few differences:

              • LayoutObject::GeneratingNode assumes GetNode() is not null. Here, as it does not act at the same points, GetNode() could be null. And this could be done in anonymous nodes also.
              • For when we find a pseudo element, we use the specific element that originates it.

              So, in the end, it is quite different. Originally this was a kind of safer GeneratingNode for this case, but it evolved a lot at later stages of the implementation.

              What do you think if, instead, we rename this method to be more explicit about its use: `GetTimingNode()`?

              We could also still add a comment explaining a bit the logic.

              In the end this method does two different things:

              • Finding an enclosing node (this is the part that `LayoutObject::GeneratingNode` is not doing).
              • The part for pseudo elements about finding the ultimate originating element. This is a bit richer as it traverses more pseudo element ancestors, and also will check shadow host nodes, not only parent nodes. This part... may be interesting to add in `LayoutObject::GeneratingNode()`. In this case, we could just call `LayoutObjectGeneratingNode()` here. But, for that change, the risk is higher, as we would do a change that impacts all the callers of `GeneratingNode()`.
              José Dapena Paz

              I made `LayoutObject::EnclosingNode` return the same as the second part of the method, in https://chromium-review.googlesource.com/c/chromium/src/+/6898595

              Running CQ does not throw any regression.

              Gerrit-Comment-Date: Fri, 29 Aug 2025 14:22:21 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              José Dapena Paz (Gerrit)

              unread,
              Dec 1, 2025, 8:48:35 AM12/1/25
              to Koji Ishii, Philip Rogers, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
              Attention needed from Ian Kilpatrick, Koji Ishii, Michal Mocny and Philip Rogers

              José Dapena Paz added 1 comment

              File third_party/blink/renderer/core/paint/timing/image_element_timing.cc
              Line 33, Patchset 13:inline Node* GetGeneratingNode(const LayoutObject& layout_object) {
              Philip Rogers . resolved

              Does this differ from `LayoutObject::GeneratingNode`? It seems like we should try to unify the logic, or document how it is different. I think it's possible that the existing function of the same name is missing some cases you are covering here.

              José Dapena Paz

              Sure, there are a few differences:

              • LayoutObject::GeneratingNode assumes GetNode() is not null. Here, as it does not act at the same points, GetNode() could be null. And this could be done in anonymous nodes also.
              • For when we find a pseudo element, we use the specific element that originates it.

              So, in the end, it is quite different. Originally this was a kind of safer GeneratingNode for this case, but it evolved a lot at later stages of the implementation.

              What do you think if, instead, we rename this method to be more explicit about its use: `GetTimingNode()`?

              We could also still add a comment explaining a bit the logic.

              In the end this method does two different things:

              • Finding an enclosing node (this is the part that `LayoutObject::GeneratingNode` is not doing).
              • The part for pseudo elements about finding the ultimate originating element. This is a bit richer as it traverses more pseudo element ancestors, and also will check shadow host nodes, not only parent nodes. This part... may be interesting to add in `LayoutObject::GeneratingNode()`. In this case, we could just call `LayoutObjectGeneratingNode()` here. But, for that change, the risk is higher, as we would do a change that impacts all the callers of `GeneratingNode()`.
              José Dapena Paz

              I made `LayoutObject::EnclosingNode` return the same as the second part of the method, in https://chromium-review.googlesource.com/c/chromium/src/+/6898595

              Running CQ does not throw any regression.

              José Dapena Paz

              Finally I did not modify LayoutObject::EnclosingNode, and I only update LayoutObject::GetGeneratingNode.

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Ian Kilpatrick
              • Koji Ishii
              • Michal Mocny
              • Philip Rogers
              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: I8f810ac5fb118f2d66c78f29d371348d13c45375
                Gerrit-Change-Number: 6656960
                Gerrit-PatchSet: 19
                Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
                Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
                Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: David Baron <dba...@chromium.org>
                Gerrit-Attention: Philip Rogers <p...@chromium.org>
                Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
                Gerrit-Attention: Koji Ishii <ko...@chromium.org>
                Gerrit-Comment-Date: Mon, 01 Dec 2025 13:48:19 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: José Dapena Paz <jda...@igalia.com>
                Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Michal Mocny (Gerrit)

                unread,
                Jan 15, 2026, 3:38:36 PM (2 days ago) Jan 15
                to José Dapena Paz, Koji Ishii, Philip Rogers, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
                Attention needed from Ian Kilpatrick, José Dapena Paz, Koji Ishii and Philip Rogers

                Michal Mocny added 1 comment

                Patchset-level comments
                File-level comment, Patchset 19 (Latest):
                Michal Mocny . resolved

                Are you still hoping to update this patch?

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Ian Kilpatrick
                • José Dapena Paz
                • Koji Ishii
                • Philip Rogers
                Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
                Gerrit-Attention: Philip Rogers <p...@chromium.org>
                Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Attention: Koji Ishii <ko...@chromium.org>
                Gerrit-Comment-Date: Thu, 15 Jan 2026 20:38:28 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                José Dapena Paz (Gerrit)

                unread,
                Jan 16, 2026, 3:44:23 AM (yesterday) Jan 16
                to Koji Ishii, Philip Rogers, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
                Attention needed from Ian Kilpatrick, Koji Ishii, Michal Mocny and Philip Rogers

                José Dapena Paz added 2 comments

                Patchset-level comments
                Michal Mocny . resolved

                Are you still hoping to update this patch?

                José Dapena Paz

                I am retaking this this week. The pending issue is finding if I can split the patch in two, being one the image finished case.

                But in december I spent some time trying to find a case where the issue happened without pseudos. And I could not find any.

                So I will finally answer that I could not find a fix, so we would not split the patch in two.

                It would be interesting to actually have some data to know if that case is really possible. WDYT?

                File third_party/blink/renderer/core/layout/layout_image.cc
                Line 77, Patchset 13:void LayoutImage::InsertedIntoTree() {
                Philip Rogers . unresolved

                Is this a bugfix which is somewhat separate from the overall patch? If so, can you break this out into its own change and tests?

                José Dapena Paz

                From the patchset (6) that added this change:

                Yes, I tried to avoid a working function that assumes it will not get nullptr to be changed. Though, now you say this, I have doubts this could be really a good idea.
                >I checked, and the crash happens, as an example, when we get image finished event for a layout object that is not inserted yet in the layout tree and has no DOM node. I.e. the list markers, when added, and the image is cached and ready to paint, get the image finished event, and there is no node and we cannot resolve the pseudo either.
                > Maybe, question could be: would that mean we are getting, for some cases, the image finished event too much early, so we don't get then the timing event? I need to figure out the case for testing that reliably, but I suspect we may be missing events in that situation.
                > The solution would be checking when we add a layout object to a container if it may be interesting for element or container timing, and send the finished event at that point. Usually it will be accurate as when we get that scenario, we will complete the layout and paint later.

                The solution for this problem was in two parts:

                • One was making sure we do not crash if there is still no element
                • Then considering the timing once we have the element information, and we know it should generate a paint.

                The problem is that the case I found was very specific about being a pseudo element (list markers). But I could try to find a similar case, checking if containertiming is obtained. This would be elements that would not be considered for timing events (they do not have elementtiming or containertiming), but when added to the tree, are considered at that point.

                So, I will try to find a reproducing case so I can split this change from the pseudo element support. If I cannot, I can still have this patch coming after landing pseudo element support, and add a specific case for it.

                José Dapena Paz

                I have been trying to find a case out of the pseudo elements that would reproduce this issue, and couldn't. So it may really be specific to pseudos.

                In that condition, I think we don't want to split the patch in two.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Ian Kilpatrick
                • Koji Ishii
                • Michal Mocny
                • Philip Rogers
                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: I8f810ac5fb118f2d66c78f29d371348d13c45375
                Gerrit-Change-Number: 6656960
                Gerrit-PatchSet: 20
                Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
                Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
                Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: David Baron <dba...@chromium.org>
                Gerrit-Attention: Philip Rogers <p...@chromium.org>
                Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
                Gerrit-Attention: Koji Ishii <ko...@chromium.org>
                Gerrit-Comment-Date: Fri, 16 Jan 2026 08:44:07 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                Comment-In-Reply-To: José Dapena Paz <jda...@igalia.com>
                Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
                Comment-In-Reply-To: Michal Mocny <mmo...@chromium.org>
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Philip Rogers (Gerrit)

                unread,
                Jan 16, 2026, 8:41:56 PM (16 hours ago) Jan 16
                to José Dapena Paz, Koji Ishii, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
                Attention needed from Ian Kilpatrick, José Dapena Paz, Koji Ishii and Michal Mocny

                Philip Rogers voted and added 3 comments

                Votes added by Philip Rogers

                Code-Review+1

                3 comments

                Patchset-level comments
                File-level comment, Patchset 20 (Latest):
                Philip Rogers . resolved

                LGTM with a few small changes.

                File third_party/blink/renderer/core/layout/layout_object.h
                Line 1703, Patchset 20 (Latest): Node* node = GetNode();
                Philip Rogers . unresolved

                While I think this is correct, I'm worried about causing regressions because of the various callsites of this.

                Can you put this change behind an enabled-by-default flag?

                Can you add a test of this function? Something like:
                ```
                TEST_F(LayoutObjectTest, GeneratingNode) {
                SetBodyInnerHTML(R"HTML(
                <style>
                #pseudo::before { content: "before"; display: block; }
                </style>
                <div id="normal">Normal</div>
                <div id="pseudo"></div>
                <div id="table" style="display: table">
                <div id="row" style="display: table-row">
                Text
                </div>
                </div>
                <div id="table2" style="display: table">
                Text2
                </div>
                )HTML");
                  // 1. Normal element
                LayoutObject* normal = GetLayoutObjectByElementId("normal");
                EXPECT_EQ(GetElementById("normal"), normal->GeneratingNode());
                  // 2. Pseudo element ::before
                Element* pseudo = GetElementById("pseudo");
                LayoutObject* pseudo_layout = pseudo->GetLayoutObject();
                LayoutObject* before = pseudo_layout->SlowFirstChild();
                ASSERT_TRUE(before);
                ASSERT_TRUE(before->IsPseudoElement());
                EXPECT_EQ(pseudo, before->GeneratingNode());
                  // 3. Anonymous object
                // The text node "Text" is inside "row". A table row expects cells.
                // So an anonymous table cell should be created around the text.
                // The hierarchy: LayoutTable -> LayoutTableRow -> LayoutTableCell (Anonymous) -> LayoutText
                LayoutObject* row = GetLayoutObjectByElementId("row");
                LayoutObject* anonymous_cell = row->SlowFirstChild();
                ASSERT_TRUE(anonymous_cell);
                EXPECT_TRUE(anonymous_cell->IsAnonymous());
                EXPECT_TRUE(anonymous_cell->IsTableCell());
                  // GetNode() is null for anonymous objects, so it recurses up to Parent().
                // Parent is "row", so it should return the row element.
                EXPECT_EQ(GetElementById("row"), anonymous_cell->GeneratingNode());
                  // 4. Nested Anonymous objects
                // Hierarchy: LayoutTable -> LayoutTableSection(Anon) -> LayoutTableRow(Anon) -> LayoutTableCell(Anon) -> LayoutText
                LayoutObject* table2 = GetLayoutObjectByElementId("table2");
                LayoutObject* section = table2->SlowFirstChild();
                ASSERT_TRUE(section);
                EXPECT_TRUE(section->IsAnonymous());
                EXPECT_EQ(GetElementById("table2"), section->GeneratingNode());
                  LayoutObject* row2 = section->SlowFirstChild();
                ASSERT_TRUE(row2);
                EXPECT_TRUE(row2->IsAnonymous());
                EXPECT_EQ(GetElementById("table2"), row2->GeneratingNode());
                  LayoutObject* cell2 = row2->SlowFirstChild();
                ASSERT_TRUE(cell2);
                EXPECT_TRUE(cell2->IsAnonymous());
                EXPECT_EQ(GetElementById("table2"), cell2->GeneratingNode());
                }
                ```
                Line 1698, Patchset 20 (Latest): // Returns the styled node that caused the generation of this layoutObject.
                Philip Rogers . unresolved

                Can you update this comment?

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Ian Kilpatrick
                • José Dapena Paz
                • Koji Ishii
                • Michal Mocny
                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: I8f810ac5fb118f2d66c78f29d371348d13c45375
                Gerrit-Change-Number: 6656960
                Gerrit-PatchSet: 20
                Gerrit-Owner: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Reviewer: José Dapena Paz <jda...@igalia.com>
                Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
                Gerrit-Reviewer: Michal Mocny <mmo...@chromium.org>
                Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
                Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
                Gerrit-CC: David Baron <dba...@chromium.org>
                Gerrit-Attention: José Dapena Paz <jda...@igalia.com>
                Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
                Gerrit-Attention: Michal Mocny <mmo...@chromium.org>
                Gerrit-Attention: Koji Ishii <ko...@chromium.org>
                Gerrit-Comment-Date: Sat, 17 Jan 2026 01:41:40 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Philip Rogers (Gerrit)

                unread,
                Jan 16, 2026, 8:42:27 PM (16 hours ago) Jan 16
                to José Dapena Paz, Koji Ishii, Michal Mocny, Ian Kilpatrick, David Baron, Chromium Metrics Reviews, Chromium LUCI CQ, chromium...@chromium.org, jmedle...@chromium.org, asvitkine...@chromium.org, blink-re...@chromium.org, kinuko...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
                Attention needed from Ian Kilpatrick, José Dapena Paz, Koji Ishii and Michal Mocny

                Philip Rogers added 1 comment

                File third_party/blink/renderer/core/layout/layout_image.cc
                Line 77, Patchset 13:void LayoutImage::InsertedIntoTree() {
                Philip Rogers . resolved

                Is this a bugfix which is somewhat separate from the overall patch? If so, can you break this out into its own change and tests?

                José Dapena Paz

                From the patchset (6) that added this change:

                Yes, I tried to avoid a working function that assumes it will not get nullptr to be changed. Though, now you say this, I have doubts this could be really a good idea.
                >I checked, and the crash happens, as an example, when we get image finished event for a layout object that is not inserted yet in the layout tree and has no DOM node. I.e. the list markers, when added, and the image is cached and ready to paint, get the image finished event, and there is no node and we cannot resolve the pseudo either.
                > Maybe, question could be: would that mean we are getting, for some cases, the image finished event too much early, so we don't get then the timing event? I need to figure out the case for testing that reliably, but I suspect we may be missing events in that situation.
                > The solution would be checking when we add a layout object to a container if it may be interesting for element or container timing, and send the finished event at that point. Usually it will be accurate as when we get that scenario, we will complete the layout and paint later.

                The solution for this problem was in two parts:

                • One was making sure we do not crash if there is still no element
                • Then considering the timing once we have the element information, and we know it should generate a paint.

                The problem is that the case I found was very specific about being a pseudo element (list markers). But I could try to find a similar case, checking if containertiming is obtained. This would be elements that would not be considered for timing events (they do not have elementtiming or containertiming), but when added to the tree, are considered at that point.

                So, I will try to find a reproducing case so I can split this change from the pseudo element support. If I cannot, I can still have this patch coming after landing pseudo element support, and add a specific case for it.

                José Dapena Paz

                I have been trying to find a case out of the pseudo elements that would reproduce this issue, and couldn't. So it may really be specific to pseudos.

                In that condition, I think we don't want to split the patch in two.

                Philip Rogers

                Acknowledged

                Gerrit-Comment-Date: Sat, 17 Jan 2026 01:42:14 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages