Fix hit-test z-offset computation for layers without CSS transforms in preserve-3d [chromium/src : main]

0 views
Skip to first unread message

Perry (Gerrit)

unread,
Mar 3, 2026, 9:01:39 AMMar 3
to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Philip Rogers

Perry voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Philip Rogers
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
Gerrit-Change-Number: 7442380
Gerrit-PatchSet: 4
Gerrit-Owner: Perry <perry...@gmail.com>
Gerrit-Reviewer: Perry <perry...@gmail.com>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 14:01:22 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Perry (Gerrit)

unread,
Mar 3, 2026, 9:58:20 AMMar 3
to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Philip Rogers

Perry added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Philip Rogers
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
Gerrit-Change-Number: 7442380
Gerrit-PatchSet: 4
Gerrit-Owner: Perry <perry...@gmail.com>
Gerrit-Reviewer: Perry <perry...@gmail.com>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 14:58:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Philip Rogers (Gerrit)

unread,
Mar 3, 2026, 7:53:45 PMMar 3
to Perry, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Perry

Philip Rogers added 1 comment

Patchset-level comments
Philip Rogers . unresolved

Can you put this behind an enabled-by-default runtime enabled feature?

Can you help me understand why only 2 of the 3 calls to IsHitCandiateForDepthOrder are updated?

Open in Gerrit

Related details

Attention is currently required from:
  • Perry
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: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
    Gerrit-Change-Number: 7442380
    Gerrit-PatchSet: 4
    Gerrit-Owner: Perry <perry...@gmail.com>
    Gerrit-Reviewer: Perry <perry...@gmail.com>
    Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
    Gerrit-Attention: Perry <perry...@gmail.com>
    Gerrit-Comment-Date: Wed, 04 Mar 2026 00:53:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Perry (Gerrit)

    unread,
    Mar 3, 2026, 10:29:07 PMMar 3
    to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Philip Rogers

    Perry added 1 comment

    Patchset-level comments
    Philip Rogers . resolved

    Can you put this behind an enabled-by-default runtime enabled feature?

    Can you help me understand why only 2 of the 3 calls to IsHitCandiateForDepthOrder are updated?

    Perry

    The three calls serve two distinct purposes.

    1. The two updated calls compute the z-offset of the current layer itself. `local_transform_state` was wrong here because `CreateLocalTransformState` either calls `Flatten()` (resetting z to 0) or adds a 2D paint offset
    (introducing floating-point rounding differences). Since a layer's z in a preserve-3d context is determined solely by its transform container's accumulated transform, `container_transform_state` is correct.

    2. The third call (in `HitTestChildren`) compares a child layer's z (already written into `*z_offset` by the child's own recursion) against the calling layer's z. This call doesn't need updating because
    `local_transform_state` and `container_transform_state` always yield the same `ComputeZOffset` result here: either the calling layer has a CSS transform and `local_transform_state == container_transform_state` by
    definition (line 1373), or it has no CSS transform and the two states differ only by a 2D paint offset which doesn't affect z.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Philip Rogers
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 4
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Attention: Philip Rogers <p...@chromium.org>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 03:28:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Philip Rogers <p...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Perry (Gerrit)

      unread,
      Mar 4, 2026, 1:09:14 AMMar 4
      to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Philip Rogers

      Perry added 1 comment

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

      Runtime feature is added, please take a look again, thanks.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Philip Rogers
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 5
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Attention: Philip Rogers <p...@chromium.org>
      Gerrit-Comment-Date: Wed, 04 Mar 2026 06:09:05 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Perry (Gerrit)

      unread,
      Mar 5, 2026, 9:18:03 PMMar 5
      to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Philip Rogers

      Perry added 1 comment

      Patchset-level comments
      Perry . resolved

      @p...@chromium.org PTAL again, thanks.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Philip Rogers
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 5
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Attention: Philip Rogers <p...@chromium.org>
      Gerrit-Comment-Date: Fri, 06 Mar 2026 02:17:51 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Philip Rogers (Gerrit)

      unread,
      Mar 6, 2026, 9:06:54 PMMar 6
      to Perry, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Perry

      Philip Rogers voted and added 1 comment

      Votes added by Philip Rogers

      Code-Review+1

      1 comment

      Patchset-level comments
      Philip Rogers . resolved

      LGTM

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Perry
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 5
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Attention: Perry <perry...@gmail.com>
      Gerrit-Comment-Date: Sat, 07 Mar 2026 02:06:36 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Perry (Gerrit)

      unread,
      Mar 6, 2026, 9:08:03 PMMar 6
      to Philip Rogers, Chromium LUCI CQ, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

      Perry voted Commit-Queue+2

      Commit-Queue+2
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 5
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Comment-Date: Sat, 07 Mar 2026 02:07:44 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      open
      diffy

      Chromium LUCI CQ (Gerrit)

      unread,
      Mar 6, 2026, 10:03:47 PMMar 6
      to Perry, Philip Rogers, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

      Chromium LUCI CQ submitted the change

      Change information

      Commit message:
      Fix hit-test z-offset computation for layers without CSS transforms in preserve-3d

      When computing z-offset for depth ordering in a preserve-3d context,
      IsHitCandidateForDepthOrder was called with local_transform_state, which
      is derived from container_transform_state by applying the layer's local
      2D paint offset. This caused two problems:

      1. For layers that are not direct children of the transform container
      element, CreateLocalTransformState calls Flatten(), which resets
      accumulated_transform_ to identity, causing ComputeZOffset to return
      0 instead of the correct z value.

      2. For direct children, the extra 2D translate operations added to
      local_transform_state introduce floating-point rounding differences
      compared to sibling layers that went through Flatten(), causing
      incorrect depth ordering between coplanar descendants.

      The correct transform state for computing a layer's z-depth relative to
      its containing flattening layer is container_transform_state itself,
      since layers without their own CSS transforms are coplanar with the
      transform container and their z-depth is fully determined by the
      container's accumulated transform.
      Bug: 464173566
      Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Reviewed-by: Philip Rogers <p...@chromium.org>
      Commit-Queue: Perry <perry...@gmail.com>
      Cr-Commit-Position: refs/heads/main@{#1595858}
      Files:
      • M third_party/blink/renderer/core/paint/paint_layer.cc
      • M third_party/blink/renderer/platform/runtime_enabled_features.json5
      • A third_party/blink/web_tests/external/wpt/css/css-transforms/hittest-preserve-3d-2.html
      Change size: M
      Delta: 3 files changed, 137 insertions(+), 4 deletions(-)
      Branch: refs/heads/main
      Submit Requirements:
      • requirement satisfiedCode-Review: +1 by Philip Rogers
      Open in Gerrit
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: merged
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 6
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      open
      diffy
      satisfied_requirement

      Blink W3C Test Autoroller (Gerrit)

      unread,
      Mar 7, 2026, 12:35:55 AMMar 7
      to Chromium LUCI CQ, Perry, Philip Rogers, chromium...@chromium.org, AyeAye, kinuko...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

      Message from Blink W3C Test Autoroller

      The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/58344

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ib07c40e4239bacc6ff741408ca7d9fcf1332f91b
      Gerrit-Change-Number: 7442380
      Gerrit-PatchSet: 6
      Gerrit-Owner: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Perry <perry...@gmail.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
      Gerrit-Comment-Date: Sat, 07 Mar 2026 05:35:49 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages