Cache StyleAdjusted styles in the MPC. [chromium/src : main]

0 views
Skip to first unread message

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Apr 17, 2026, 9:01:25 AM (10 days ago) Apr 17
to Steinar H Gunderson, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, Menard, Alexis, chromium...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Steinar H Gunderson

Message from chrom...@appspot.gserviceaccount.com

📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/15529bc1890000

Open in Gerrit

Related details

Attention is currently required from:
  • Steinar H Gunderson
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not 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: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
Gerrit-Change-Number: 7705152
Gerrit-PatchSet: 38
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
Gerrit-Comment-Date: Fri, 17 Apr 2026 13:01:12 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Apr 21, 2026, 7:21:36 AM (6 days ago) Apr 21
to chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, Kentaro Hara, (Julie)Jeongeun Kim, Kevin Babbitt, Raphael Kubo da Costa, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, apavlo...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org

Steinar H Gunderson abandoned this change.

View Change

Abandoned Merged into one change

Steinar H Gunderson abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: abandon
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9cfe9244f131d0a3731a5dcf28bdb2e45cedad53
Gerrit-Change-Number: 7775375
Gerrit-PatchSet: 9
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Apr 23, 2026, 5:15:39 AM (4 days ago) Apr 23
to Steinar H Gunderson, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Steinar H Gunderson

Anders Hartvoll Ruud added 6 comments

File third_party/blink/renderer/core/css/resolver/matched_properties_cache.h
Line 82, Patchset 44 (Latest): Member<const ComputedStyle> layout_parent_style;
Anders Hartvoll Ruud . unresolved

Ouch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?

File third_party/blink/renderer/core/css/resolver/style_adjuster.cc
Line 1377, Patchset 44 (Latest):bool StyleAdjuster::CanCacheStyleAdjustment(
Anders Hartvoll Ruud . unresolved

I think it's worth getting rid of this to avoid having two different places where we check the cache eligibility. We can probably just do the base appearance adjustment during "RunUncacheableStyleAdjustment", and return `kIsNotElement` for top layer elements?

EDIT: Oh, or perhaps subsequent adjustments depend the base appearance adjustments?

Line 1505, Patchset 44 (Latest): const StyleResolverState& state,
Anders Hartvoll Ruud . unresolved

Can we pass the `LayoutParentStyle()` instead, if that's all we need? The cleanest thing would be to only depend on `Element`, but it looks like we can at least detach it from the style resolution state of the current element.

Line 1506, Patchset 44 (Latest): const Element& element) {
Anders Hartvoll Ruud . unresolved

It's documented elsewhere, but I think it's worth adding a reminder here that `{ElementType::kIsNotElement}` means "cannot cache the style adjustment for this element".

Line 1545, Patchset 44 (Latest): // Depending on feautre flags, these coule make IsRenderedInTopLayer()
Anders Hartvoll Ruud . unresolved

nit

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 2800, Patchset 44 (Latest): builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());
Anders Hartvoll Ruud . unresolved

Huh? Won't the correct "original" value already be in the cache? I'm confused.

Open in Gerrit

Related details

Attention is currently required from:
  • Steinar H Gunderson
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: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
Gerrit-Change-Number: 7705152
Gerrit-PatchSet: 44
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Apr 2026 09:15:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Apr 23, 2026, 8:37:08 AM (4 days ago) Apr 23
to Anders Hartvoll Ruud, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Anders Hartvoll Ruud

Steinar H Gunderson added 6 comments

File third_party/blink/renderer/core/css/resolver/matched_properties_cache.h
Line 82, Patchset 44: Member<const ComputedStyle> layout_parent_style;
Anders Hartvoll Ruud . unresolved

Ouch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?

Steinar H Gunderson

Yes. I could try to benchmark with and without, but at some point, we're just making more and more uncacheable stuff and it seems like a very bad place to be?

File third_party/blink/renderer/core/css/resolver/style_adjuster.cc
Line 1377, Patchset 44:bool StyleAdjuster::CanCacheStyleAdjustment(
Anders Hartvoll Ruud . resolved

I think it's worth getting rid of this to avoid having two different places where we check the cache eligibility. We can probably just do the base appearance adjustment during "RunUncacheableStyleAdjustment", and return `kIsNotElement` for top layer elements?

EDIT: Oh, or perhaps subsequent adjustments depend the base appearance adjustments?

Steinar H Gunderson

Done

Line 1505, Patchset 44: const StyleResolverState& state,
Anders Hartvoll Ruud . resolved

Can we pass the `LayoutParentStyle()` instead, if that's all we need? The cleanest thing would be to only depend on `Element`, but it looks like we can at least detach it from the style resolution state of the current element.

Steinar H Gunderson

Done

Line 1506, Patchset 44: const Element& element) {
Anders Hartvoll Ruud . resolved

It's documented elsewhere, but I think it's worth adding a reminder here that `{ElementType::kIsNotElement}` means "cannot cache the style adjustment for this element".

Steinar H Gunderson

Done

Line 1545, Patchset 44: // Depending on feautre flags, these coule make IsRenderedInTopLayer()
Anders Hartvoll Ruud . resolved

nit

Steinar H Gunderson

Quack

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 2800, Patchset 44: builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());
Anders Hartvoll Ruud . unresolved

Huh? Won't the correct "original" value already be in the cache? I'm confused.

Steinar H Gunderson

When we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Comment-Date: Thu, 23 Apr 2026 12:36:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Apr 24, 2026, 2:30:20 AM (3 days ago) Apr 24
to Steinar H Gunderson, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org
Attention needed from Steinar H Gunderson

Anders Hartvoll Ruud voted and added 3 comments

Votes added by Anders Hartvoll Ruud

Code-Review+1

3 comments

File third_party/blink/renderer/core/css/resolver/matched_properties_cache.h
Line 82, Patchset 44: Member<const ComputedStyle> layout_parent_style;
Anders Hartvoll Ruud . resolved

Ouch. I guess various adjustments depend on this, and you rejected the idea of making those adjustments uncacheable?

Steinar H Gunderson

Yes. I could try to benchmark with and without, but at some point, we're just making more and more uncacheable stuff and it seems like a very bad place to be?

Anders Hartvoll Ruud

Ack

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 1829, Patchset 44: if (element_type_for_cache.CacheEntryIsStyleAdjusted() &&
StyleAdjuster::CanCacheStyleAdjustment(builder)) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
Anders Hartvoll Ruud . unresolved

We need to keep the ability of caching unadjusted styles? I expected:

```suggestion
if (element_type_for_cache.CacheEntryIsStyleAdjusted()) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
```
Line 2800, Patchset 44: builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());
Anders Hartvoll Ruud . resolved

Huh? Won't the correct "original" value already be in the cache? I'm confused.

Steinar H Gunderson

When we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.

Anders Hartvoll Ruud

OK ... does that produce the right result?(!)

Open in Gerrit

Related details

Attention is currently required from:
  • Steinar H Gunderson
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: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
Gerrit-Change-Number: 7705152
Gerrit-PatchSet: 45
Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
Gerrit-Comment-Date: Fri, 24 Apr 2026 06:29:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
Comment-In-Reply-To: Steinar H Gunderson <se...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Apr 24, 2026, 4:04:15 AM (3 days ago) Apr 24
to Anders Hartvoll Ruud, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org

Steinar H Gunderson voted and added 2 comments

Votes added by Steinar H Gunderson

Commit-Queue+2

2 comments

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 1829, Patchset 44: if (element_type_for_cache.CacheEntryIsStyleAdjusted() &&
StyleAdjuster::CanCacheStyleAdjustment(builder)) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
Anders Hartvoll Ruud . resolved

We need to keep the ability of caching unadjusted styles? I expected:

```suggestion
if (element_type_for_cache.CacheEntryIsStyleAdjusted()) {
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
element_type_for_cache);
} else {
MaybeAddToMatchedPropertiesCache(state, cache_success.key,
/*element_type=*/{});
StyleAdjuster::AdjustComputedStyle(state, element_if_not_pseudo);
}
}
```
Steinar H Gunderson

Done

Line 2800, Patchset 44: builder.SetIsOriginalDisplayInlineType(
style_to_clone->IsOriginalDisplayInlineType());
Anders Hartvoll Ruud . resolved

Huh? Won't the correct "original" value already be in the cache? I'm confused.

Steinar H Gunderson

When we “clone” the MPC hit, we don't actually clone it; a lot of bits just get reset to the default values. That's what we're fixing here.

Anders Hartvoll Ruud

OK ... does that produce the right result?(!)

Steinar H Gunderson

Seemingly; it's been that way forever. But as the comment says, perhaps we should change it at some point to be a more true clone.

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: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
    Gerrit-Change-Number: 7705152
    Gerrit-PatchSet: 46
    Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Steinar H Gunderson <se...@chromium.org>
    Gerrit-CC: (Julie)Jeongeun Kim <je_jul...@chromium.org>
    Gerrit-CC: Akihiro Ota <akihi...@chromium.org>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
    Gerrit-CC: Kenneth Rohde Christiansen <kenneth.ch...@gmail.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Nektarios Paisios <nek...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Comment-Date: Fri, 24 Apr 2026 08:04:04 +0000
    satisfied_requirement
    open
    diffy

    Chromium LUCI CQ (Gerrit)

    unread,
    Apr 24, 2026, 5:09:42 AM (3 days ago) Apr 24
    to Steinar H Gunderson, Anders Hartvoll Ruud, Akihiro Ota, (Julie)Jeongeun Kim, Kevin Babbitt, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Kentaro Hara, Kenneth Rohde Christiansen, Raphael Kubo da Costa, Stephen Chenney, srirama chandra sekhar, chrom...@appspot.gserviceaccount.com, Menard, Alexis, chromium...@chromium.org, ortuno...@chromium.org, titoua...@chromium.org, abigailbk...@google.com, blink-rev...@chromium.org, dtseng...@chromium.org, francisjp...@google.com, jmedle...@chromium.org, josiah...@chromium.org, kinuko...@chromium.org, kyungjunle...@google.com, lucasrada...@google.com, nektar...@chromium.org, yuzo+...@chromium.org, blink-revi...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-revie...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, eric.c...@apple.com, feature-me...@chromium.org, fmalit...@chromium.org, gl...@chromium.org, hiroshig...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org, silv...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org

    Chromium LUCI CQ submitted the change with unreviewed changes

    Unreviewed changes

    45 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/css/resolver/style_resolver.cc
    Insertions: 9, Deletions: 3.

    The diff is too large to show. Please review the diff.
    ```

    Change information

    Commit message:
    Cache StyleAdjusted styles in the MPC.

    The MPC has always contained ComputedStyles that are unadjusted
    by StyleAdjuster; change this so that it can also hold adjusted ones.
    We cannot always cache the result, in particular if it depends on
    too esoteric properties of the Element, but in order to avoid
    regressions in cases where many Elements behave like that,
    we still support storing unadjusted ComputedStyles in such cases.

    There is also a runtime feature flag to easily turn this off
    in prod, should it cause serious bugs. The StyleAdjuster is a
    complicated piece of code, and even though all dependencies
    have been checked by manual inspection, it is possible that
    something is not adequately covered by tests.

    Style perftest (Zen 3, LTO but no PGO):

    Initial style (µs) Before After Perf 95% CI (BCa)
    =================== ========= ========= ======= =================
    ECommerce 5360 5237 +2.4% [ +1.7%, +3.2%]
    Encyclopedia 42689 41992 +1.7% [ -1.8%, +4.0%]
    Extension 54348 52184 +4.1% [ +3.3%, +5.1%]
    News 19970 20045 -0.4% [ -1.0%, +0.1%]
    Search 7612 7535 +1.0% [ +0.2%, +2.1%]
    Social1 12815 12818 -0.0% [ -0.7%, +0.5%]
    Social2 8464 8374 +1.1% [ +0.5%, +1.6%]
    Sports 25901 26040 -0.5% [ -1.0%, +0.1%]
    Video 17033 16745 +1.7% [ +0.5%, +3.0%]
    Geometric mean +1.2% [ +0.7%, +1.7%]

    Recalc style (µs) Before After Perf 95% CI (BCa)
    =================== ========= ========= ======= =================
    ECommerce 2832 2634 +7.5% [ +6.1%, +8.7%]
    Encyclopedia 30396 28776 +5.6% [ +4.8%, +6.4%]
    Extension 42348 40258 +5.2% [ +4.1%, +6.4%]
    News 8273 7987 +3.6% [ +2.6%, +4.6%]
    Search 2643 2496 +5.9% [ +4.9%, +7.1%]
    Social1 5005 4785 +4.6% [ +3.8%, +5.4%]
    Social2 3809 3600 +5.8% [ +5.0%, +6.8%]
    Sports 10098 9850 +2.5% [ +1.8%, +3.4%]
    Video 6267 5931 +5.7% [ +4.6%, +6.8%]
    Geometric mean +5.1% [ +4.3%, +5.9%]

    Speedometer3, _including_ the previous QualifiedNameWithHash changes
    because they are fairly closely intertwined (M1 Pinpoint, LTO but
    no PGO, significant results at 99% CI only):

    Editor-TipTap [ +0.1%, +0.4%]
    NewsSite-Next [ -0.4%, -0.1%]
    TodoMVC-Backbone [ -0.5%, -0.1%]
    TodoMVC-Vue [ -0.5%, -0.1%]
    TodoMVC-jQuery [ -1.0%, -0.1%]
    TodoMVC-React-Complex-DOM [ -0.7%, -0.2%]
    TodoMVC-JavaScript-ES5 [ -1.2%, -0.6%]

    Score [ +0.0%, +0.3%]
    Change-Id: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
    Commit-Queue: Steinar H Gunderson <se...@chromium.org>
    Reviewed-by: Anders Hartvoll Ruud <and...@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#1620032}
    Files:
    • M third_party/blink/renderer/core/css/resolver/matched_properties_cache.cc
    • M third_party/blink/renderer/core/css/resolver/matched_properties_cache.h
    • M third_party/blink/renderer/core/css/resolver/matched_properties_cache_test.cc
    • M third_party/blink/renderer/core/css/resolver/style_adjuster.cc
    • M third_party/blink/renderer/core/css/resolver/style_adjuster.h
    • M third_party/blink/renderer/core/css/resolver/style_resolver.cc
    • M third_party/blink/renderer/core/css/resolver/style_resolver.h
    • M third_party/blink/renderer/core/css/resolver/style_resolver_test.cc
    • M third_party/blink/renderer/platform/runtime_enabled_features.json5
    Change size: L
    Delta: 9 files changed, 657 insertions(+), 77 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +1 by Anders Hartvoll Ruud
    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: Ifd6637ce1e9b0f3bb18c581057ef0b29d803a9bc
    Gerrit-Change-Number: 7705152
    Gerrit-PatchSet: 47
    Gerrit-Owner: Steinar H Gunderson <se...@chromium.org>
    Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
    Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
    open
    diffy
    satisfied_requirement
    Reply all
    Reply to author
    Forward
    0 new messages