[iframe] Refactor the `StyleIntrinsicLength` constructor to static methods [chromium/src : main]

0 views
Skip to first unread message

Koji Ishii (Gerrit)

unread,
Dec 3, 2025, 12:48:04 AM (7 days ago) Dec 3
to Kent Tamura, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revi...@chromium.org, zol...@webkit.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Kent Tamura

Koji Ishii added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement 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: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
Gerrit-Change-Number: 7206493
Gerrit-PatchSet: 5
Gerrit-Owner: Koji Ishii <ko...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Comment-Date: Wed, 03 Dec 2025 05:47:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Dec 3, 2025, 12:49:09 AM (7 days ago) Dec 3
to Koji Ishii, Kent Tamura, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revi...@chromium.org, zol...@webkit.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Kent Tamura

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/style/style_intrinsic_length.h
Line 21, Patchset 5 (Latest): static StyleIntrinsicLength CreateLength(const std::optional<Length>& length,
AI Code Reviewer . unresolved

Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. To improve readability at call sites that pass literal constants, consider using a `base::StrongAlias<class HasAutoTag, bool>` for the `has_auto` parameter.

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


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

Open in Gerrit

Related details

Attention is currently required from:
  • Kent Tamura
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
    Gerrit-Change-Number: 7206493
    Gerrit-PatchSet: 5
    Gerrit-Owner: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Kent Tamura <tk...@chromium.org>
    Gerrit-Comment-Date: Wed, 03 Dec 2025 05:49:06 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kent Tamura (Gerrit)

    unread,
    Dec 3, 2025, 1:03:49 AM (7 days ago) Dec 3
    to Koji Ishii, Kent Tamura, AI Code Reviewer, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revi...@chromium.org, zol...@webkit.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from Koji Ishii

    Kent Tamura voted Code-Review+1

    Code-Review+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Koji Ishii
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • 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: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
    Gerrit-Change-Number: 7206493
    Gerrit-PatchSet: 5
    Gerrit-Owner: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Attention: Koji Ishii <ko...@chromium.org>
    Gerrit-Comment-Date: Wed, 03 Dec 2025 06:03:10 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Koji Ishii (Gerrit)

    unread,
    Dec 3, 2025, 2:58:40 AM (7 days ago) Dec 3
    to Kent Tamura, AI Code Reviewer, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revi...@chromium.org, zol...@webkit.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

    Koji Ishii voted and added 1 comment

    Votes added by Koji Ishii

    Commit-Queue+2

    1 comment

    File third_party/blink/renderer/core/style/style_intrinsic_length.h
    Line 21, Patchset 5: static StyleIntrinsicLength CreateLength(const std::optional<Length>& length,
    AI Code Reviewer . resolved

    Blink Style Guide: Prefer enums or StrongAliases to bare bools for function parameters. To improve readability at call sites that pass literal constants, consider using a `base::StrongAlias<class HasAutoTag, bool>` for the `has_auto` parameter.

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


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

    Koji Ishii

    Done

    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: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
    Gerrit-Change-Number: 7206493
    Gerrit-PatchSet: 8
    Gerrit-Owner: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-Comment-Date: Wed, 03 Dec 2025 07:58:16 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Dec 3, 2025, 3:26:47 AM (7 days ago) Dec 3
    to Koji Ishii, Kent Tamura, AI Code Reviewer, AyeAye, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revi...@chromium.org, zol...@webkit.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    5 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: third_party/blink/renderer/core/animation/css_intrinsic_length_interpolation_type.cc
    Insertions: 6, Deletions: 5.

    @@ -207,16 +207,17 @@
    const auto* non_interpolable =
    To<CSSIntrinsicLengthNonInterpolableValue>(non_interpolable_value);
    if (non_interpolable->HasNone()) {
    - SetIntrinsicDimension(state.StyleBuilder(),
    - StyleIntrinsicLength::CreateLength(
    - std::nullopt, non_interpolable->HasAuto()));
    + SetIntrinsicDimension(
    + state.StyleBuilder(),
    + StyleIntrinsicLength(std::nullopt,
    + {.has_auto = non_interpolable->HasAuto()}));
    } else {
    SetIntrinsicDimension(
    state.StyleBuilder(),
    - StyleIntrinsicLength::CreateLength(
    + StyleIntrinsicLength(
    interpolable.CreateLength(state.CssToLengthConversionData(),
    Length::ValueRange::kNonNegative),
    - non_interpolable->HasAuto()));
    + {.has_auto = non_interpolable->HasAuto()}));
    }
    }
    void CSSIntrinsicLengthInterpolationType::Composite(
    ```
    ```
    The name of the file: third_party/blink/renderer/core/css/resolver/style_adjuster.cc
    Insertions: 2, Deletions: 4.

    @@ -423,10 +423,8 @@
    const auto line_height = builder.FontHeight();
    const auto size =
    LengthSize(Length::Fixed(line_height), Length::Fixed(one_em));
    - builder.SetContainIntrinsicWidth(
    - StyleIntrinsicLength::CreateLength(size.Width()));
    - builder.SetContainIntrinsicHeight(
    - StyleIntrinsicLength::CreateLength(size.Height()));
    + builder.SetContainIntrinsicWidth(StyleIntrinsicLength(size.Width()));
    + builder.SetContainIntrinsicHeight(StyleIntrinsicLength(size.Height()));
    builder.SetHeight(size.Height());
    builder.SetLineHeight(size.Height());
    builder.SetMaxHeight(size.Height());
    ```
    ```
    The name of the file: third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
    Insertions: 3, Deletions: 3.

    @@ -3695,11 +3695,11 @@
    }
    DCHECK(To<CSSIdentifierValue>(list->Item(0)).GetValueID() ==
    CSSValueID::kAuto);
    - return StyleIntrinsicLength::CreateLength(
    - ConvertLengthOrNone(state, list->Item(1)), /*has_auto=*/true);
    + return StyleIntrinsicLength(ConvertLengthOrNone(state, list->Item(1)),
    + {.has_auto = true});
    }

    - return StyleIntrinsicLength::CreateLength(ConvertLengthOrNone(state, value));
    + return StyleIntrinsicLength(ConvertLengthOrNone(state, value));
    }

    ColorSchemeFlags StyleBuilderConverter::ExtractColorSchemes(
    ```
    ```
    The name of the file: third_party/blink/renderer/core/style/style_intrinsic_length.h
    Insertions: 11, Deletions: 6.

    @@ -5,23 +5,28 @@
    #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_STYLE_INTRINSIC_LENGTH_H_
    #define THIRD_PARTY_BLINK_RENDERER_CORE_STYLE_STYLE_INTRINSIC_LENGTH_H_

    +#include "base/types/strong_alias.h"
    #include "third_party/blink/renderer/platform/geometry/length.h"
    #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"

    namespace blink {

    +// Style data for `contain-intrinsic-size`:
    +// `[ auto | from-element ]? [ none | <length [0,∞]> ]`.
    +// https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override
    class StyleIntrinsicLength {
    DISALLOW_NEW();

    public:
    - // Style data for contain-intrinsic-size:
    - // `[ auto | from-element ]? [ none | <length [0,∞]> ]`.
    + struct Options {
    + bool has_auto = false;
    + };

    // Create data for `auto? [ none | <length [0,∞]> ]`.
    - static StyleIntrinsicLength CreateLength(const std::optional<Length>& length,
    - bool has_auto = false) {
    - return {has_auto, false, length};
    - }
    + explicit StyleIntrinsicLength(const std::optional<Length>& length,
    + Options options = {.has_auto = false})
    + : StyleIntrinsicLength(options.has_auto, false, length) {}
    +
    // Create data for `from-element [ none | <length [0,∞]> ]`.
    static StyleIntrinsicLength CreateFromElement(
    const std::optional<Length>& length) {
    ```

    Change information

    Commit message:
    [iframe] Refactor the `StyleIntrinsicLength` constructor to static methods

    This patch refactors the `StyleIntrinsicLength` constructor
    with `bool` parameters to static methods, for the readability.

    This patch has no behavior changes.
    Bug: 418397278
    Change-Id: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
    Commit-Queue: Koji Ishii <ko...@chromium.org>
    Reviewed-by: Kent Tamura <tk...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1553281}
    Files:
    • M third_party/blink/renderer/core/animation/css_intrinsic_length_interpolation_type.cc
    • M third_party/blink/renderer/core/css/resolver/style_adjuster.cc
    • M third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
    • M third_party/blink/renderer/core/style/style_intrinsic_length.h
    Change size: M
    Delta: 4 files changed, 35 insertions(+), 24 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Kent Tamura
    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: Ifb7c29a94c96711681ea59274e0e9d0bf4a92272
    Gerrit-Change-Number: 7206493
    Gerrit-PatchSet: 9
    Gerrit-Owner: Koji Ishii <ko...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
    Gerrit-Reviewer: Koji Ishii <ko...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages