[PDF Ink Signatures] Add WebFormControlElement::GetFontsForText() [chromium/src : main]

0 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Feb 2, 2026, 3:50:51 PM (9 days ago) Feb 2
to Lei Zhang, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 864, Patchset 1 (Latest): FontFallbackIterator::HintCharList hint_list;
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types. Iterating directly over 'String' yields 16-bit 'UChar's, not 'UChar32' code points. This will split surrogate pairs and likely break font lookup for non-BMP characters. Since you included 'code_point_iterator.h', consider using 'WTF::CodePointIterator(value_)' to correctly iterate over code points.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention set is empty
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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
Gerrit-Change-Number: 7539461
Gerrit-PatchSet: 1
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-Comment-Date: Mon, 02 Feb 2026 20:50:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

April Kallmeyer (Gerrit)

unread,
Feb 2, 2026, 4:26:54 PM (9 days ago) Feb 2
to Lei Zhang, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from Lei Zhang

April Kallmeyer added 1 comment

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 883, Patchset 1 (Latest): results.push_back(actual_font->PlatformData().FontFamilyName());
April Kallmeyer . unresolved

Is this enough information to uniquely identify the font? It's possible to get the SkTypeface here and that has a serialize method.

I don't know enough about fonts to know if family is enough.

Open in Gerrit

Related details

Attention is currently required from:
  • Lei Zhang
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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
Gerrit-Change-Number: 7539461
Gerrit-PatchSet: 1
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: April Kallmeyer <a...@chromium.org>
Gerrit-Attention: Lei Zhang <the...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 21:26:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 2, 2026, 4:40:51 PM (9 days ago) Feb 2
to Lei Zhang, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from April Kallmeyer

Lei Zhang added 1 comment

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 883, Patchset 1 (Latest): results.push_back(actual_font->PlatformData().FontFamilyName());
April Kallmeyer . unresolved

Is this enough information to uniquely identify the font? It's possible to get the SkTypeface here and that has a serialize method.

I don't know enough about fonts to know if family is enough.

Lei Zhang

In my local build, I can print out the font names and they look sufficient. I haven't tried sending the font names to the backend and then actually retrieving the font data.

Open in Gerrit

Related details

Attention is currently required from:
  • April Kallmeyer
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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
Gerrit-Change-Number: 7539461
Gerrit-PatchSet: 1
Gerrit-Owner: Lei Zhang <the...@chromium.org>
Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: April Kallmeyer <a...@chromium.org>
Gerrit-Attention: April Kallmeyer <a...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 21:40:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: April Kallmeyer <a...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 2, 2026, 6:02:22 PM (9 days ago) Feb 2
to Lei Zhang, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from April Kallmeyer

Lei Zhang added 1 comment

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 883, Patchset 1 (Latest): results.push_back(actual_font->PlatformData().FontFamilyName());
April Kallmeyer . unresolved

Is this enough information to uniquely identify the font? It's possible to get the SkTypeface here and that has a serialize method.

I don't know enough about fonts to know if family is enough.

Lei Zhang

In my local build, I can print out the font names and they look sufficient. I haven't tried sending the font names to the backend and then actually retrieving the font data.

Lei Zhang

If I toggle bold and/or italic, the font family name stays the same, e.g. "Arial", while the PostScript name changes. e.g. ArialMT, Arial-BoldMT, ArialBoldItalicMT and Arial-ItalicMT.

Gerrit-Comment-Date: Mon, 02 Feb 2026 23:02:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
Comment-In-Reply-To: April Kallmeyer <a...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 3, 2026, 10:29:00 PM (8 days ago) Feb 3
to Lei Zhang, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from April Kallmeyer

Lei Zhang added 1 comment

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 883, Patchset 1 (Latest): results.push_back(actual_font->PlatformData().FontFamilyName());
April Kallmeyer . unresolved

Is this enough information to uniquely identify the font? It's possible to get the SkTypeface here and that has a serialize method.

I don't know enough about fonts to know if family is enough.

Lei Zhang

In my local build, I can print out the font names and they look sufficient. I haven't tried sending the font names to the backend and then actually retrieving the font data.

Lei Zhang

If I toggle bold and/or italic, the font family name stays the same, e.g. "Arial", while the PostScript name changes. e.g. ArialMT, Arial-BoldMT, ArialBoldItalicMT and Arial-ItalicMT.

Lei Zhang

I'm very tempted to just send the font data over. Then the PDF backend doesn't have to separately retrieve it and potentially get it wrong. But sending over MBs of font data for each <textarea> can be expensive in terms of memory usage.

Gerrit-Comment-Date: Wed, 04 Feb 2026 03:28:51 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Lei Zhang (Gerrit)

unread,
Feb 9, 2026, 2:51:52 PM (2 days ago) Feb 9
to Lei Zhang, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
Attention needed from April Kallmeyer

Lei Zhang added 2 comments

File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
Line 864, Patchset 1: FontFallbackIterator::HintCharList hint_list;
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types. Iterating directly over 'String' yields 16-bit 'UChar's, not 'UChar32' code points. This will split surrogate pairs and likely break font lookup for non-BMP characters. Since you included 'code_point_iterator.h', consider using 'WTF::CodePointIterator(value_)' to correctly iterate over code points.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Lei Zhang

Invalid: blink::String::begin() returns CodePointIterator.

Line 883, Patchset 1: results.push_back(actual_font->PlatformData().FontFamilyName());
April Kallmeyer . resolved

Is this enough information to uniquely identify the font? It's possible to get the SkTypeface here and that has a serialize method.

I don't know enough about fonts to know if family is enough.

Lei Zhang

In my local build, I can print out the font names and they look sufficient. I haven't tried sending the font names to the backend and then actually retrieving the font data.

Lei Zhang

If I toggle bold and/or italic, the font family name stays the same, e.g. "Arial", while the PostScript name changes. e.g. ArialMT, Arial-BoldMT, ArialBoldItalicMT and Arial-ItalicMT.

Lei Zhang

I'm very tempted to just send the font data over. Then the PDF backend doesn't have to separately retrieve it and potentially get it wrong. But sending over MBs of font data for each <textarea> can be expensive in terms of memory usage.

Lei Zhang

Should be ok, since later CLs will only ever send each font once.

Open in Gerrit

Related details

Attention is currently required from:
  • April Kallmeyer
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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
    Gerrit-Change-Number: 7539461
    Gerrit-PatchSet: 10
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: April Kallmeyer <a...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Feb 2026 19:51:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Lei Zhang <the...@chromium.org>
    Comment-In-Reply-To: April Kallmeyer <a...@chromium.org>
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Lei Zhang (Gerrit)

    unread,
    Feb 9, 2026, 2:54:10 PM (2 days ago) Feb 9
    to Lei Zhang, Mason Freed, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from April Kallmeyer and Mason Freed

    Lei Zhang added 1 comment

    Patchset-level comments
    File-level comment, Patchset 10 (Latest):
    Lei Zhang . resolved

    masonf@: Can I get an early review to make sure the blink/public/ changes are ok? I will add tests, assuming this is ok.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • April Kallmeyer
    • Mason Freed
    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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
    Gerrit-Change-Number: 7539461
    Gerrit-PatchSet: 10
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: April Kallmeyer <a...@chromium.org>
    Gerrit-Attention: Mason Freed <mas...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Comment-Date: Mon, 09 Feb 2026 19:54:01 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Mason Freed (Gerrit)

    unread,
    Feb 10, 2026, 1:29:42 PM (yesterday) Feb 10
    to Lei Zhang, Dominik Röttsches, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from April Kallmeyer, Dominik Röttsches and Lei Zhang

    Mason Freed added 1 comment

    Patchset-level comments
    Mason Freed . resolved

    Thanks - this approach seems ok to me. But I'd be more comfortable if drott@ took a look also.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • April Kallmeyer
    • Dominik Röttsches
    • Lei Zhang
    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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
    Gerrit-Change-Number: 7539461
    Gerrit-PatchSet: 10
    Gerrit-Owner: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Dominik Röttsches <dr...@chromium.org>
    Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
    Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: April Kallmeyer <a...@chromium.org>
    Gerrit-Attention: Lei Zhang <the...@chromium.org>
    Gerrit-Attention: April Kallmeyer <a...@chromium.org>
    Gerrit-Attention: Dominik Röttsches <dr...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Feb 2026 18:29:34 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dominik Röttsches (Gerrit)

    unread,
    3:14 AM (20 hours ago) 3:14 AM
    to Lei Zhang, Mason Freed, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
    Attention needed from April Kallmeyer and Lei Zhang

    Dominik Röttsches added 2 comments

    File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
    Line 852, Patchset 10 (Latest):Vector<sk_sp<SkTypeface>> HTMLTextAreaElement::GetFontsForText() const {
    Dominik Röttsches . unresolved

    Do you need the fonts and text or do you only need the sequence of glyph ids plus font blobs? - If you only need glyph ids and font blobs, it might make more sense to extract this from the TextPainter and drawing commands.

    Line 856, Patchset 10 (Latest): const Font& font_ref = *ComputedStyleRef().GetFont();
    Dominik Röttsches . unresolved

    This re-runs the fallback logic even though this is already done for the text that has appeared on the screen. I think a better way to do this here would be to try and get access to the ShapeResult(View) of the text area and extract it from there, instead of reimplementing the fallback logic. But see comment above - if only the glyph stream is needed, interfacing with paint would be better.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • April Kallmeyer
    • Lei Zhang
    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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
      Gerrit-Change-Number: 7539461
      Gerrit-PatchSet: 10
      Gerrit-Owner: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Dominik Röttsches <dr...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: April Kallmeyer <a...@chromium.org>
      Gerrit-Attention: Lei Zhang <the...@chromium.org>
      Gerrit-Attention: April Kallmeyer <a...@chromium.org>
      Gerrit-Comment-Date: Wed, 11 Feb 2026 08:14:43 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Lei Zhang (Gerrit)

      unread,
      10:49 PM (1 hour ago) 10:49 PM
      to Lei Zhang, Dominik Röttsches, Mason Freed, April Kallmeyer, AI Code Reviewer, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org
      Attention needed from April Kallmeyer and Dominik Röttsches

      Lei Zhang added 1 comment

      File third_party/blink/renderer/core/html/forms/html_text_area_element.cc
      Line 852, Patchset 10 (Latest):Vector<sk_sp<SkTypeface>> HTMLTextAreaElement::GetFontsForText() const {
      Dominik Röttsches . unresolved

      Do you need the fonts and text or do you only need the sequence of glyph ids plus font blobs? - If you only need glyph ids and font blobs, it might make more sense to extract this from the TextPainter and drawing commands.

      Lei Zhang

      I think glyph IDs plus font blobs can work. Do I have to instantiate new TextPainter objects here, or is there some other way to hook into the paint code?

      Open in Gerrit

      Related details

      Attention is currently required from:
      • April Kallmeyer
      • Dominik Röttsches
      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: Ib0954e24d89cf0a46dbeef3548271125f2c4ffdf
      Gerrit-Change-Number: 7539461
      Gerrit-PatchSet: 10
      Gerrit-Owner: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Dominik Röttsches <dr...@chromium.org>
      Gerrit-Reviewer: Lei Zhang <the...@chromium.org>
      Gerrit-Reviewer: Mason Freed <mas...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: April Kallmeyer <a...@chromium.org>
      Gerrit-Attention: April Kallmeyer <a...@chromium.org>
      Gerrit-Attention: Dominik Röttsches <dr...@chromium.org>
      Gerrit-Comment-Date: Thu, 12 Feb 2026 03:49:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Dominik Röttsches <dr...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages