| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
static StyleIntrinsicLength CreateLength(const std::optional<Length>& length,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)_
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
static StyleIntrinsicLength CreateLength(const std::optional<Length>& length,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)_
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
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) {
```
[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.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |