WIP4: Start of 3 approaches to subtracting scrollbars from vw [chromium/src : main]

0 views
Skip to first unread message

David Grogan (Gerrit)

unread,
Oct 6, 2025, 9:24:48 PM (9 days ago) Oct 6
to David Grogan, Ian Kilpatrick, Rune Lillesveen, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud, Ian Kilpatrick and Rune Lillesveen

David Grogan added 4 comments

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

Hi Gentlemen, I've spoken with each of you in the past about this project. I've tried a few things, but none seem very promising. There are some code comments with some descriptions, problems, and questions about each approach. I could go for some technical guidance on which approach (or combo of approaches!) seems most worthwhile to you.

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Line 301, Patchset 5 (Latest): // Approach 1: Make viewport units respect scrollbars even for properties on
David Grogan . unresolved

Approach 1

File third_party/blink/renderer/core/dom/element.cc
Line 4648, Patchset 5 (Latest): if (IsDocumentElement()) {
David Grogan . unresolved

Approach 2

Line 4678, Patchset 5 (Latest): // Approach 3: mostly a proof-of-concept that seems very unlikely to be
David Grogan . unresolved

Approach 3

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Ian Kilpatrick
  • Rune Lillesveen
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Tue, 07 Oct 2025 01:24:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
Oct 6, 2025, 9:25:51 PM (9 days ago) Oct 6
to David Grogan, Ian Kilpatrick, Rune Lillesveen, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud, Ian Kilpatrick and Rune Lillesveen

Message from David Grogan

Set Ready For Review

Gerrit-Comment-Date: Tue, 07 Oct 2025 01:25:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Oct 7, 2025, 8:44:01 AM (9 days ago) Oct 7
to David Grogan, Ian Kilpatrick, Rune Lillesveen, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Grogan, Ian Kilpatrick and Rune Lillesveen

Anders Hartvoll Ruud added 4 comments

Patchset-level comments
David Grogan . resolved

Hi Gentlemen, I've spoken with each of you in the past about this project. I've tried a few things, but none seem very promising. There are some code comments with some descriptions, problems, and questions about each approach. I could go for some technical guidance on which approach (or combo of approaches!) seems most worthwhile to you.

Anders Hartvoll Ruud

I mostly looked at Approach 1; the others seem to require a ComputedStyle to already exist? (I believe that's a non-starter?)

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Line 304, Patchset 5 (Latest): // Issue: PaintLayerScrollableArea::UpdateAfterStyleChange,
// PaintLayerScrollableArea::ComputeScrollbarExistence, and
// LayoutView::CalculateScrollbarModes have _a lot_ of logic about the
// existence of scrollbars that goes way beyond the primitive check for
// state_.StyleBuilder().OverflowX() == EOverflow::kScroll here. But that
Anders Hartvoll Ruud . unresolved

Even if we remove all the stuff about conditional scrollbars? (Which I assume is in there---I haven't looked.)

Is it viable to refactor `ComputeScrollbarExistence` into basically:

```
bool ComputeScrollbarExistence(args) {
return ComputeUnconditionalScrollbarExistence(args)
|| ComputeConditionalScrollbarExistence(args);
}
```

?

Line 314, Patchset 5 (Latest): // Question: Should I salvage this approach by stuffing a temporary barebones
// ComputedStyle object with just the properties that
// PaintLayerScrollableArea::ComputeScrollbarExistence and its friends need on
// to the document, and then (somehow) call the scrollbar-existence logic
// here? Or perhaps instead by duplicating some of that logic here?
Anders Hartvoll Ruud . unresolved

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/style/display_style.h?q=symbol%3A%5Cbblink%3A%3ADisplayStyle%5Cb%20case%3Ayes

You make it sound like a hack, but this just means that we'll now have functions that only accept parameters they _actually care about_ instead of pretending to "depend" on everything. As long as the number of fields is reasonably low, this should be fine.

File third_party/blink/renderer/core/dom/element.cc
Line 4693, Patchset 5 (Latest): // Question: Am I wrong in thinking that
Anders Hartvoll Ruud . unresolved

If we _cannot_ determine unconditional scrollbars from computed values alone, I think it's a spec issue?

Open in Gerrit

Related details

Attention is currently required from:
  • David Grogan
  • Ian Kilpatrick
  • Rune Lillesveen
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Attention: Rune Lillesveen <fut...@chromium.org>
Gerrit-Comment-Date: Tue, 07 Oct 2025 12:43:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: David Grogan <dgr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
Oct 10, 2025, 3:14:21 AM (6 days ago) Oct 10
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org, Rune Lillesveen
Attention needed from David Grogan and Ian Kilpatrick

Rune Lillesveen added 1 comment

Patchset-level comments
Rune Lillesveen . resolved

I'll let Anders handle this from the style side.

Open in Gerrit

Related details

Attention is currently required from:
  • David Grogan
  • Ian Kilpatrick
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Fri, 10 Oct 2025 07:13:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
Oct 13, 2025, 11:38:16 PM (2 days ago) Oct 13
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and Ian Kilpatrick

David Grogan added 5 comments

Patchset-level comments
David Grogan . resolved

I'm back from OOO. Thanks a bunch for the comments.

David Grogan . unresolved

Hi Gentlemen, I've spoken with each of you in the past about this project. I've tried a few things, but none seem very promising. There are some code comments with some descriptions, problems, and questions about each approach. I could go for some technical guidance on which approach (or combo of approaches!) seems most worthwhile to you.

Anders Hartvoll Ruud

I mostly looked at Approach 1; the others seem to require a ComputedStyle to already exist? (I believe that's a non-starter?)

David Grogan

non-starter status is unclear. IF viewport units in :root property values need to subtract unconditional scrollbars, then requiring a complete ComputedStyle is kind of a non-starter.

BUT viewport units in :root property values needing to subtract unconditional scrollbars is unclear though. We have, or can easily create, some wiggle room in the spec on this point.

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Line 304, Patchset 5 (Latest): // Issue: PaintLayerScrollableArea::UpdateAfterStyleChange,
// PaintLayerScrollableArea::ComputeScrollbarExistence, and
// LayoutView::CalculateScrollbarModes have _a lot_ of logic about the
// existence of scrollbars that goes way beyond the primitive check for
// state_.StyleBuilder().OverflowX() == EOverflow::kScroll here. But that
Anders Hartvoll Ruud . unresolved

Even if we remove all the stuff about conditional scrollbars? (Which I assume is in there---I haven't looked.)

Is it viable to refactor `ComputeScrollbarExistence` into basically:

```
bool ComputeScrollbarExistence(args) {
return ComputeUnconditionalScrollbarExistence(args)
|| ComputeConditionalScrollbarExistence(args);
}
```

?

David Grogan

ComputeScrollbarExistence is mostly about unconditional scrollbars already, and is essentially already factored the way you suggest. Its first 80 lines are about unconditional scrollbars, but that includes a call to LayoutView::CalculateScrollbarModes, which is another ~100 lines.

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc;l=1709;drc=3eb52979a9f6d87b5abcf9e643849554cfae1efc

(Assuming that by "conditional" you mean conditional on layout overflow. LMK if I've misinterpreted.)

Line 314, Patchset 5 (Latest): // Question: Should I salvage this approach by stuffing a temporary barebones
// ComputedStyle object with just the properties that
// PaintLayerScrollableArea::ComputeScrollbarExistence and its friends need on
// to the document, and then (somehow) call the scrollbar-existence logic
// here? Or perhaps instead by duplicating some of that logic here?
Anders Hartvoll Ruud . unresolved

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/style/display_style.h?q=symbol%3A%5Cbblink%3A%3ADisplayStyle%5Cb%20case%3Ayes

You make it sound like a hack, but this just means that we'll now have functions that only accept parameters they _actually care about_ instead of pretending to "depend" on everything. As long as the number of fields is reasonably low, this should be fine.

David Grogan

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

😊


> temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

I meant an actual instance of the ComputedStyle class with mostly default values. I suppose you opted for a new class for clarity around what properties have been resolved and are actually cared about?

I estimate ~7-10 properties need to be resolved to determine the presence of unconditional scrollbars. Does that strike you as low enough?

File third_party/blink/renderer/core/dom/element.cc
Line 4693, Patchset 5 (Latest): // Question: Am I wrong in thinking that
Anders Hartvoll Ruud . unresolved

If we _cannot_ determine unconditional scrollbars from computed values alone, I think it's a spec issue?

David Grogan

The only impactful spec question is whether viewport units _on root element properties_ should have subtracted unconditional scrollbar sizes.

Aside from that, all the issues I described in this CL are of the implementation-complexity variety, not spec problems.

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Ian Kilpatrick
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Oct 2025 03:37:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
Comment-In-Reply-To: David Grogan <dgr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Oct 14, 2025, 8:16:00 AM (yesterday) Oct 14
to David Grogan, Code Review Nudger, Ian Kilpatrick, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Grogan and Ian Kilpatrick

Anders Hartvoll Ruud added 3 comments

Patchset-level comments
David Grogan . unresolved

Hi Gentlemen, I've spoken with each of you in the past about this project. I've tried a few things, but none seem very promising. There are some code comments with some descriptions, problems, and questions about each approach. I could go for some technical guidance on which approach (or combo of approaches!) seems most worthwhile to you.

Anders Hartvoll Ruud

I mostly looked at Approach 1; the others seem to require a ComputedStyle to already exist? (I believe that's a non-starter?)

David Grogan

non-starter status is unclear. IF viewport units in :root property values need to subtract unconditional scrollbars, then requiring a complete ComputedStyle is kind of a non-starter.

BUT viewport units in :root property values needing to subtract unconditional scrollbars is unclear though. We have, or can easily create, some wiggle room in the spec on this point.

Anders Hartvoll Ruud

Ah, OK, I thought viewport units on the root element being aware of this stuff was a fairly strict requirement already.

In any case, it sounds possible to work out.

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Line 304, Patchset 5 (Latest): // Issue: PaintLayerScrollableArea::UpdateAfterStyleChange,
// PaintLayerScrollableArea::ComputeScrollbarExistence, and
// LayoutView::CalculateScrollbarModes have _a lot_ of logic about the
// existence of scrollbars that goes way beyond the primitive check for
// state_.StyleBuilder().OverflowX() == EOverflow::kScroll here. But that
Anders Hartvoll Ruud . resolved

Even if we remove all the stuff about conditional scrollbars? (Which I assume is in there---I haven't looked.)

Is it viable to refactor `ComputeScrollbarExistence` into basically:

```
bool ComputeScrollbarExistence(args) {
return ComputeUnconditionalScrollbarExistence(args)
|| ComputeConditionalScrollbarExistence(args);
}
```

?

David Grogan

ComputeScrollbarExistence is mostly about unconditional scrollbars already, and is essentially already factored the way you suggest. Its first 80 lines are about unconditional scrollbars, but that includes a call to LayoutView::CalculateScrollbarModes, which is another ~100 lines.

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/paint/paint_layer_scrollable_area.cc;l=1709;drc=3eb52979a9f6d87b5abcf9e643849554cfae1efc

(Assuming that by "conditional" you mean conditional on layout overflow. LMK if I've misinterpreted.)

Anders Hartvoll Ruud

Ack.

(Assuming that by "conditional" you mean conditional on layout overflow. LMK if I've misinterpreted.)

That is indeed what I meant.

Line 314, Patchset 5 (Latest): // Question: Should I salvage this approach by stuffing a temporary barebones
// ComputedStyle object with just the properties that
// PaintLayerScrollableArea::ComputeScrollbarExistence and its friends need on
// to the document, and then (somehow) call the scrollbar-existence logic
// here? Or perhaps instead by duplicating some of that logic here?
Anders Hartvoll Ruud . unresolved

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/style/display_style.h?q=symbol%3A%5Cbblink%3A%3ADisplayStyle%5Cb%20case%3Ayes

You make it sound like a hack, but this just means that we'll now have functions that only accept parameters they _actually care about_ instead of pretending to "depend" on everything. As long as the number of fields is reasonably low, this should be fine.

David Grogan

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

😊


> temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

I meant an actual instance of the ComputedStyle class with mostly default values. I suppose you opted for a new class for clarity around what properties have been resolved and are actually cared about?

I estimate ~7-10 properties need to be resolved to determine the presence of unconditional scrollbars. Does that strike you as low enough?

Anders Hartvoll Ruud

I meant an actual instance of the ComputedStyle class with mostly default values.

Yikes.

I estimate ~7-10 properties [...] Does that strike you as low enough?

I think yes, and then we'll see if I need to regret saying that.

Open in Gerrit

Related details

Attention is currently required from:
  • David Grogan
  • Ian Kilpatrick
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Oct 2025 12:15:13 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
Oct 14, 2025, 6:00:03 PM (yesterday) Oct 14
to David Grogan, Steve Kobes, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud, Ian Kilpatrick and Steve Kobes

David Grogan added 2 comments

Patchset-level comments
David Grogan . resolved

+skobes for question below

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Line 314, Patchset 5 (Latest): // Question: Should I salvage this approach by stuffing a temporary barebones
// ComputedStyle object with just the properties that
// PaintLayerScrollableArea::ComputeScrollbarExistence and its friends need on
// to the document, and then (somehow) call the scrollbar-existence logic
// here? Or perhaps instead by duplicating some of that logic here?
Anders Hartvoll Ruud . unresolved

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/style/display_style.h?q=symbol%3A%5Cbblink%3A%3ADisplayStyle%5Cb%20case%3Ayes

You make it sound like a hack, but this just means that we'll now have functions that only accept parameters they _actually care about_ instead of pretending to "depend" on everything. As long as the number of fields is reasonably low, this should be fine.

David Grogan

(You'd think the existence of _unconditional_ scrollbars wouldn't be so hard to determine.)

😊


> temporary barebones ComputedStyle object

I did exactly this to solve a similar case of "needs ComputedStyle, but doesn't exist yet" when working on the StyleBuilder project:

I meant an actual instance of the ComputedStyle class with mostly default values. I suppose you opted for a new class for clarity around what properties have been resolved and are actually cared about?

I estimate ~7-10 properties need to be resolved to determine the presence of unconditional scrollbars. Does that strike you as low enough?

Anders Hartvoll Ruud

I meant an actual instance of the ComputedStyle class with mostly default values.

Yikes.

I estimate ~7-10 properties [...] Does that strike you as low enough?

I think yes, and then we'll see if I need to regret saying that.

David Grogan

@skobes, See above discussion and code comments for full context, but the approach I'm about to embark on is to

(1) resolve a bunch of properties (namely those that are required for determining unconditional scrollbars) before row 335's `ApplyHighPriority`
(2) collect the results into an object of a new type
(3) Refactor PaintLayerScrollableArea::ComputeScrollbarExistence and LayoutView::CalculateScrollbarModes to accept an object of this new type
(4) Call PaintLayerScrollableArea::ComputeScrollbarExistence (and transitively LayoutView::CalculateScrollbarModes) here to check for scrollbar existence and size
(5) Subtract those scrollbar sizes from the viewport size as appropriate
(6) Proceed with style resolution starting from `ApplyHighPriority` below.

With your scrollbar expert hat on, does this sound like a decent plan to detect scrollbar existence before style is fully resolved? What dragons do you foresee in this approach?

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Ian Kilpatrick
  • Steve Kobes
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Steve Kobes <sko...@chromium.org>
Gerrit-Attention: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Comment-Date: Tue, 14 Oct 2025 21:59:38 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Steve Kobes (Gerrit)

unread,
8:42 AM (12 hours ago) 8:42 AM
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Grogan

Steve Kobes added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Steve Kobes

Are you keeping the existing call sites of `ComputeScrollbarExistence` in addition to the new one you are adding here?

If a scrollbar is added or removed at a later stage, will we trigger a new style recalc to keep the vw units in sync? How do we avoid cycles in that case?

Open in Gerrit

Related details

Attention is currently required from:
  • David Grogan
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 12:42:01 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
11:59 AM (9 hours ago) 11:59 AM
to David Grogan, Steve Kobes, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and Steve Kobes

David Grogan added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
David Grogan

Are you keeping the existing call sites of `ComputeScrollbarExistence` in addition to the new one you are adding here?

I think keep them because here we are only interested in unconditional scrollbars specified on the root element; those are the only scrollbars that the new spec tells us to subtract from the viewport size when calculating viewport units.

If a scrollbar is added or removed at a later stage, will we trigger a new style recalc to keep the vw units in sync? How do we avoid cycles in that case?

I don't think we'd trigger a new style recalc for *later stage* changes. The idea is that this new logic would capture all the instances of the layout-unconditional scrollbars. So any later stage changes would come from layout-conditional scrollbars, which we are not supposed to subtract from the viewport size.

Good questions. I honestly hadn't thought this far yet.

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Steve Kobes
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Steve Kobes <sko...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 15:58:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
Comment-In-Reply-To: Steve Kobes <sko...@chromium.org>
Comment-In-Reply-To: David Grogan <dgr...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Steve Kobes (Gerrit)

unread,
12:48 PM (8 hours ago) 12:48 PM
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and David Grogan

Steve Kobes added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Steve Kobes

Hmm it seems pretty weird for the meaning of vw to be different depending on whether the scrollbar is layout-conditional or layout-unconditional. Is that really required by the spec? Shouldn't we treat all (non-overlay) scrollbars the same?

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • David Grogan
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 16:47:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
Comment-In-Reply-To: David Grogan <dgr...@chromium.org>
Comment-In-Reply-To: Steve Kobes <sko...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
12:54 PM (8 hours ago) 12:54 PM
to David Grogan, Steve Kobes, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and Steve Kobes

David Grogan added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
David Grogan

Hmm it seems pretty weird for the meaning of vw to be different depending on whether the scrollbar is layout-conditional or layout-unconditional. Is that really required by the spec?

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Steve Kobes
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Steve Kobes <sko...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 16:54:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Steve Kobes (Gerrit)

unread,
1:03 PM (8 hours ago) 1:03 PM
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and David Grogan

Steve Kobes added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Steve Kobes

Given that requirement, I guess the best implementation strategy is to break ComputeScrollbarExistence into two pieces:

  • ComputeUnconditionalScrollbarExistence (runs during style recalc)
  • ComputeAutoScrollbarExistence (runs after layout)

I still think this behavior seems surprising for web developers and would like to understand the motivation behind it...

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • David Grogan
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 17:02:41 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
1:31 PM (8 hours ago) 1:31 PM
to David Grogan, Steve Kobes, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and Steve Kobes

David Grogan added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
David Grogan

I still think this behavior seems surprising for web developers and would like to understand the motivation behind it...

https://github.com/w3c/csswg-drafts/issues/1766#issuecomment-1832472781 -- "for cyclic reasons"

Tab's explanation there is not in response to your exact question, but close. (It also illustrates that this issue has had a long history.)

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Steve Kobes
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Steve Kobes <sko...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 17:31:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Steve Kobes (Gerrit)

unread,
4:09 PM (5 hours ago) 4:09 PM
to David Grogan, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and David Grogan

Steve Kobes added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
Steve Kobes

Ok I can see that many smart people have thought about this :)

I hope we can be explicit in the code about distinguishing vw-impacting scrollbars from non-vw-impacting scrollbars, if that distinction must exist. Trying to avoid a situation where ComputeScrollbarExistence is overloaded to do slightly different things at different stages.

Maybe we should we introduce a new struct like "StyleBasedScrollbarData", which can be computed at style recalc time and tells us if we have vw-impacting scrollbars, along with their thickness?

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • David Grogan
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: David Grogan <dgr...@chromium.org>
Gerrit-Comment-Date: Wed, 15 Oct 2025 20:08:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

David Grogan (Gerrit)

unread,
8:54 PM (16 minutes ago) 8:54 PM
to David Grogan, Steve Kobes, Code Review Nudger, Ian Kilpatrick, Anders Hartvoll Ruud, Alexis Menard, David Bokan, chromium...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud and Steve Kobes

David Grogan added 1 comment

File third_party/blink/renderer/core/css/resolver/style_cascade.cc
David Grogan

Ok I can see that many smart people have thought about this :)

Oh, yes, though pointing that out was not my intention :) I was more trying to say that if we want to change it we'll run into some friction.

I hope we can be explicit in the code about distinguishing vw-impacting scrollbars from non-vw-impacting scrollbars, if that distinction must exist. Trying to avoid a situation where ComputeScrollbarExistence is overloaded to do slightly different things at different stages.

So, I think ComputeScrollbarExistence is _already_ overloaded in that way. It even takes a parameter to tell it which stage it's in.

```
enum ComputeScrollbarExistenceOption {
kDependsOnOverflow,
kOverflowIndependent
};
void ComputeScrollbarExistence(
bool& needs_horizontal_scrollbar,
bool& needs_vertical_scrollbar,
ComputeScrollbarExistenceOption = kDependsOnOverflow) const;
```

... but it's a pretty clean overload, and I'll do my best to keep it clean.

Maybe we should we introduce a new struct like "StyleBasedScrollbarData", which can be computed at style recalc time and tells us if we have vw-impacting scrollbars, along with their thickness?

That SGTM. I'll try to actually start coding it soon.

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
  • Steve Kobes
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: I06366712ceaf22af71bed77424925217f59c568a
Gerrit-Change-Number: 7014569
Gerrit-PatchSet: 5
Gerrit-Owner: David Grogan <dgr...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: Ian Kilpatrick <ikilp...@chromium.org>
Gerrit-Reviewer: Steve Kobes <sko...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Attention: Steve Kobes <sko...@chromium.org>
Gerrit-Comment-Date: Thu, 16 Oct 2025 00:54:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages