Implement GeometryUtil mixin and plug it in for CSSPseudoElement [chromium/src : main]

71 views
Skip to first unread message

Daniil Sakhapov (Gerrit)

unread,
Jan 30, 2026, 12:54:01 PM (12 days ago) Jan 30
to Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Kent Tamura and Mason Freed

Daniil Sakhapov added 1 comment

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Daniil Sakhapov . unresolved

Hey Kent, could you, please, have a look at the geometry part of CL?
And Mason, please, for the DOM and IDL review.

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
  • Mason Freed
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 4
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Fri, 30 Jan 2026 17:53:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kent Tamura (Gerrit)

unread,
Feb 1, 2026, 6:41:12 PM (10 days ago) Feb 1
to Daniil Sakhapov, Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov and Mason Freed

Kent Tamura added 1 comment

File third_party/blink/renderer/core/dom/css_pseudo_element.idl
Line 18, Patchset 4 (Latest): // GeometryUtils mixin
Kent Tamura . unresolved

Does this CL implement `GeometryUtils` as methods, not a real `mixin`, intentionally?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
  • Mason Freed
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Sun, 01 Feb 2026 23:40:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Feb 2, 2026, 7:07:20 AM (9 days ago) Feb 2
to Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Kent Tamura and Mason Freed

Daniil Sakhapov voted and added 1 comment

Votes added by Daniil Sakhapov

Commit-Queue+1

1 comment

File third_party/blink/renderer/core/dom/css_pseudo_element.idl
Line 18, Patchset 4: // GeometryUtils mixin
Kent Tamura . unresolved

Does this CL implement `GeometryUtils` as methods, not a real `mixin`, intentionally?

Daniil Sakhapov

It's just me not knowing IDL, sorry 😊 fixed now, ptal!

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
  • Mason Freed
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 5
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 12:07:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Feb 2, 2026, 2:44:18 PM (9 days ago) Feb 2
to Daniil Sakhapov, Kent Tamura, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov and Kent Tamura

Mason Freed added 10 comments

File third_party/blink/renderer/core/dom/css_box_type.idl
Line 7, Patchset 5 (Latest):enum CSSBoxType { "margin", "border", "padding", "content" };
Mason Freed . unresolved

This could be part of `convert_coordinate_options.idl` if you want.

File third_party/blink/renderer/core/dom/css_pseudo_element.h
File third_party/blink/renderer/core/dom/css_pseudo_element.cc
Line 119, Patchset 5 (Latest): // Descend from the originating Element through the collected pseudo-ids in
// reverse order to resolve nested pseudo-elements.
Mason Freed . unresolved

I read this chunk of code a few times. I think it's correct. But I think this comment could be expanded to explain what's going on in this loop.

Line 159, Patchset 5 (Latest): return GeometryUtils::ConvertQuadFromNode(quad, from, options,
Mason Freed . unresolved

Can you add this to all of these methods?

```
CHECK(RuntimeEnabledFeatures::GeometryUtilsForCSSPseudoElementEnabled());
```

File third_party/blink/renderer/core/dom/geometry_node.idl
Line 7, Patchset 5 (Latest):typedef (Text or Element or CSSPseudoElement or Document) GeometryNode;
Mason Freed . unresolved

nit: maybe this could just be defined in `geometry_utils.idl`? Also ok to leave it here.

File third_party/blink/renderer/core/dom/geometry_utils.h
Line 75, Patchset 5 (Latest): const ConvertCoordinateOptions* options,
Mason Freed . unresolved

I guess the same is true for `ConvertCoordinateOptions`.

Line 74, Patchset 5 (Latest): const V8UnionCSSPseudoElementOrDocumentOrElementOrText* from,
Mason Freed . unresolved

It feels really odd to be passing these around. It makes this "utils" class seem like it only works for one very specific case - the one you're adding here. Other than CSSPseudoElement, this could just be `Node *`. Perhaps there's a way to make it work? Like have an overload for the `CSSPseudoElement` case? Or something?

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5 (Latest):LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . unresolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Line 81, Patchset 5 (Latest): if (options && options->hasBox()) {
box_type = options->box().AsEnum();
}

LayoutObject* relative_to = nullptr;
if (options && options->hasRelativeTo()) {
relative_to = GetLayoutObjectFromGeometryNode(options->relativeTo());
}
Mason Freed . unresolved

And options is only used here, so maybe just pass in these two variables?

File third_party/blink/renderer/platform/runtime_enabled_features.json5
Line 2832, Patchset 5 (Latest): // GeometryUtils mixin.
// https://drafts.csswg.org/cssom-view/#the-geometryutils-interface
name: "GeometryUtils",
status: "experimental",
},
{
// GeometryUtils for CSSPseudoElement interface.
// https://www.w3.org/TR/cssom-view-1/#the-geometryutils-interface
name: "GeometryUtilsForCSSPseudoElement",
depends_on: ["CSSPseudoElementInterface"],
status: "experimental",
},
Mason Freed . unresolved

Why two flags for this?

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
  • Kent Tamura
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 5
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 19:44:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kent Tamura (Gerrit)

unread,
Feb 2, 2026, 5:57:23 PM (9 days ago) Feb 2
to Daniil Sakhapov, Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov

Kent Tamura added 2 comments

File third_party/blink/renderer/core/dom/css_pseudo_element.idl
Line 18, Patchset 4: // GeometryUtils mixin
Kent Tamura . resolved

Does this CL implement `GeometryUtils` as methods, not a real `mixin`, intentionally?

Daniil Sakhapov

It's just me not knowing IDL, sorry 😊 fixed now, ptal!

Kent Tamura

Ack

File third_party/blink/renderer/core/dom/geometry_utils.h
Line 32, Patchset 5 (Latest):namespace GeometryUtils {
Kent Tamura . unresolved

https://google.github.io/styleguide/cppguide.html#Namespace_Names
> Namespace names are snake_case (all lowercase, with underscores between words).

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 5
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 22:56:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Daniil Sakhapov <sakh...@chromium.org>
Comment-In-Reply-To: Kent Tamura <tk...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kent Tamura (Gerrit)

unread,
Feb 2, 2026, 6:12:42 PM (9 days ago) Feb 2
to Daniil Sakhapov, Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov

Kent Tamura added 3 comments

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 136, Patchset 5 (Latest): double p1_x = quad->hasP1() ? quad->p1()->x() : 0;
double p1_y = quad->hasP1() ? quad->p1()->y() : 0;
double p2_x = quad->hasP2() ? quad->p2()->x() : 0;
Kent Tamura . unresolved

nit:
```c++
auto p1 = quad->hasP1() ? gfx::PointF(quad->p1()->x(), quad->p1()->y()) : gfx::PointF();
```
might be cleaner.

Line 145, Patchset 5 (Latest): // Convert from source to absolute, then from absolute to target.
Kent Tamura . unresolved

How about adding a function to convert a `gfx::PointF` to a `DOMPointInit`?

```c++
auto convert = [&](const gfx::PointF p) {
gfx::PointF absolute = source_layout->LocalToAbsolutePoint(p);
gfx::PointF shifted = absolute - target_origin.OffsetFromOrigin();
DOMPointInit* dom_point = DOMPointInit::Create();
dom_point->setX(shifted.x());
dom_point->setY(shifted.y());
return dom_point;
};
DOMPointInit* dom_p1 = convert(p1);
```
Line 198, Patchset 5 (Latest): gfx::PointF abs_p1 = source_layout->LocalToAbsolutePoint(gfx::PointF(x, y));
Kent Tamura . unresolved

Ditto.

Gerrit-Comment-Date: Mon, 02 Feb 2026 23:12:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Feb 5, 2026, 10:17:48 AM (6 days ago) Feb 5
to Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Kent Tamura and Mason Freed

Daniil Sakhapov voted and added 15 comments

Votes added by Daniil Sakhapov

Commit-Queue+1

15 comments

Patchset-level comments
File-level comment, Patchset 4:
Daniil Sakhapov . resolved

Hey Kent, could you, please, have a look at the geometry part of CL?
And Mason, please, for the DOM and IDL review.

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/css_box_type.idl
Line 7, Patchset 5:enum CSSBoxType { "margin", "border", "padding", "content" };
Mason Freed . resolved

This could be part of `convert_coordinate_options.idl` if you want.

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/css_pseudo_element.h

Is this link valid? Seems like maybe you want this instead?

https://drafts.csswg.org/cssom-view/#the-geometryutils-interface

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/css_pseudo_element.cc
Line 119, Patchset 5: // Descend from the originating Element through the collected pseudo-ids in

// reverse order to resolve nested pseudo-elements.
Mason Freed . resolved

I read this chunk of code a few times. I think it's correct. But I think this comment could be expanded to explain what's going on in this loop.

Daniil Sakhapov

Done

Line 159, Patchset 5: return GeometryUtils::ConvertQuadFromNode(quad, from, options,
Mason Freed . resolved

Can you add this to all of these methods?

```
CHECK(RuntimeEnabledFeatures::GeometryUtilsForCSSPseudoElementEnabled());
```

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/geometry_node.idl
Line 7, Patchset 5:typedef (Text or Element or CSSPseudoElement or Document) GeometryNode;
Mason Freed . resolved

nit: maybe this could just be defined in `geometry_utils.idl`? Also ok to leave it here.

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/geometry_utils.h
Line 75, Patchset 5: const ConvertCoordinateOptions* options,
Mason Freed . resolved

I guess the same is true for `ConvertCoordinateOptions`.

Daniil Sakhapov

Done

Line 74, Patchset 5: const V8UnionCSSPseudoElementOrDocumentOrElementOrText* from,
Mason Freed . resolved

It feels really odd to be passing these around. It makes this "utils" class seem like it only works for one very specific case - the one you're adding here. Other than CSSPseudoElement, this could just be `Node *`. Perhaps there's a way to make it work? Like have an overload for the `CSSPseudoElement` case? Or something?

Daniil Sakhapov

Done

Line 32, Patchset 5:namespace GeometryUtils {
Kent Tamura . resolved

https://google.github.io/styleguide/cppguide.html#Namespace_Names
> Namespace names are snake_case (all lowercase, with underscores between words).

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5:LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . resolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Daniil Sakhapov

Done

Line 81, Patchset 5: if (options && options->hasBox()) {

box_type = options->box().AsEnum();
}

LayoutObject* relative_to = nullptr;
if (options && options->hasRelativeTo()) {
relative_to = GetLayoutObjectFromGeometryNode(options->relativeTo());
}
Mason Freed . resolved

And options is only used here, so maybe just pass in these two variables?

Daniil Sakhapov

Done

Line 136, Patchset 5: double p1_x = quad->hasP1() ? quad->p1()->x() : 0;

double p1_y = quad->hasP1() ? quad->p1()->y() : 0;
double p2_x = quad->hasP2() ? quad->p2()->x() : 0;
Kent Tamura . resolved

nit:
```c++
auto p1 = quad->hasP1() ? gfx::PointF(quad->p1()->x(), quad->p1()->y()) : gfx::PointF();
```
might be cleaner.

Daniil Sakhapov

Done

Line 145, Patchset 5: // Convert from source to absolute, then from absolute to target.
Kent Tamura . resolved

How about adding a function to convert a `gfx::PointF` to a `DOMPointInit`?

```c++
auto convert = [&](const gfx::PointF p) {
gfx::PointF absolute = source_layout->LocalToAbsolutePoint(p);
gfx::PointF shifted = absolute - target_origin.OffsetFromOrigin();
DOMPointInit* dom_point = DOMPointInit::Create();
dom_point->setX(shifted.x());
dom_point->setY(shifted.y());
return dom_point;
};
DOMPointInit* dom_p1 = convert(p1);
```
Daniil Sakhapov

Done

Line 198, Patchset 5: gfx::PointF abs_p1 = source_layout->LocalToAbsolutePoint(gfx::PointF(x, y));
Kent Tamura . resolved

Ditto.

Daniil Sakhapov

Done

File third_party/blink/renderer/platform/runtime_enabled_features.json5
Line 2832, Patchset 5: // GeometryUtils mixin.

// https://drafts.csswg.org/cssom-view/#the-geometryutils-interface
name: "GeometryUtils",
status: "experimental",
},
{
// GeometryUtils for CSSPseudoElement interface.
// https://www.w3.org/TR/cssom-view-1/#the-geometryutils-interface
name: "GeometryUtilsForCSSPseudoElement",
depends_on: ["CSSPseudoElementInterface"],
status: "experimental",
},
Mason Freed . unresolved

Why two flags for this?

Daniil Sakhapov

One for GeometryUtils interface, one for using it on CSSPseudoElement

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
  • Mason Freed
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 6
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Feb 2026 15:17:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Mason Freed <mas...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Feb 5, 2026, 4:36:25 PM (6 days ago) Feb 5
to Daniil Sakhapov, Kent Tamura, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov and Kent Tamura

Mason Freed added 4 comments

File third_party/blink/renderer/core/dom/css_pseudo_element.cc
Line 119, Patchset 5: // Descend from the originating Element through the collected pseudo-ids in
// reverse order to resolve nested pseudo-elements.
Mason Freed . unresolved

I read this chunk of code a few times. I think it's correct. But I think this comment could be expanded to explain what's going on in this loop.

Daniil Sakhapov

Done

Mason Freed

Thanks... but. I still don't quite understand. In the `owner::before::marker` example, if `parent` starts at the `::marker`, then you'll build `pseudo_chain` as [`::marker','::before']. Then the second loop (the one in question here) will walk first `::before` and then `::marker`, and will return `::marker`. Why walk up and back just to get where you started?

File third_party/blink/renderer/core/dom/geometry_utils.h
Line 57, Patchset 6 (Latest):CORE_EXPORT DOMQuad* ConvertQuadFromNode(DOMQuadInit* quad,
Mason Freed . unresolved

Along the same lines, it feels like you should be passing around `DOMQuad` (and `DOMPoint` below) rather than the IDL `Init` types, right?

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5:LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . unresolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Daniil Sakhapov

Done

Mason Freed

I feel like this utility should also be sitting in css_pseudo_element.cc rather than here. I have a hard time believing there will ever be another `V8UnionCSSPseudoElementOrDocumentOrElementOrText` somewhere else in our codebase. Perhaps, but maybe we can refactor it back to somewhere general when that second case shows up?

File third_party/blink/renderer/platform/runtime_enabled_features.json5
Line 2832, Patchset 5: // GeometryUtils mixin.
// https://drafts.csswg.org/cssom-view/#the-geometryutils-interface
name: "GeometryUtils",
status: "experimental",
},
{
// GeometryUtils for CSSPseudoElement interface.
// https://www.w3.org/TR/cssom-view-1/#the-geometryutils-interface
name: "GeometryUtilsForCSSPseudoElement",
depends_on: ["CSSPseudoElementInterface"],
status: "experimental",
},
Mason Freed . resolved

Why two flags for this?

Daniil Sakhapov

One for GeometryUtils interface, one for using it on CSSPseudoElement

Mason Freed

Ok.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
  • Kent Tamura
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 6
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Feb 2026 21:36:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Kent Tamura (Gerrit)

unread,
Feb 5, 2026, 8:41:36 PM (6 days ago) Feb 5
to Daniil Sakhapov, Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov

Kent Tamura voted and added 1 comment

Votes added by Kent Tamura

Code-Review+1

1 comment

Patchset-level comments
File-level comment, Patchset 6 (Latest):
Kent Tamura . resolved

No additional comments from me. It's ok to merge this after resolving Mason's comments.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 6
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 01:41:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Feb 6, 2026, 8:28:39 AM (5 days ago) Feb 6
to Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Mason Freed

Daniil Sakhapov voted and added 3 comments

Votes added by Daniil Sakhapov

Commit-Queue+1

3 comments

File third_party/blink/renderer/core/dom/css_pseudo_element.cc
Line 119, Patchset 5: // Descend from the originating Element through the collected pseudo-ids in
// reverse order to resolve nested pseudo-elements.
Mason Freed . unresolved

I read this chunk of code a few times. I think it's correct. But I think this comment could be expanded to explain what's going on in this loop.

Daniil Sakhapov

Done

Mason Freed

Thanks... but. I still don't quite understand. In the `owner::before::marker` example, if `parent` starts at the `::marker`, then you'll build `pseudo_chain` as [`::marker','::before']. Then the second loop (the one in question here) will walk first `::before` and then `::marker`, and will return `::marker`. Why walk up and back just to get where you started?

Daniil Sakhapov

So CSSPseudoElement is a proxy representation of PseudoElement, which always exist.
Getting from CSSPseudoElement to PseudoElement is only possible (in Blink) via (Element/PseudoElement).GetCSSPseudoElement(pseudo_id).
Here we recieve CSSPseudoElement from JS, so to get a nested PseudoElement we need to go to the ultimate originating element (Element), while keeping pseudo_ids from the nested chain (of CSSPseudoElements, as `.parent` of CSSPseudoElement returns either Element or CSSPseudoElement).
Once we know that chain, we just descend back, but getting PseudoElements on our way back with those pseudo_ids we got from CSSPseudoElement.

File third_party/blink/renderer/core/dom/geometry_utils.h
Line 57, Patchset 6:CORE_EXPORT DOMQuad* ConvertQuadFromNode(DOMQuadInit* quad,
Mason Freed . resolved

Along the same lines, it feels like you should be passing around `DOMQuad` (and `DOMPoint` below) rather than the IDL `Init` types, right?

Daniil Sakhapov

Done

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5:LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . unresolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Daniil Sakhapov

Done

Mason Freed

I feel like this utility should also be sitting in css_pseudo_element.cc rather than here. I have a hard time believing there will ever be another `V8UnionCSSPseudoElementOrDocumentOrElementOrText` somewhere else in our codebase. Perhaps, but maybe we can refactor it back to somewhere general when that second case shows up?

Daniil Sakhapov

But GeometryUtils is included also for Element, Text and Document, right?
Meaning those would need to transform V8UnionCSSPseudoElementOrDocumentOrElementOrText into LayoutObject before calling the main functions as well?

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 7
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Feb 2026 13:28:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Mason Freed (Gerrit)

unread,
Feb 10, 2026, 12:30:51 PM (22 hours ago) Feb 10
to Daniil Sakhapov, Kent Tamura, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Daniil Sakhapov

Mason Freed added 2 comments

File third_party/blink/renderer/core/dom/css_pseudo_element.cc
Line 119, Patchset 5: // Descend from the originating Element through the collected pseudo-ids in
// reverse order to resolve nested pseudo-elements.
Mason Freed . unresolved

I read this chunk of code a few times. I think it's correct. But I think this comment could be expanded to explain what's going on in this loop.

Daniil Sakhapov

Done

Mason Freed

Thanks... but. I still don't quite understand. In the `owner::before::marker` example, if `parent` starts at the `::marker`, then you'll build `pseudo_chain` as [`::marker','::before']. Then the second loop (the one in question here) will walk first `::before` and then `::marker`, and will return `::marker`. Why walk up and back just to get where you started?

Daniil Sakhapov

So CSSPseudoElement is a proxy representation of PseudoElement, which always exist.
Getting from CSSPseudoElement to PseudoElement is only possible (in Blink) via (Element/PseudoElement).GetCSSPseudoElement(pseudo_id).
Here we recieve CSSPseudoElement from JS, so to get a nested PseudoElement we need to go to the ultimate originating element (Element), while keeping pseudo_ids from the nested chain (of CSSPseudoElements, as `.parent` of CSSPseudoElement returns either Element or CSSPseudoElement).
Once we know that chain, we just descend back, but getting PseudoElements on our way back with those pseudo_ids we got from CSSPseudoElement.

Mason Freed

Thank you! Great explanation. (It's easy to forget the distinction between "CSSPseudoElement" and "a CSS PseudoElement".) Can you include some of that in the comment here? And then I think I'll be happy with this.

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5:LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . unresolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Daniil Sakhapov

Done

Mason Freed

I feel like this utility should also be sitting in css_pseudo_element.cc rather than here. I have a hard time believing there will ever be another `V8UnionCSSPseudoElementOrDocumentOrElementOrText` somewhere else in our codebase. Perhaps, but maybe we can refactor it back to somewhere general when that second case shows up?

Daniil Sakhapov

But GeometryUtils is included also for Element, Text and Document, right?
Meaning those would need to transform V8UnionCSSPseudoElementOrDocumentOrElementOrText into LayoutObject before calling the main functions as well?

Mason Freed

It feels ok to have a helper somewhere that does the conversion. It just feels very strange to have a "utils" class that only works for a **very** specific union of IDL types. Like what if a new caller later has a `Node*` and they want to call one of these. What do they do, construct the `V8UnionCSSPseudoElementOrDocumentOrElementOrText` and pass that? Feels odd.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniil Sakhapov
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 7
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Feb 2026 17:30:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniil Sakhapov (Gerrit)

unread,
Feb 10, 2026, 2:19:26 PM (20 hours ago) Feb 10
to Kent Tamura, Mason Freed, AyeAye, Chromium LUCI CQ, chromium...@chromium.org, Kentaro Hara, Raphael Kubo da Costa, ashleynewson+w...@chromium.org, android-web...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org
Attention needed from Mason Freed

Daniil Sakhapov added 1 comment

File third_party/blink/renderer/core/dom/geometry_utils.cc
Line 26, Patchset 5:LayoutObject* GetLayoutObjectFromGeometryNode(
Mason Freed . unresolved

Perhaps the fix is to move this up into the caller, and pass around layout objects instead of the V8 union?

Daniil Sakhapov

Done

Mason Freed

I feel like this utility should also be sitting in css_pseudo_element.cc rather than here. I have a hard time believing there will ever be another `V8UnionCSSPseudoElementOrDocumentOrElementOrText` somewhere else in our codebase. Perhaps, but maybe we can refactor it back to somewhere general when that second case shows up?

Daniil Sakhapov

But GeometryUtils is included also for Element, Text and Document, right?
Meaning those would need to transform V8UnionCSSPseudoElementOrDocumentOrElementOrText into LayoutObject before calling the main functions as well?

Mason Freed

It feels ok to have a helper somewhere that does the conversion. It just feels very strange to have a "utils" class that only works for a **very** specific union of IDL types. Like what if a new caller later has a `Node*` and they want to call one of these. What do they do, construct the `V8UnionCSSPseudoElementOrDocumentOrElementOrText` and pass that? Feels odd.

Daniil Sakhapov

But that is actually a helper to go from the V8Union* to LayoutObject*.
And all the real GeomUtil API take LayoutObject*, not the V8Union*?
So new clients would provide LayoutObject* and there would be no need for this helper for them?

Open in Gerrit

Related details

Attention is currently required from:
  • Mason Freed
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: Ie59494821f04002eca6ee9c7672aefa1dad26564
Gerrit-Change-Number: 7531520
Gerrit-PatchSet: 7
Gerrit-Owner: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Daniil Sakhapov <sakh...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Mason Freed <mas...@chromium.org>
Gerrit-Comment-Date: Tue, 10 Feb 2026 19:19:11 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages