Pin suggested-value pseudo elements to a generic font family [chromium/src : main]

0 views
Skip to first unread message

Dileep Maurya (Gerrit)

unread,
Jun 22, 2026, 10:50:02 AM (3 days ago) Jun 22
to Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Kevin Babbitt and Virali Purbey

Dileep Maurya added 2 comments

Patchset-level comments
File-level comment, Patchset 5:
Kevin Babbitt . resolved

General questions:

Is it possible that a website was relying on this shadowing behavior and would be broken by this change?

Is there some way to scope our defense to the autofill popup? As I understand, the autofill popup is the only scenario where we'd leak information a webpage doesn't already have access to.

Dileep Maurya

Thanks for these questions. The previous patch didn't address whether a site relying on the shadowing behavior could break. The new change addresses that by scoping the defense to the autofill preview only, so author content and committed input values are unaffected.

File-level comment, Patchset 5:
Kevin Babbitt . resolved

General questions:

Is it possible that a website was relying on this shadowing behavior and would be broken by this change?

Is there some way to scope our defense to the autofill popup? As I understand, the autofill popup is the only scenario where we'd leak information a webpage doesn't already have access to.

Dileep Maurya

Thanks for these questions. The previous patch didn't address whether a site relying on the shadowing behavior could break. Current patchset addresses that by scoping the defense to the autofill preview only, so author content and committed input values are unaffected.

Open in Gerrit

Related details

Attention is currently required from:
  • Kevin Babbitt
  • Virali Purbey
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: I063833950480d20453491d5a07dea842c0b061d1
Gerrit-Change-Number: 7930489
Gerrit-PatchSet: 9
Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
Gerrit-CC: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
Gerrit-Comment-Date: Mon, 22 Jun 2026 14:49:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kevin Babbitt <kbab...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Kevin Babbitt (Gerrit)

unread,
Jun 22, 2026, 1:58:27 PM (3 days ago) Jun 22
to Dileep Maurya, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
Attention needed from Dileep Maurya, Joey Arhar and Virali Purbey

Kevin Babbitt voted and added 2 comments

Votes added by Kevin Babbitt

Code-Review+1

2 comments

Patchset-level comments
File-level comment, Patchset 9 (Latest):
Kevin Babbitt . resolved

jarhar@ does this look okay to you?

File third_party/blink/renderer/core/html/resources/html.css
Line 2262, Patchset 9 (Latest): font-family: sans-serif !important;
Kevin Babbitt . unresolved
Suggest adding a comment here explaining the importance of pinning to a system font keyword, for example:
```suggestion
/* Author @font-face rules with single-character unicode-ranges could create a
side channel for disclosure of autofill preview text. Prevent this by using
a generic font family keyword, which cannot be overridden by @font-face. */
font-family: sans-serif !important;
```
Open in Gerrit

Related details

Attention is currently required from:
  • Dileep Maurya
  • Joey Arhar
  • Virali Purbey
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not 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: I063833950480d20453491d5a07dea842c0b061d1
    Gerrit-Change-Number: 7930489
    Gerrit-PatchSet: 9
    Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
    Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
    Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
    Gerrit-CC: Virali Purbey <virali...@microsoft.com>
    Gerrit-Attention: Joey Arhar <jar...@chromium.org>
    Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
    Gerrit-Attention: Dileep Maurya <dileep...@microsoft.com>
    Gerrit-Comment-Date: Mon, 22 Jun 2026 17:58:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Joey Arhar (Gerrit)

    unread,
    Jun 22, 2026, 7:48:58 PM (2 days ago) Jun 22
    to Dileep Maurya, Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Dileep Maurya and Virali Purbey

    Joey Arhar added 3 comments

    Commit Message
    Line 10, Patchset 9 (Latest):platform name (e.g. "Arial"), so the !important rule on
    Joey Arhar . unresolved

    Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

    File third_party/blink/renderer/core/html/resources/html.css
    Line 642, Patchset 9 (Latest): font-family: sans-serif !important;
    Joey Arhar . unresolved

    I am modifying the same code here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7885624

    I don't think that my patch adds a forced font-family like this. So `font: -webkit-small-control !important` doesn't actually force a specific font-family?

    Line 2262, Patchset 9 (Latest): font-family: sans-serif !important;
    Kevin Babbitt . unresolved
    Suggest adding a comment here explaining the importance of pinning to a system font keyword, for example:
    ```suggestion
    /* Author @font-face rules with single-character unicode-ranges could create a
    side channel for disclosure of autofill preview text. Prevent this by using
    a generic font family keyword, which cannot be overridden by @font-face. */
    font-family: sans-serif !important;
    ```
    Joey Arhar

    Would it be possible to add a web_test which demonstrates this?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Dileep Maurya
    • Virali Purbey
    Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
    Gerrit-Attention: Dileep Maurya <dileep...@microsoft.com>
    Gerrit-Comment-Date: Mon, 22 Jun 2026 23:48:36 +0000
    Gerrit-HasComments: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dileep Maurya (Gerrit)

    unread,
    Jun 23, 2026, 9:04:16 AM (2 days ago) Jun 23
    to Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
    Attention needed from Joey Arhar, Kevin Babbitt and Virali Purbey

    Dileep Maurya added 3 comments

    Commit Message
    Line 10, Patchset 9:platform name (e.g. "Arial"), so the !important rule on
    Joey Arhar . resolved

    Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

    Dileep Maurya

    `sans-serif` is a generic family, so it doesn't resolve specifically to Arial, it maps to whatever the platform/user `generic-sans-serif` setting is. In practice:

    • Windows/Linux: sans-serif and `-webkit-small-control` both resolve to Arial/Arimo, so there's no visible change, the existing reftests pass unmodified.
    • macOS: they differ - `-webkit-small-control` is the system control font and sans-serif is Helvetica - so the autofill preview glyphs do change there (I updated the mac-rel reftest baselines for this).

    The change is limited to the transient greyed-out preview text in `::-internal-input-suggested` / `::-internal-select-autofill-preview-text`; once a suggestion is accepted the field renders the real value in its own font, and textarea  previews are unaffected.

    File third_party/blink/renderer/core/html/resources/html.css
    Line 642, Patchset 9: font-family: sans-serif !important;
    Joey Arhar . unresolved

    I am modifying the same code here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7885624

    I don't think that my patch adds a forced font-family like this. So `font: -webkit-small-control !important` doesn't actually force a specific font-family?

    Dileep Maurya

    The font shorthand resets every font longhand, and the system-font keyword resolves font-family to a concrete platform family `system_font->ResolveFontFamily() -> LayoutThemeFontProvider::SystemFontFamily() -> DefaultGUIFont()` (e.g. "Arial") — as a non-generic kFamilyName (style_builder_converter.cc). That concrete name is exactly what gets looked up in the author @font-face cache (`if (!font_family.FamilyIsGeneric()) guard in CSSFontSelector::GetFontData`), which is the side channel this CL closes. `font-family: sans-serif !important`  overrides only the family with a generic one, which skips that lookup.

    Your CL#7885624 — we overlap on `select::-internal-select-autofill-preview-text`. As long as the hard-coded family is a generic keyword (sans-serif / monospace), the security property holds; a concrete family name would reintroduce the leak. Happy to coordinate ordering - I can rebase on top of yours. PTAL.

    Line 2262, Patchset 9: font-family: sans-serif !important;
    Kevin Babbitt . resolved
    Suggest adding a comment here explaining the importance of pinning to a system font keyword, for example:
    ```suggestion
    /* Author @font-face rules with single-character unicode-ranges could create a
    side channel for disclosure of autofill preview text. Prevent this by using
    a generic font family keyword, which cannot be overridden by @font-face. */
    font-family: sans-serif !important;
    ```
    Joey Arhar

    Would it be possible to add a web_test which demonstrates this?

    Dileep Maurya

    Done. Added the suggested comment and added a web_test demonstrating the same. Thanks!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Joey Arhar
    • Kevin Babbitt
    • Virali Purbey
    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: I063833950480d20453491d5a07dea842c0b061d1
      Gerrit-Change-Number: 7930489
      Gerrit-PatchSet: 11
      Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
      Gerrit-CC: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Joey Arhar <jar...@chromium.org>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Comment-Date: Tue, 23 Jun 2026 13:03:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
      Comment-In-Reply-To: Kevin Babbitt <kbab...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Jun 23, 2026, 12:10:40 PM (2 days ago) Jun 23
      to Dileep Maurya, Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Dileep Maurya, Kevin Babbitt and Virali Purbey

      Joey Arhar added 2 comments

      Commit Message
      Line 10, Patchset 9:platform name (e.g. "Arial"), so the !important rule on
      Joey Arhar . unresolved

      Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

      Dileep Maurya

      `sans-serif` is a generic family, so it doesn't resolve specifically to Arial, it maps to whatever the platform/user `generic-sans-serif` setting is. In practice:

      • Windows/Linux: sans-serif and `-webkit-small-control` both resolve to Arial/Arimo, so there's no visible change, the existing reftests pass unmodified.
      • macOS: they differ - `-webkit-small-control` is the system control font and sans-serif is Helvetica - so the autofill preview glyphs do change there (I updated the mac-rel reftest baselines for this).

      The change is limited to the transient greyed-out preview text in `::-internal-input-suggested` / `::-internal-select-autofill-preview-text`; once a suggestion is accepted the field renders the real value in its own font, and textarea  previews are unaffected.

      Joey Arhar

      Thanks for the explanation, its unfortunate that this changes the behavior on mac. can you add a runtime enabled features flag here in case anything goes wrong and we have to revert and find another way to fix this that doesn't change the fonts on mac?

      File third_party/blink/renderer/core/html/resources/html.css
      Line 642, Patchset 9: font-family: sans-serif !important;
      Joey Arhar . resolved

      I am modifying the same code here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7885624

      I don't think that my patch adds a forced font-family like this. So `font: -webkit-small-control !important` doesn't actually force a specific font-family?

      Dileep Maurya

      The font shorthand resets every font longhand, and the system-font keyword resolves font-family to a concrete platform family `system_font->ResolveFontFamily() -> LayoutThemeFontProvider::SystemFontFamily() -> DefaultGUIFont()` (e.g. "Arial") — as a non-generic kFamilyName (style_builder_converter.cc). That concrete name is exactly what gets looked up in the author @font-face cache (`if (!font_family.FamilyIsGeneric()) guard in CSSFontSelector::GetFontData`), which is the side channel this CL closes. `font-family: sans-serif !important`  overrides only the family with a generic one, which skips that lookup.

      Your CL#7885624 — we overlap on `select::-internal-select-autofill-preview-text`. As long as the hard-coded family is a generic keyword (sans-serif / monospace), the security property holds; a concrete family name would reintroduce the leak. Happy to coordinate ordering - I can rebase on top of yours. PTAL.

      Joey Arhar

      thanks, im happy to deal with conflicts too if this patch gets merged first

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dileep Maurya
      • Kevin Babbitt
      • Virali Purbey
      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: I063833950480d20453491d5a07dea842c0b061d1
      Gerrit-Change-Number: 7930489
      Gerrit-PatchSet: 12
      Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
      Gerrit-CC: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Comment-Date: Tue, 23 Jun 2026 16:10:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Joey Arhar <jar...@chromium.org>
      Comment-In-Reply-To: Dileep Maurya <dileep...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Jun 23, 2026, 12:55:21 PM (2 days ago) Jun 23
      to Dileep Maurya, Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Dileep Maurya, Kevin Babbitt and Virali Purbey

      Joey Arhar added 1 comment

      Commit Message
      Line 10, Patchset 9:platform name (e.g. "Arial"), so the !important rule on
      Joey Arhar . unresolved

      Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

      Dileep Maurya

      `sans-serif` is a generic family, so it doesn't resolve specifically to Arial, it maps to whatever the platform/user `generic-sans-serif` setting is. In practice:

      • Windows/Linux: sans-serif and `-webkit-small-control` both resolve to Arial/Arimo, so there's no visible change, the existing reftests pass unmodified.
      • macOS: they differ - `-webkit-small-control` is the system control font and sans-serif is Helvetica - so the autofill preview glyphs do change there (I updated the mac-rel reftest baselines for this).

      The change is limited to the transient greyed-out preview text in `::-internal-input-suggested` / `::-internal-select-autofill-preview-text`; once a suggestion is accepted the field renders the real value in its own font, and textarea  previews are unaffected.

      Joey Arhar

      Thanks for the explanation, its unfortunate that this changes the behavior on mac. can you add a runtime enabled features flag here in case anything goes wrong and we have to revert and find another way to fix this that doesn't change the fonts on mac?

      Joey Arhar

      I just ran into a similar issue with my patch, and after reading the code it looks to me like every platform uses Arial for -webkit-small-control via LayoutThemeFontProvider::SystemFontFamily -> DefaultGUIFont. Where does mac get Helvetica?

      If mac really does get Helvetica, should we just set that in a mac platform-specific css file or something? Maybe its not worth the effort but it should prevent this patch from actually changing anything which might be nice.

      Gerrit-Comment-Date: Tue, 23 Jun 2026 16:55:07 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dileep Maurya (Gerrit)

      unread,
      Jun 24, 2026, 7:50:05 AM (19 hours ago) Jun 24
      to Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Joey Arhar, Kevin Babbitt and Virali Purbey

      Dileep Maurya voted and added 1 comment

      Votes added by Dileep Maurya

      Commit-Queue+1

      1 comment

      Commit Message
      Line 10, Patchset 9:platform name (e.g. "Arial"), so the !important rule on
      Joey Arhar . unresolved

      Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

      Dileep Maurya

      `sans-serif` is a generic family, so it doesn't resolve specifically to Arial, it maps to whatever the platform/user `generic-sans-serif` setting is. In practice:

      • Windows/Linux: sans-serif and `-webkit-small-control` both resolve to Arial/Arimo, so there's no visible change, the existing reftests pass unmodified.
      • macOS: they differ - `-webkit-small-control` is the system control font and sans-serif is Helvetica - so the autofill preview glyphs do change there (I updated the mac-rel reftest baselines for this).

      The change is limited to the transient greyed-out preview text in `::-internal-input-suggested` / `::-internal-select-autofill-preview-text`; once a suggestion is accepted the field renders the real value in its own font, and textarea  previews are unaffected.

      Joey Arhar

      Thanks for the explanation, its unfortunate that this changes the behavior on mac. can you add a runtime enabled features flag here in case anything goes wrong and we have to revert and find another way to fix this that doesn't change the fonts on mac?

      Joey Arhar

      I just ran into a similar issue with my patch, and after reading the code it looks to me like every platform uses Arial for -webkit-small-control via LayoutThemeFontProvider::SystemFontFamily -> DefaultGUIFont. Where does mac get Helvetica?

      If mac really does get Helvetica, should we just set that in a mac platform-specific css file or something? Maybe its not worth the effort but it should prevent this patch from actually changing anything which might be nice.

      Dileep Maurya
      You're right, thanks for the catch, `-webkit-small-control` resolves to "Arial" on every platform, Mac included, via  `LayoutThemeFontProvider::SystemFontFamily() -> DefaultGUIFont()`. 

      The "Helvetica" is introduced by current change: `sans-serif` is generic, and in our font config sans-serif maps to "Helvetica" on all platforms ( web_test_control_host.cc ). Helvetica is only installed on Mac, so Win/Linux fallback to Arial/Arimo, while Mac actually renders Helvetica. That's why only mac-rel rebaselined.

      Why it has to be a generic family (why Mac changes): The leak is closed in `CSSFontSelector::GetFontData()` - the author @font-face cache is consulted only when `!font_family.FamilyIsGeneric()` ( css_font_selector.cc ). A generic keyword skips that lookup and resolves straight from settings, so an author @font-face can never be matched for the preview. A concrete family - including hard-coding Arial - still hits that author-cache lookup and would reintroduce exactly the side channel we're closing. As per my observation there seems to be no generic keyword that maps to Arial on Mac (sans-serif=Helvetica, serif=Times, monospace=Menlo), so any safe value necessarily changes the Mac glyphs.
      On "set it in a Mac-specific CSS to avoid changing anything": I'd prefer that too, but that seems not possible with a concrete font, for the reason above. There is another approach with "C++ fix" that was introduced in PatchSet4 to keep Arial on Mac and stay safe (tag system-keyword-resolved families and bypass the author cache for them), which I descoped to keep this fix narrow. Happy to revisit if avoiding the Mac change is worth the larger surface.

      Agreed on the flag - I've wrapped this change in a runtime enabled feature flag so it can be reverted. PTAL.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Joey Arhar
      • Kevin Babbitt
      • Virali Purbey
      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: I063833950480d20453491d5a07dea842c0b061d1
      Gerrit-Change-Number: 7930489
      Gerrit-PatchSet: 13
      Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
      Gerrit-CC: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Joey Arhar <jar...@chromium.org>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 11:49:35 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Joey Arhar (Gerrit)

      unread,
      Jun 24, 2026, 12:15:29 PM (14 hours ago) Jun 24
      to Dileep Maurya, Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Dileep Maurya, Kevin Babbitt and Virali Purbey

      Joey Arhar voted and added 2 comments

      Votes added by Joey Arhar

      Code-Review+1

      2 comments

      Commit Message
      Line 10, Patchset 9:platform name (e.g. "Arial"), so the !important rule on
      Joey Arhar . resolved

      Does this mean that adding `font-family:sans-serif!important` will actually change the behavior because its not arial anymore? Or does sans-serif resolve to arial in this case?

      Dileep Maurya

      `sans-serif` is a generic family, so it doesn't resolve specifically to Arial, it maps to whatever the platform/user `generic-sans-serif` setting is. In practice:

      • Windows/Linux: sans-serif and `-webkit-small-control` both resolve to Arial/Arimo, so there's no visible change, the existing reftests pass unmodified.
      • macOS: they differ - `-webkit-small-control` is the system control font and sans-serif is Helvetica - so the autofill preview glyphs do change there (I updated the mac-rel reftest baselines for this).

      The change is limited to the transient greyed-out preview text in `::-internal-input-suggested` / `::-internal-select-autofill-preview-text`; once a suggestion is accepted the field renders the real value in its own font, and textarea  previews are unaffected.

      Joey Arhar

      Thanks for the explanation, its unfortunate that this changes the behavior on mac. can you add a runtime enabled features flag here in case anything goes wrong and we have to revert and find another way to fix this that doesn't change the fonts on mac?

      Joey Arhar

      I just ran into a similar issue with my patch, and after reading the code it looks to me like every platform uses Arial for -webkit-small-control via LayoutThemeFontProvider::SystemFontFamily -> DefaultGUIFont. Where does mac get Helvetica?

      If mac really does get Helvetica, should we just set that in a mac platform-specific css file or something? Maybe its not worth the effort but it should prevent this patch from actually changing anything which might be nice.

      Dileep Maurya
      You're right, thanks for the catch, `-webkit-small-control` resolves to "Arial" on every platform, Mac included, via  `LayoutThemeFontProvider::SystemFontFamily() -> DefaultGUIFont()`. 

      The "Helvetica" is introduced by current change: `sans-serif` is generic, and in our font config sans-serif maps to "Helvetica" on all platforms ( web_test_control_host.cc ). Helvetica is only installed on Mac, so Win/Linux fallback to Arial/Arimo, while Mac actually renders Helvetica. That's why only mac-rel rebaselined.

      Why it has to be a generic family (why Mac changes): The leak is closed in `CSSFontSelector::GetFontData()` - the author @font-face cache is consulted only when `!font_family.FamilyIsGeneric()` ( css_font_selector.cc ). A generic keyword skips that lookup and resolves straight from settings, so an author @font-face can never be matched for the preview. A concrete family - including hard-coding Arial - still hits that author-cache lookup and would reintroduce exactly the side channel we're closing. As per my observation there seems to be no generic keyword that maps to Arial on Mac (sans-serif=Helvetica, serif=Times, monospace=Menlo), so any safe value necessarily changes the Mac glyphs.
      On "set it in a Mac-specific CSS to avoid changing anything": I'd prefer that too, but that seems not possible with a concrete font, for the reason above. There is another approach with "C++ fix" that was introduced in PatchSet4 to keep Arial on Mac and stay safe (tag system-keyword-resolved families and bypass the author cache for them), which I descoped to keep this fix narrow. Happy to revisit if avoiding the Mac change is worth the larger surface.

      Agreed on the flag - I've wrapped this change in a runtime enabled feature flag so it can be reverted. PTAL.
      Joey Arhar

      lgtm, thanks for the context

      File third_party/blink/renderer/core/html/resources/html.css
      Line 643, Patchset 13 (Latest): @font-face. crbug.com/517710554. */
      Joey Arhar . unresolved

      Could you say more explicitly here that ideally we would be using Arial which is what -webkit-small-control does, but we can't because it hits the @font-face issue?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Dileep Maurya
      • Kevin Babbitt
      • Virali Purbey
      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: I063833950480d20453491d5a07dea842c0b061d1
      Gerrit-Change-Number: 7930489
      Gerrit-PatchSet: 13
      Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
      Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
      Gerrit-CC: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Dileep Maurya <dileep...@microsoft.com>
      Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
      Gerrit-Comment-Date: Wed, 24 Jun 2026 16:15:11 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Dileep Maurya (Gerrit)

      unread,
      Jun 24, 2026, 12:50:32 PM (14 hours ago) Jun 24
      to Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, jmedle...@chromium.org, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
      Attention needed from Kevin Babbitt and Virali Purbey

      Dileep Maurya added 1 comment

      File third_party/blink/renderer/core/html/resources/html.css
      Line 643, Patchset 13: @font-face. crbug.com/517710554. */
      Joey Arhar . resolved

      Could you say more explicitly here that ideally we would be using Arial which is what -webkit-small-control does, but we can't because it hits the @font-face issue?

      Dileep Maurya

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Kevin Babbitt
      • Virali Purbey
      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: I063833950480d20453491d5a07dea842c0b061d1
        Gerrit-Change-Number: 7930489
        Gerrit-PatchSet: 14
        Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
        Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-CC: Gaurav Kumar <gaur...@microsoft.com>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Ragvesh Sharma <rags...@microsoft.com>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
        Gerrit-CC: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Kevin Babbitt <kbab...@microsoft.com>
        Gerrit-Comment-Date: Wed, 24 Jun 2026 16:49:48 +0000
        satisfied_requirement
        open
        diffy

        Dileep Maurya (Gerrit)

        unread,
        Jun 24, 2026, 12:51:00 PM (14 hours ago) Jun 24
        to Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, jmedle...@chromium.org, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
        Attention needed from Kevin Babbitt and Virali Purbey

        Dileep Maurya voted Commit-Queue+2

        Commit-Queue+2
        Gerrit-Comment-Date: Wed, 24 Jun 2026 16:50:30 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Kevin Babbitt (Gerrit)

        unread,
        Jun 24, 2026, 12:59:15 PM (14 hours ago) Jun 24
        to Dileep Maurya, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, Chromium LUCI CQ, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, jmedle...@chromium.org, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org
        Attention needed from Dileep Maurya and Virali Purbey

        Kevin Babbitt voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Dileep Maurya
        • Virali Purbey
        Gerrit-Attention: Dileep Maurya <dileep...@microsoft.com>
        Gerrit-Comment-Date: Wed, 24 Jun 2026 16:59:06 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 24, 2026, 1:59:34 PM (13 hours ago) Jun 24
        to Dileep Maurya, Kevin Babbitt, Virali Purbey, Gaurav Kumar, Divyansh Mangal, Vinay Singh, Ragvesh Sharma, Stephen Chenney, Menard, Alexis, Dirk Schulze, chromium...@chromium.org, android-bu...@system.gserviceaccount.com, jmedle...@chromium.org, fserb...@chromium.org, blink-reviews-p...@chromium.org, kinuko...@chromium.org, blink-re...@chromium.org, apavlo...@chromium.org, drott+bl...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, blink-rev...@chromium.org

        Chromium LUCI CQ submitted the change

        Change information

        Commit message:
        Pin suggested-value pseudo elements to a generic font family

        `font: -webkit-small-control` resolves font-family to a concrete

        platform name (e.g. "Arial"), so the !important rule on
        `::-internal-input-suggested` and
        `::-internal-select-autofill-preview-text` could still pick up an
        author @font-face declared for that name. Append
        `font-family: sans-serif !important` after the shorthand so the
        preview text always resolves to a generic family, matching the
        existing `textarea::-internal-input-suggested` rule.
        Bug: 517710554
        Change-Id: I063833950480d20453491d5a07dea842c0b061d1
        Reviewed-by: Joey Arhar <jar...@chromium.org>
        Commit-Queue: Dileep Maurya <dileep...@microsoft.com>
        Reviewed-by: Kevin Babbitt <kbab...@microsoft.com>
        Cr-Commit-Position: refs/heads/main@{#1651835}
        Files:
        • M third_party/blink/renderer/core/html/forms/html_input_element_test.cc
        • M third_party/blink/renderer/core/html/resources/html.css
        • M third_party/blink/renderer/platform/runtime_enabled_features.json5
        • A third_party/blink/web_tests/fast/forms/suggested-value-author-font-face-leak.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-expected.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-suggested-value-over-placeholder-value-expected.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-suggested-value-when-underlying-placeholder-is-removed-expected.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-suggestion-maxlength-expected.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-very-long-value-expected.html
        • M third_party/blink/web_tests/fast/forms/text/input-appearance-autocomplete-with-initial-value-expected.html
        • M third_party/blink/web_tests/fast/forms/text/password-input-suggested-value-appearance-expected.html
        Change size: M
        Delta: 11 files changed, 121 insertions(+), 7 deletions(-)
        Branch: refs/heads/main
        Submit Requirements:
        • requirement satisfiedCode-Review: +1 by Joey Arhar, +1 by Kevin Babbitt
        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: I063833950480d20453491d5a07dea842c0b061d1
        Gerrit-Change-Number: 7930489
        Gerrit-PatchSet: 15
        Gerrit-Owner: Dileep Maurya <dileep...@microsoft.com>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Dileep Maurya <dileep...@microsoft.com>
        Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
        Gerrit-Reviewer: Kevin Babbitt <kbab...@microsoft.com>
        open
        diffy
        satisfied_requirement
        Reply all
        Reply to author
        Forward
        0 new messages