Skip to content

Commit

Permalink
[StyleBuilder] Avoid InternalStyle()->SpecifiesColumns() in adjuster
Browse files Browse the repository at this point in the history
Bug: 1377295
Change-Id: I276edecc9edcec83aad085ddd3ef7d7914edf27d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188567
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1096483}
  • Loading branch information
andruud authored and Chromium LUCI CQ committed Jan 24, 2023
1 parent ecc600d commit d33583c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
// needs to be legacy objects, in order to be fragmentable). Set a flag, so
// that we can quickly determine whether we need to check that an element is
// compatible with the block fragmentation implementation being used.
if (builder.InternalStyle()->SpecifiesColumns() ||
if (builder.SpecifiesColumns() ||
(element && element->GetDocument().Printing())) {
builder.SetInsideFragmentationContextWithNondeterministicEngine(true);
}
Expand Down
12 changes: 11 additions & 1 deletion third_party/blink/renderer/core/style/computed_style.h
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,13 @@ class ComputedStyle : public ComputedStyleBase,
}

// Column utility functions.
static bool SpecifiesColumns(bool has_auto_column_count,
bool has_auto_column_width) {
return !has_auto_column_count || !has_auto_column_width;
}
bool SpecifiesColumns() const {
return !HasAutoColumnCount() || !HasAutoColumnWidth();
return ComputedStyle::SpecifiesColumns(HasAutoColumnCount(),
HasAutoColumnWidth());
}
bool ColumnRuleIsTransparent() const {
return !ColumnRuleColor()
Expand Down Expand Up @@ -2878,6 +2883,11 @@ class ComputedStyleBuilder final : public ComputedStyleBuilderBase {
SetColumnWidthInternal(0);
}

bool SpecifiesColumns() const {
return ComputedStyle::SpecifiesColumns(HasAutoColumnCount(),
HasAutoColumnWidth());
}

// content
ContentData* GetContentData() const { return ContentInternal().Get(); }

Expand Down

0 comments on commit d33583c

Please sign in to comment.