refactor: third_party/blink/renderer/core/html/parser/literal_buffer.h [chromium/src : main]

2 views
Skip to first unread message

AI Code Reviewer (Gerrit)

unread,
Dec 19, 2025, 12:00:07 PM12/19/25
to Sergio Solano, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org

AI Code Reviewer added 4 comments

File third_party/blink/renderer/core/html/parser/literal_buffer.h
Line 160, Patchset 1 (Latest): size_t size_ = 0;
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Consider using 'wtf_size_t' instead of 'size_t' for the member variable 'size_' to match the return type of 'size()' and reduce memory usage.

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)_

File third_party/blink/renderer/core/html/parser/markup_tokenizer_inlines.h
Line 52, Patchset 1 (Latest): for (char c : std::string_view(expected_characters)) {
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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)_

Line 45, Patchset 1 (Latest): for (char c : std::string_view(expected_characters)) {
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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)_

File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
Line 1885, Patchset 1 (Latest): int /*nbDefaulted*/,
AI Code Reviewer . unresolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
Gerrit-Change-Number: 7281269
Gerrit-PatchSet: 1
Gerrit-Owner: Sergio Solano <sergio...@google.com>
Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 17:00:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Steinar H Gunderson (Gerrit)

unread,
Dec 19, 2025, 12:13:54 PM12/19/25
to Sergio Solano, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
Attention needed from Sergio Solano

Steinar H Gunderson added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Steinar H Gunderson . resolved

Preemptively: Please run relevant benchmarks before sending this for review. This is the fifth AI-generated spanification CL we've seen only this week (!) that is a probable performance regression, and it's starting to be disruptive for team load. Thank you :-)

Open in Gerrit

Related details

Attention is currently required from:
  • Sergio Solano
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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
Gerrit-Change-Number: 7281269
Gerrit-PatchSet: 1
Gerrit-Owner: Sergio Solano <sergio...@google.com>
Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Sergio Solano <sergio...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 17:13:42 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

chromeperf@appspot.gserviceaccount.com (Gerrit)

unread,
Dec 19, 2025, 2:27:59 PM12/19/25
to Sergio Solano, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
Attention needed from Sergio Solano

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

📍 Job linux-perf/speedometer3 complete.

See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1023ec81b10000

Open in Gerrit

Related details

Attention is currently required from:
  • Sergio Solano
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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
Gerrit-Change-Number: 7281269
Gerrit-PatchSet: 2
Gerrit-Owner: Sergio Solano <sergio...@google.com>
Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Sergio Solano <sergio...@google.com>
Gerrit-Comment-Date: Fri, 19 Dec 2025 19:27:49 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Sergio Solano (Gerrit)

unread,
Feb 9, 2026, 11:24:45 PMFeb 9
to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
Attention needed from Stephen Nusko

Sergio Solano added 4 comments

File third_party/blink/renderer/core/html/parser/literal_buffer.h
Line 160, Patchset 1: size_t size_ = 0;
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types over STL and base types. Consider using 'wtf_size_t' instead of 'size_t' for the member variable 'size_' to match the return type of 'size()' and reduce memory usage.

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)_

Sergio Solano

Done

File third_party/blink/renderer/core/html/parser/markup_tokenizer_inlines.h
Line 52, Patchset 1: for (char c : std::string_view(expected_characters)) {
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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)_

Sergio Solano

Done

Line 45, Patchset 1: for (char c : std::string_view(expected_characters)) {
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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)_

Sergio Solano

Done

File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
Line 1885, Patchset 1: int /*nbDefaulted*/,
AI Code Reviewer . resolved

Blink Style Guide: Prefer blink:: types over STL and base types. Please use 'StringView' (WTF::StringView) instead of 'std::string_view'.

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)_

Sergio Solano

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Stephen Nusko
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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
    Gerrit-Change-Number: 7281269
    Gerrit-PatchSet: 4
    Gerrit-Owner: Sergio Solano <sergio...@google.com>
    Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
    Gerrit-Comment-Date: Tue, 10 Feb 2026 04:24:36 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Stephen Nusko (Gerrit)

    unread,
    Feb 10, 2026, 1:47:04 AMFeb 10
    to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
    Attention needed from Sergio Solano

    Stephen Nusko added 8 comments

    File third_party/blink/renderer/core/html/parser/markup_tokenizer_inlines.h
    Line 52, Patchset 4 (Latest): for (unsigned i = 0; i < expected_characters.length(); ++i) {
    source.AdvanceAndASSERT(expected_characters[i]);
    }
    Stephen Nusko . unresolved

    Same here?

    Line 45, Patchset 4 (Latest): for (unsigned i = 0; i < expected_characters.length(); ++i) {
    source.AdvanceAndASSERTIgnoringCase(expected_characters[i]);
    }
    Stephen Nusko . unresolved

    This could just be a for each loop right?

    ```
    for (const auto& expected : expected_characters) {
    source.AdvanceAndASSERTIgnoringCase(expected);
    }
    ```
    File third_party/blink/renderer/core/style/style_variables.h
    Line 273, Patchset 4 (Parent): // It is legal to copy Member<> with memcpy() here, since we are in a
    // constructor. (We could use an initializer, but Clang doesn't
    // manage to combine the loads and stores into larger parts.)
    UNSAFE_TODO(memcpy(&values_, &other.values_, sizeof(values_)));
    UNSAFE_TODO(memcpy(&children_, &other.children_, sizeof(children_)));
    Stephen Nusko . unresolved

    This comment is very clear that this is heavily optimized code.

    blink code should be spanified with extreme care.

    Can you do some due diligence here and

    1) check that speedometer3/jetstream2 doesn't experience a regression
    2) Look for any micro benchmarks around this css parser?
    3) That if you look for the assembly code in particular here it generates similar optimized code similar or better than before?

    If we can't do 3) we should perhaps leave this until an expert with the skill to do so has a chance to look.

    File third_party/blink/renderer/core/svg/animation/svg_smil_element.cc
    Line 85, Patchset 4 (Latest): // SAFETY: The loop iterates over a WTF::Vector within the bounds of the
    // container, from a valid iterator to the end.
    Stephen Nusko . unresolved

    a WTF::Vector is not hardened I don't think we should promote this to UNSAFE_BUFFERS leave as UNSAFE_TODO, we can't meaningfully verify the bounds here by any API promise.

    Line 903, Patchset 4 (Latest): search_start != begin_times_.end(); UNSAFE_BUFFERS(++search_start)) {
    Stephen Nusko . unresolved

    Same here (SMILInstanceTimeList is just a blink::Vector)

    File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
    Line 1280, Patchset 4 (Latest): char buffer[1024];
    // SAFETY: vsnprintf ensures not to write more than 1024 bytes.
    UNSAFE_BUFFERS(vsnprintf(buffer, sizeof(buffer), message, args));
    Stephen Nusko . unresolved

    Can we use `base::SafeSPrintf`?

    Line 1497, Patchset 4 (Latest): // `GetError` is safe as it immediately converts the arguments into a
    // `std::string` using `base::StringPrintV`.
    UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning,
    message, args));
    Stephen Nusko . unresolved

    I don't understand what is the buffers usage here we are suppressing? This just looks like we are reinterpreting casting and calling a function on the result? Can you let me know the error? looks like we shouldn't need a UNSAFE_BUFFERS?

    Line 1511, Patchset 4 (Latest): UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal,
    Stephen Nusko . unresolved

    Same here?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Sergio Solano
    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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
      Gerrit-Change-Number: 7281269
      Gerrit-PatchSet: 4
      Gerrit-Owner: Sergio Solano <sergio...@google.com>
      Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Sergio Solano <sergio...@google.com>
      Gerrit-Comment-Date: Tue, 10 Feb 2026 06:46:38 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Stephen Nusko (Gerrit)

      unread,
      Feb 10, 2026, 1:48:22 AMFeb 10
      to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Sergio Solano

      Stephen Nusko added 1 comment

      File third_party/blink/renderer/core/style/style_variables.h
      Line 273, Patchset 4 (Parent): // It is legal to copy Member<> with memcpy() here, since we are in a
      // constructor. (We could use an initializer, but Clang doesn't
      // manage to combine the loads and stores into larger parts.)
      UNSAFE_TODO(memcpy(&values_, &other.values_, sizeof(values_)));
      UNSAFE_TODO(memcpy(&children_, &other.children_, sizeof(children_)));
      Stephen Nusko . unresolved

      This comment is very clear that this is heavily optimized code.

      blink code should be spanified with extreme care.

      Can you do some due diligence here and

      1) check that speedometer3/jetstream2 doesn't experience a regression
      2) Look for any micro benchmarks around this css parser?
      3) That if you look for the assembly code in particular here it generates similar optimized code similar or better than before?

      If we can't do 3) we should perhaps leave this until an expert with the skill to do so has a chance to look.

      Stephen Nusko

      And I see you already did speedometer 😄

      https://pinpoint-dot-chromeperf.appspot.com/job/1023ec81b10000

      But can you run it on mac-m1_mini_2020-perf with 150 tries (it should default) as described here: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/benchmark_performance_regressions.md

      Gerrit-Comment-Date: Tue, 10 Feb 2026 06:48:02 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Feb 10, 2026, 2:02:54 PMFeb 10
      to Sergio Solano, Stephen Nusko, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Sergio Solano

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

      📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/14ee0c64f10000

      Gerrit-Comment-Date: Tue, 10 Feb 2026 19:02:43 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Feb 10, 2026, 2:08:56 PMFeb 10
      to Sergio Solano, Stephen Nusko, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Sergio Solano

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

      📍 Job mac-m1_mini_2020-perf/jetstream2 complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/17ddebc4f10000

      Gerrit-Comment-Date: Tue, 10 Feb 2026 19:08:48 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Feb 17, 2026, 6:52:59 PMFeb 17
      to Sergio Solano, Stephen Nusko, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Sergio Solano

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

      📍 Job mac-m1_mini_2020-perf/jetstream2 complete.

      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/1757328ef10000

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Sergio Solano
      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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
      Gerrit-Change-Number: 7281269
      Gerrit-PatchSet: 6
      Gerrit-Owner: Sergio Solano <sergio...@google.com>
      Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
      Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Sergio Solano <sergio...@google.com>
      Gerrit-Comment-Date: Tue, 17 Feb 2026 23:52:50 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      chromeperf@appspot.gserviceaccount.com (Gerrit)

      unread,
      Feb 17, 2026, 6:53:22 PMFeb 17
      to Sergio Solano, Stephen Nusko, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Sergio Solano

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

      📍 Job mac-m1_mini_2020-perf/speedometer3 complete.

      • TodoMVC-JavaScript-ES6-Webpack-Complex-DOM: base median = 37.985000000474976 -> patched median = 38.195000000018624


      See results at: https://pinpoint-dot-chromeperf.appspot.com/job/131061e9f10000

      Gerrit-Comment-Date: Tue, 17 Feb 2026 23:53:15 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Sergio Solano (Gerrit)

      unread,
      Feb 20, 2026, 3:57:28 PMFeb 20
      to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Stephen Nusko

      Sergio Solano added 8 comments

      File third_party/blink/renderer/core/html/parser/markup_tokenizer_inlines.h
      Line 52, Patchset 4: for (unsigned i = 0; i < expected_characters.length(); ++i) {
      source.AdvanceAndASSERT(expected_characters[i]);
      }
      Stephen Nusko . resolved

      Same here?

      Sergio Solano

      Done

      Line 45, Patchset 4: for (unsigned i = 0; i < expected_characters.length(); ++i) {
      source.AdvanceAndASSERTIgnoringCase(expected_characters[i]);
      }
      Stephen Nusko . resolved

      This could just be a for each loop right?

      ```
      for (const auto& expected : expected_characters) {
      source.AdvanceAndASSERTIgnoringCase(expected);
      }
      ```
      Sergio Solano

      Done

      File third_party/blink/renderer/core/style/style_variables.h
      Line 273, Patchset 4 (Parent): // It is legal to copy Member<> with memcpy() here, since we are in a
      // constructor. (We could use an initializer, but Clang doesn't
      // manage to combine the loads and stores into larger parts.)
      UNSAFE_TODO(memcpy(&values_, &other.values_, sizeof(values_)));
      UNSAFE_TODO(memcpy(&children_, &other.children_, sizeof(children_)));
      Stephen Nusko . resolved

      This comment is very clear that this is heavily optimized code.

      blink code should be spanified with extreme care.

      Can you do some due diligence here and

      1) check that speedometer3/jetstream2 doesn't experience a regression
      2) Look for any micro benchmarks around this css parser?
      3) That if you look for the assembly code in particular here it generates similar optimized code similar or better than before?

      If we can't do 3) we should perhaps leave this until an expert with the skill to do so has a chance to look.

      Stephen Nusko

      And I see you already did speedometer 😄

      https://pinpoint-dot-chromeperf.appspot.com/job/1023ec81b10000

      But can you run it on mac-m1_mini_2020-perf with 150 tries (it should default) as described here: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/benchmark_performance_regressions.md

      Sergio Solano

      I'm postponing this file to compare the original vs. proposed assembly.

      File third_party/blink/renderer/core/svg/animation/svg_smil_element.cc
      Line 85, Patchset 4: // SAFETY: The loop iterates over a WTF::Vector within the bounds of the

      // container, from a valid iterator to the end.
      Stephen Nusko . resolved

      a WTF::Vector is not hardened I don't think we should promote this to UNSAFE_BUFFERS leave as UNSAFE_TODO, we can't meaningfully verify the bounds here by any API promise.

      Sergio Solano

      Done

      Line 903, Patchset 4: search_start != begin_times_.end(); UNSAFE_BUFFERS(++search_start)) {
      Stephen Nusko . resolved

      Same here (SMILInstanceTimeList is just a blink::Vector)

      Sergio Solano

      Done

      File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
      Line 1280, Patchset 4: char buffer[1024];

      // SAFETY: vsnprintf ensures not to write more than 1024 bytes.
      UNSAFE_BUFFERS(vsnprintf(buffer, sizeof(buffer), message, args));
      Stephen Nusko . resolved

      Can we use `base::SafeSPrintf`?

      Sergio Solano

      First i discarded `base::SafeSPrintf` beacause it is a C++ variadic function and it cannot handle va_list. (Is my understanding correct?)

      Then i tried with `base::StringPrintV` which worked wrapped in UNSAFE_BUFFERS but raised presubmit error: `.../xml_document_parser.cc:1503 uses disallowed identifier base::StringPrintV`.

      I found file `third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py`, StringPrintv and SafeSPrintf are not listed there, I assume both will fail with `disallowed identifier`.

      I think this is the best option. Is the UNSAFE_BUFFERS justified here? I think so because GetError is only called from within InitializeParserContext.

      Line 1497, Patchset 4: // `GetError` is safe as it immediately converts the arguments into a

      // `std::string` using `base::StringPrintV`.
      UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning,
      message, args));
      Stephen Nusko . resolved

      I don't understand what is the buffers usage here we are suppressing? This just looks like we are reinterpreting casting and calling a function on the result? Can you let me know the error? looks like we shouldn't need a UNSAFE_BUFFERS?

      Sergio Solano

      Done

      Line 1511, Patchset 4: UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal,
      Stephen Nusko . resolved

      Same here?

      Sergio Solano

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Stephen Nusko
      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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
        Gerrit-Change-Number: 7281269
        Gerrit-PatchSet: 7
        Gerrit-Owner: Sergio Solano <sergio...@google.com>
        Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Fredrik Söderquist <f...@opera.com>
        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
        Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
        Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
        Gerrit-Comment-Date: Fri, 20 Feb 2026 20:57:21 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Stephen Nusko (Gerrit)

        unread,
        Feb 23, 2026, 11:03:55 PMFeb 23
        to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
        Attention needed from Sergio Solano

        Stephen Nusko added 5 comments

        File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
        Line 51, Patchset 7 (Latest): base::span<const LChar> ptr =
        Stephen Nusko . unresolved

        nit: ptr isn't a good name anymore. `chars`?

        Line 54, Patchset 7 (Latest): for (unsigned i = 1; i < end - start; ++i) {
        Stephen Nusko . unresolved

        nit: `ptr.size()`

        File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
        Line 1280, Patchset 4: char buffer[1024];
        // SAFETY: vsnprintf ensures not to write more than 1024 bytes.
        UNSAFE_BUFFERS(vsnprintf(buffer, sizeof(buffer), message, args));
        Stephen Nusko . unresolved

        Can we use `base::SafeSPrintf`?

        Sergio Solano

        First i discarded `base::SafeSPrintf` beacause it is a C++ variadic function and it cannot handle va_list. (Is my understanding correct?)

        Then i tried with `base::StringPrintV` which worked wrapped in UNSAFE_BUFFERS but raised presubmit error: `.../xml_document_parser.cc:1503 uses disallowed identifier base::StringPrintV`.

        I found file `third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py`, StringPrintv and SafeSPrintf are not listed there, I assume both will fail with `disallowed identifier`.

        I think this is the best option. Is the UNSAFE_BUFFERS justified here? I think so because GetError is only called from within InitializeParserContext.

        Line 1283, Patchset 4: std::string formatted_message = buffer;
        Stephen Nusko . unresolved

        This is a no-go, this is creating a copy of the buffer where no copy existed before. Why do you need this?

        Likely what you wanted is `base::as_string_view(buffer)`?, but we don't really use it as a span so probably just `&buffer[0]` is fine?

        Line 1497, Patchset 4: // `GetError` is safe as it immediately converts the arguments into a
        // `std::string` using `base::StringPrintV`.
        UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning,
        message, args));
        Stephen Nusko . unresolved

        I don't understand what is the buffers usage here we are suppressing? This just looks like we are reinterpreting casting and calling a function on the result? Can you let me know the error? looks like we shouldn't need a UNSAFE_BUFFERS?

        Sergio Solano

        Done

        Stephen Nusko

        Sorry what is done? I still don't understand what this is wrapping since GetError is not UNSAFE_BUFFER_USAGE function, if it was then that makes sense but we should speak to how we ensure the invariants.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Sergio Solano
        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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
          Gerrit-Change-Number: 7281269
          Gerrit-PatchSet: 7
          Gerrit-Owner: Sergio Solano <sergio...@google.com>
          Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Fredrik Söderquist <f...@opera.com>
          Gerrit-CC: Menard, Alexis <alexis...@intel.com>
          Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
          Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-Attention: Sergio Solano <sergio...@google.com>
          Gerrit-Comment-Date: Tue, 24 Feb 2026 04:03:31 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: No
          Comment-In-Reply-To: Stephen Nusko <nus...@chromium.org>
          Comment-In-Reply-To: Sergio Solano <sergio...@google.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Sergio Solano (Gerrit)

          unread,
          Feb 24, 2026, 4:19:31 PMFeb 24
          to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
          Attention needed from Stephen Nusko

          Sergio Solano voted and added 5 comments

          Votes added by Sergio Solano

          Commit-Queue+1

          5 comments

          File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
          Line 51, Patchset 7: base::span<const LChar> ptr =
          Stephen Nusko . resolved

          nit: ptr isn't a good name anymore. `chars`?

          Sergio Solano

          Done

          Line 54, Patchset 7: for (unsigned i = 1; i < end - start; ++i) {
          Stephen Nusko . resolved

          nit: `ptr.size()`

          Sergio Solano

          Done

          File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
          Line 1280, Patchset 4: char buffer[1024];
          // SAFETY: vsnprintf ensures not to write more than 1024 bytes.
          UNSAFE_BUFFERS(vsnprintf(buffer, sizeof(buffer), message, args));
          Stephen Nusko . resolved

          Can we use `base::SafeSPrintf`?

          Sergio Solano

          First i discarded `base::SafeSPrintf` beacause it is a C++ variadic function and it cannot handle va_list. (Is my understanding correct?)

          Then i tried with `base::StringPrintV` which worked wrapped in UNSAFE_BUFFERS but raised presubmit error: `.../xml_document_parser.cc:1503 uses disallowed identifier base::StringPrintV`.

          I found file `third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py`, StringPrintv and SafeSPrintf are not listed there, I assume both will fail with `disallowed identifier`.

          I think this is the best option. Is the UNSAFE_BUFFERS justified here? I think so because GetError is only called from within InitializeParserContext.

          Stephen Nusko

          Can we use VSpanPrintf then at least: https://source.chromium.org/chromium/chromium/src/+/main:base/strings/span_printf.h;l=25;drc=542eedeaf4606aec2003451a8365ac5a0269e33e

          Looks like it is already used in blink?: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/text/wtf_string.cc;l=249;drc=9234a13fa1fafcb70e754de57ebd40dcdd092a11

          But also StringPrintV returns a string (which is an allocation, close but not quite what we want).

          Sergio Solano

          When uploading I get: `third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1285 uses disallowed identifier base::VSpanPrintf`

          It only works if I add `"+base/strings/span_printf.h",` to file third_party/blink/renderer/core/xml/DEPS and `'base::VSpanPrintf',
          ` to file third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py. Do you have a different alternative? Seems hard to approve but it also seems safer.

          Line 1283, Patchset 4: std::string formatted_message = buffer;
          Stephen Nusko . resolved

          This is a no-go, this is creating a copy of the buffer where no copy existed before. Why do you need this?

          Likely what you wanted is `base::as_string_view(buffer)`?, but we don't really use it as a span so probably just `&buffer[0]` is fine?

          Sergio Solano

          Done

          Line 1497, Patchset 4: // `GetError` is safe as it immediately converts the arguments into a
          // `std::string` using `base::StringPrintV`.
          UNSAFE_BUFFERS(GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning,
          message, args));
          Stephen Nusko . resolved

          I don't understand what is the buffers usage here we are suppressing? This just looks like we are reinterpreting casting and calling a function on the result? Can you let me know the error? looks like we shouldn't need a UNSAFE_BUFFERS?

          Sergio Solano

          Done

          Stephen Nusko

          Sorry what is done? I still don't understand what this is wrapping since GetError is not UNSAFE_BUFFER_USAGE function, if it was then that makes sense but we should speak to how we ensure the invariants.

          Sergio Solano
          Sorry, this are the errors without UNSAFE_BUFEERS: 
          ```stderr:
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1498:3: error: formatting function 'GetError' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call]
          1498 | GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning, message, args);
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1498:3: note: See //docs/unsafe_buffers.md for help.
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1498:62: error: string argument is not guaranteed to be null-terminated
          1498 | GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning, message, args);
          | ^~~~~~~
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1498:62: note: See //docs/unsafe_buffers.md for help.
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1506:3: error: formatting function 'GetError' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call]
          1506 | GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal, message, args);
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1506:3: note: See //docs/unsafe_buffers.md for help.
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1506:63: error: string argument is not guaranteed to be null-terminated
          1506 | GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal, message, args);
          | ^~~~~~~
          ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1506:63: note: See //docs/unsafe_buffers.md for help.
          4 errors generated.

          build failed```

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Stephen Nusko
          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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
            Gerrit-Change-Number: 7281269
            Gerrit-PatchSet: 8
            Gerrit-Owner: Sergio Solano <sergio...@google.com>
            Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
            Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
            Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
            Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
            Gerrit-CC: Fredrik Söderquist <f...@opera.com>
            Gerrit-CC: Menard, Alexis <alexis...@intel.com>
            Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
            Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
            Gerrit-CC: Stephen Chenney <sche...@chromium.org>
            Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
            Gerrit-Comment-Date: Tue, 24 Feb 2026 21:19:24 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: Yes
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Stephen Nusko (Gerrit)

            unread,
            Feb 24, 2026, 10:16:11 PMFeb 24
            to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
            Attention needed from Sergio Solano

            Stephen Nusko added 3 comments

            File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
            Line 1280, Patchset 4: char buffer[1024];
            // SAFETY: vsnprintf ensures not to write more than 1024 bytes.
            UNSAFE_BUFFERS(vsnprintf(buffer, sizeof(buffer), message, args));
            Stephen Nusko . resolved

            Can we use `base::SafeSPrintf`?

            Sergio Solano

            First i discarded `base::SafeSPrintf` beacause it is a C++ variadic function and it cannot handle va_list. (Is my understanding correct?)

            Then i tried with `base::StringPrintV` which worked wrapped in UNSAFE_BUFFERS but raised presubmit error: `.../xml_document_parser.cc:1503 uses disallowed identifier base::StringPrintV`.

            I found file `third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py`, StringPrintv and SafeSPrintf are not listed there, I assume both will fail with `disallowed identifier`.

            I think this is the best option. Is the UNSAFE_BUFFERS justified here? I think so because GetError is only called from within InitializeParserContext.

            Stephen Nusko

            Can we use VSpanPrintf then at least: https://source.chromium.org/chromium/chromium/src/+/main:base/strings/span_printf.h;l=25;drc=542eedeaf4606aec2003451a8365ac5a0269e33e

            Looks like it is already used in blink?: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/wtf/text/wtf_string.cc;l=249;drc=9234a13fa1fafcb70e754de57ebd40dcdd092a11

            But also StringPrintV returns a string (which is an allocation, close but not quite what we want).

            Sergio Solano

            When uploading I get: `third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1285 uses disallowed identifier base::VSpanPrintf`

            It only works if I add `"+base/strings/span_printf.h",` to file third_party/blink/renderer/core/xml/DEPS and `'base::VSpanPrintf',
            ` to file third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py. Do you have a different alternative? Seems hard to approve but it also seems safer.

            Stephen Nusko

            I think the correct way would be in [third_party/blink/renderer/core/DEPS](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/DEPS;l=16;drc=d7e6a942b1eaa978ab30fc4b7cec7587862864b7) right beside `"+base/strings/stringprintf.h"` add a `+base/strings/span_printf.h`

            And then probably add it to the allowed for every directory in core, but you are right we should probably do this as a follow up. Thanks for investigating, we can send a follow up and ask blink owners if they want to allow this span wrapped function and do a round of updates to show usage, but lets leave it as is.

            Stephen Nusko

            Okay thank you for updating the safety comment it now makes sense, before it sounded like we were saying the conversion made it safe, but it does not because if it isn't null terminated the conversion with trigger an OOB.

            Does libxml have an API doc we can link to? I couldn't find one so I guess not...

            File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
            Line 189, Patchset 8 (Latest): 'base::VSpanPrintf',
            Stephen Nusko . unresolved

            Don't need to add it twice.

            (but as discussed lets remove it for now.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Sergio Solano
            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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
              Gerrit-Change-Number: 7281269
              Gerrit-PatchSet: 8
              Gerrit-Owner: Sergio Solano <sergio...@google.com>
              Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
              Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
              Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
              Gerrit-CC: Fredrik Söderquist <f...@opera.com>
              Gerrit-CC: Menard, Alexis <alexis...@intel.com>
              Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
              Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
              Gerrit-Attention: Sergio Solano <sergio...@google.com>
              Gerrit-Comment-Date: Wed, 25 Feb 2026 03:15:48 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Sergio Solano (Gerrit)

              unread,
              Feb 25, 2026, 5:28:22 PM (14 days ago) Feb 25
              to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
              Attention needed from Stephen Nusko

              Sergio Solano voted and added 1 comment

              Votes added by Sergio Solano

              Commit-Queue+1

              1 comment

              File third_party/blink/tools/blinkpy/presubmit/audit_non_blink_usage.py
              Line 189, Patchset 8: 'base::VSpanPrintf',
              Stephen Nusko . resolved

              Don't need to add it twice.

              (but as discussed lets remove it for now.

              Sergio Solano

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Stephen Nusko
              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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                Gerrit-Change-Number: 7281269
                Gerrit-PatchSet: 9
                Gerrit-Owner: Sergio Solano <sergio...@google.com>
                Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
                Gerrit-Comment-Date: Wed, 25 Feb 2026 22:28:17 +0000
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy

                Stephen Nusko (Gerrit)

                unread,
                Feb 25, 2026, 9:14:39 PM (14 days ago) Feb 25
                to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                Attention needed from Sergio Solano

                Stephen Nusko added 5 comments

                Patchset-level comments
                File-level comment, Patchset 9 (Latest):
                Stephen Nusko . unresolved

                As a final check can you run some of the microbenchmarks

                third_party/blink/renderer/core/css/style_perftest.cc

                and

                third_party/blink/renderer/core/css/parser/css_parser_fast_paths_perftest.cc

                ?

                And see the results?

                File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
                Line 53, Patchset 9 (Latest): double result = chars[0] - '0';
                for (unsigned i = 1; i < chars.size(); ++i) {
                result = result * 10 + (chars[i] - '0');
                }
                Stephen Nusko . unresolved

                could this be a range based for?

                ```
                double result = 0;
                for (char c : chars) {
                result = result * 10 + (c - '0');
                }
                ```

                On the first iteration `result == zero` so `result * 10` cancels out and is the same as the original `result = chars[0] - '-';`, and then for the rest it is exactly the same?

                File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
                Line 1282, Patchset 9 (Latest): // SAFETY: message and args are provided by libxml and VSpanPrintf ensures not
                // to write more than 1024 bytes.
                Stephen Nusko . unresolved

                VSpanPrintf isn't marked as an unsafe function is it? Do we need the UNSAFE_BUFFERS? or is it because it is a format printing function?

                Stephen Nusko

                Should we leave it as UNSAFE_TODO if there isn't one.

                Line 1499, Patchset 9 (Latest): // to be null-terminated. However, the compiler triggers
                // -Wunsafe-buffer-usage without the UNSAFE_BUFFERS macro.
                Stephen Nusko . unresolved

                nit: don't need this part, we just need to explain why GetError is safe.

                I.E. GetError is unsafe if |message| or any values in |args| are not null terminated. But `message` is provided by libxml...

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Sergio Solano
                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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                  Gerrit-Change-Number: 7281269
                  Gerrit-PatchSet: 9
                  Gerrit-Owner: Sergio Solano <sergio...@google.com>
                  Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                  Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                  Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                  Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                  Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                  Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                  Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                  Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                  Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                  Gerrit-Attention: Sergio Solano <sergio...@google.com>
                  Gerrit-Comment-Date: Thu, 26 Feb 2026 02:14:09 +0000
                  satisfied_requirement
                  unsatisfied_requirement
                  open
                  diffy

                  Sergio Solano (Gerrit)

                  unread,
                  Mar 7, 2026, 8:21:14 PM (4 days ago) Mar 7
                  to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                  Attention needed from Stephen Nusko

                  Sergio Solano voted and added 5 comments

                  Votes added by Sergio Solano

                  Commit-Queue+1

                  5 comments

                  Patchset-level comments
                  File-level comment, Patchset 9:
                  Stephen Nusko . resolved

                  As a final check can you run some of the microbenchmarks

                  third_party/blink/renderer/core/css/style_perftest.cc

                  and

                  third_party/blink/renderer/core/css/parser/css_parser_fast_paths_perftest.cc

                  ?

                  And see the results?

                  Sergio Solano

                  StyleCalcPerfTest
                  ```
                  RUN, avg_diff (ms), avg_baseline (ms), diff_percentage
                  .Alexa1000, -0.07, 106.83, -0.06%
                  .ECommerce, -0.17, 97.03, -0.17%
                  .Encyclopedia, -10.63, 728.37, -1.46%
                  .Extension, 0.20, 438.60, 0.05%
                  .News, -0.83, 172.20, -0.48%
                  .Search, 0.07, 111.47, 0.06%
                  .Social1, -0.23, 145.10, -0.16%
                  .Social2, 0.13, 63.67, 0.21%
                  .Sports, 1.93, 311.43, 0.62%
                  .Video, 2.20, 226.40, 0.97%
                  ```

                  StyleFastPathPerfTest
                  ```
                  RUN, avg_diff (ms), avg_baseline (ms), diff_percentage
                  .MotionMarkMultiply, -0.60, 360.40, -0.17%
                  ```

                  File-level comment, Patchset 10 (Latest):
                  Sergio Solano . resolved

                  Hi Stephen, I've added the results of the microbenchmarks. The results are the average of 30 runs.

                  File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
                  Line 53, Patchset 9: double result = chars[0] - '0';

                  for (unsigned i = 1; i < chars.size(); ++i) {
                  result = result * 10 + (chars[i] - '0');
                  }
                  Stephen Nusko . resolved

                  could this be a range based for?

                  ```
                  double result = 0;
                  for (char c : chars) {
                  result = result * 10 + (c - '0');
                  }
                  ```

                  On the first iteration `result == zero` so `result * 10` cancels out and is the same as the original `result = chars[0] - '-';`, and then for the rest it is exactly the same?

                  Sergio Solano

                  Done

                  File third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
                  Line 1282, Patchset 9: // SAFETY: message and args are provided by libxml and VSpanPrintf ensures not

                  // to write more than 1024 bytes.
                  Stephen Nusko . resolved

                  VSpanPrintf isn't marked as an unsafe function is it? Do we need the UNSAFE_BUFFERS? or is it because it is a format printing function?

                  Sergio Solano

                  Kind of, to get it to work without presubmit warninig I edited file third_party/blink/renderer/core/xml/DEPS. That is a way of marking it unsafe, isn't it?

                  Without the UNSAFE_BUFFERS I get ```stderr:
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1284:3: error: formatting function 'VSpanPrintf' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call]
                  1284 | base::VSpanPrintf(base::span(formatted_message), message, args);
                  | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1284:3: note: See //docs/unsafe_buffers.md for help.
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1284:52: error: string argument is not guaranteed to be null-terminated
                  1284 | base::VSpanPrintf(base::span(formatted_message), message, args);
                  | ^~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1284:52: note: See //docs/unsafe_buffers.md for help.
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1499:3: error: formatting function 'GetError' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call]
                  1499 | GetParser(closure)->GetError(XMLErrors::kErrorTypeWarning,
                  | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  1500 | message, args);
                  | ~~~~~~~~~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1499:3: note: See //docs/unsafe_buffers.md for help.
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1500:32: error: string argument is not guaranteed to be null-terminated
                  1500 | message, args);
                  | ^~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1500:32: note: See //docs/unsafe_buffers.md for help.
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1510:3: error: formatting function 'GetError' is unsafe [-Werror,-Wunsafe-buffer-usage-in-format-attr-call]
                  1510 | GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal, message, args);
                  | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1510:3: note: See //docs/unsafe_buffers.md for help.
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1510:63: error: string argument is not guaranteed to be null-terminated
                  1510 | GetParser(closure)->GetError(XMLErrors::kErrorTypeNonFatal, message, args);
                  | ^~~~~~~
                  ../../third_party/blink/renderer/core/xml/parser/xml_document_parser.cc:1510:63: note: See //docs/unsafe_buffers.md for help.
                  6 errors generated.

                  build failed```

                  About docs that backup that UNSAFE_BUFFERS is needed i found: https://clang.llvm.org/docs/DiagnosticsReference.html. Gemini tells me it's related to VSpanPrintf being print and va_list related, but I could not found manuals/docs.

                  Line 1499, Patchset 9: // to be null-terminated. However, the compiler triggers

                  // -Wunsafe-buffer-usage without the UNSAFE_BUFFERS macro.
                  Stephen Nusko . resolved

                  nit: don't need this part, we just need to explain why GetError is safe.

                  I.E. GetError is unsafe if |message| or any values in |args| are not null terminated. But `message` is provided by libxml...

                  Sergio Solano

                  Done

                  Open in Gerrit

                  Related details

                  Attention is currently required from:
                  • Stephen Nusko
                  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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                    Gerrit-Change-Number: 7281269
                    Gerrit-PatchSet: 10
                    Gerrit-Owner: Sergio Solano <sergio...@google.com>
                    Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                    Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                    Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                    Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                    Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
                    Gerrit-Comment-Date: Sun, 08 Mar 2026 01:21:05 +0000
                    satisfied_requirement
                    unsatisfied_requirement
                    open
                    diffy

                    Stephen Nusko (Gerrit)

                    unread,
                    Mar 9, 2026, 5:09:33 AM (2 days ago) Mar 9
                    to Sergio Solano, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                    Attention needed from Sergio Solano

                    Stephen Nusko added 4 comments

                    Patchset-level comments
                    File-level comment, Patchset 9:
                    Stephen Nusko . unresolved

                    As a final check can you run some of the microbenchmarks

                    third_party/blink/renderer/core/css/style_perftest.cc

                    and

                    third_party/blink/renderer/core/css/parser/css_parser_fast_paths_perftest.cc

                    ?

                    And see the results?

                    Sergio Solano

                    StyleCalcPerfTest
                    ```
                    RUN, avg_diff (ms), avg_baseline (ms), diff_percentage
                    .Alexa1000, -0.07, 106.83, -0.06%
                    .ECommerce, -0.17, 97.03, -0.17%
                    .Encyclopedia, -10.63, 728.37, -1.46%
                    .Extension, 0.20, 438.60, 0.05%
                    .News, -0.83, 172.20, -0.48%
                    .Search, 0.07, 111.47, 0.06%
                    .Social1, -0.23, 145.10, -0.16%
                    .Social2, 0.13, 63.67, 0.21%
                    .Sports, 1.93, 311.43, 0.62%
                    .Video, 2.20, 226.40, 0.97%
                    ```

                    StyleFastPathPerfTest
                    ```
                    RUN, avg_diff (ms), avg_baseline (ms), diff_percentage
                    .MotionMarkMultiply, -0.60, 360.40, -0.17%
                    ```

                    Stephen Nusko

                    Just to make sure

                    baseline is HEAD and diff_percentage is `(current_cl_results - HEAD_results)/HEAD_results` I.E. the relative difference?

                    Can you give me a feel for what the std is? I'm trying to understand if the .97% and .62% regressions in `Sports` and `Video` are "real" or if everything is basically zero?

                    They look like they are about 2ms slower which might be within the noise for something that takes 226ms in the baseline, but it might also be detectable if it is a very stable test.

                    File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.h
                    Line 86, Patchset 10 (Latest): while ((offset_ + offset) < string_length_ &&
                    Stephen Nusko . unresolved

                    I also wonder if you rewrite these to be range based for if the optimizer would do a better job here (I.E.

                    ```
                    for (const LChar& lchar : string_.Span8().subspan(offset_)) {
                    if (!characterPredicate(lchar)) {
                    break;
                    }
                    ++offset;
                    }
                    ```
                    Line 85, Patchset 10 (Latest): base::span<const LChar> characters8 = string_.Span8();
                    Stephen Nusko . unresolved

                    Should we `subspan(offset_)` to avoid having to do the math repeatedly?

                    ```suggestion
                    base::span<const LChar> characters8 = string_.Span8().subspan(offset_);
                    ```

                    Then remove offset_ from all the math below.

                    File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
                    Line 17, Patchset 10 (Latest): base::span<const LChar> characters = string_.Span8();
                    Stephen Nusko . unresolved

                    Similar questions about these while loops.

                    Open in Gerrit

                    Related details

                    Attention is currently required from:
                    • Sergio Solano
                    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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                      Gerrit-Change-Number: 7281269
                      Gerrit-PatchSet: 10
                      Gerrit-Owner: Sergio Solano <sergio...@google.com>
                      Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                      Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                      Gerrit-Attention: Sergio Solano <sergio...@google.com>
                      Gerrit-Comment-Date: Mon, 09 Mar 2026 09:09:06 +0000
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Steinar H Gunderson (Gerrit)

                      unread,
                      8:41 AM (4 hours ago) 8:41 AM
                      to Sergio Solano, Stephen Nusko, chrom...@appspot.gserviceaccount.com, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                      Attention needed from Sergio Solano

                      Steinar H Gunderson added 1 comment

                      Patchset-level comments
                      Steinar H Gunderson

                      compare_blink_perf.cc tells you how to run and make a report out of these (with confidence intervals).

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Sergio Solano
                      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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                      Gerrit-Change-Number: 7281269
                      Gerrit-PatchSet: 11
                      Gerrit-Owner: Sergio Solano <sergio...@google.com>
                      Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                      Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                      Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                      Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                      Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                      Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                      Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                      Gerrit-Attention: Sergio Solano <sergio...@google.com>
                      Gerrit-Comment-Date: Wed, 11 Mar 2026 12:40:55 +0000
                      satisfied_requirement
                      unsatisfied_requirement
                      open
                      diffy

                      Sergio Solano (Gerrit)

                      unread,
                      11:46 AM (1 hour ago) 11:46 AM
                      to Stephen Nusko, chrom...@appspot.gserviceaccount.com, Steinar H Gunderson, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                      Attention needed from Steinar H Gunderson and Stephen Nusko

                      Sergio Solano voted and added 5 comments

                      Votes added by Sergio Solano

                      Auto-Submit+1
                      Commit-Queue+1

                      5 comments

                      Patchset-level comments
                      File-level comment, Patchset 9:
                      Stephen Nusko . resolved
                      Sergio Solano

                      Hi Stephen, I've calculated the std across 30 runs to check for regressions.

                      For Video, the difference is +0.43ms but the std is 8.05ms.
                      For Sports, the difference is -4.3ms with a std of 9.77ms.
                      Only for MotionMarkMultiply the difference (+3.97ms) approaches the standard deviation (4.68ms), but it is still less than 1 std.

                      In all cases, the difference between MAIN and CL is less than one standard deviation. This indicates the results are within the noise floor of the test environment and do not represent a real regression.

                      ```
                      mean std
                      branch cl main cl main
                      test
                      StyleCalcPerfTest.Alexa1000 110.200000 109.566667 2.496895 3.339248
                      StyleCalcPerfTest.ECommerce 99.433333 99.133333 2.555364 2.473770
                      StyleCalcPerfTest.Encyclopedia 723.600000 733.333333 11.906533 11.043280
                      StyleCalcPerfTest.Extension 448.200000 450.933333 9.939125 13.970248
                      StyleCalcPerfTest.News 174.900000 178.133333 3.862731 5.829375
                      StyleCalcPerfTest.Search 117.233333 119.433333 6.404111 6.709146
                      StyleCalcPerfTest.Social1 148.800000 150.433333 2.187740 3.616851
                      StyleCalcPerfTest.Social2 64.900000 65.733333 1.422722 2.242741
                      StyleCalcPerfTest.Sports 319.700000 324.000000 9.979807 9.773292
                      StyleCalcPerfTest.Video 235.300000 234.866667 8.971795 8.046131
                      StyleFastPathPerfTest.MotionMarkMultiply 363.400000 359.433333 3.558380 4.680726```
                      File-level comment, Patchset 11 (Latest):
                      Sergio Solano . resolved

                      Hi, Stephen. I've added the std and applied your suggestions.

                      File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.h
                      Line 86, Patchset 10: while ((offset_ + offset) < string_length_ &&
                      Stephen Nusko . resolved

                      I also wonder if you rewrite these to be range based for if the optimizer would do a better job here (I.E.

                      ```
                      for (const LChar& lchar : string_.Span8().subspan(offset_)) {
                      if (!characterPredicate(lchar)) {
                      break;
                      }
                      ++offset;
                      }
                      ```
                      Sergio Solano

                      Done

                      Line 85, Patchset 10: base::span<const LChar> characters8 = string_.Span8();
                      Stephen Nusko . resolved

                      Should we `subspan(offset_)` to avoid having to do the math repeatedly?

                      ```suggestion
                      base::span<const LChar> characters8 = string_.Span8().subspan(offset_);
                      ```

                      Then remove offset_ from all the math below.

                      Sergio Solano

                      Done

                      File third_party/blink/renderer/core/css/parser/css_tokenizer_input_stream.cc
                      Line 17, Patchset 10: base::span<const LChar> characters = string_.Span8();
                      Stephen Nusko . resolved

                      Similar questions about these while loops.

                      Sergio Solano

                      Done

                      Open in Gerrit

                      Related details

                      Attention is currently required from:
                      • Steinar H Gunderson
                      • Stephen Nusko
                      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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                        Gerrit-Change-Number: 7281269
                        Gerrit-PatchSet: 11
                        Gerrit-Owner: Sergio Solano <sergio...@google.com>
                        Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                        Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                        Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                        Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                        Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                        Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                        Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                        Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
                        Gerrit-Attention: Steinar H Gunderson <se...@chromium.org>
                        Gerrit-Comment-Date: Wed, 11 Mar 2026 15:46:11 +0000
                        Gerrit-HasComments: Yes
                        Gerrit-Has-Labels: Yes
                        satisfied_requirement
                        unsatisfied_requirement
                        open
                        diffy

                        Steinar H Gunderson (Gerrit)

                        unread,
                        12:02 PM (1 hour ago) 12:02 PM
                        to Sergio Solano, Stephen Nusko, chrom...@appspot.gserviceaccount.com, AI Code Reviewer, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Dirk Schulze, Fredrik Söderquist, Olga Gerchikov, Stephen Chenney, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dom+...@chromium.org, dominicc+...@chromium.org, fmalit...@chromium.org, hiroshig...@chromium.org, kinuko...@chromium.org, kouhei...@chromium.org, kouhe...@chromium.org, loading-rev...@chromium.org, pdr+svgw...@chromium.org
                        Attention needed from Sergio Solano and Stephen Nusko

                        Steinar H Gunderson added 1 comment

                        Patchset-level comments
                        File-level comment, Patchset 9:
                        Stephen Nusko . unresolved
                        Steinar H Gunderson

                        Please again see and use compare_blink_perf.cc, not a home-grown z-test.

                        Open in Gerrit

                        Related details

                        Attention is currently required from:
                        • Sergio Solano
                        • Stephen Nusko
                        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: I0219f3b90126dfdf20b16dbc73cf2cb240166e86
                          Gerrit-Change-Number: 7281269
                          Gerrit-PatchSet: 11
                          Gerrit-Owner: Sergio Solano <sergio...@google.com>
                          Gerrit-Reviewer: Sergio Solano <sergio...@google.com>
                          Gerrit-Reviewer: Stephen Nusko <nus...@chromium.org>
                          Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
                          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                          Gerrit-CC: Fredrik Söderquist <f...@opera.com>
                          Gerrit-CC: Menard, Alexis <alexis...@intel.com>
                          Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
                          Gerrit-CC: Steinar H Gunderson <se...@chromium.org>
                          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                          Gerrit-Attention: Stephen Nusko <nus...@chromium.org>
                          Gerrit-Attention: Sergio Solano <sergio...@google.com>
                          Gerrit-Comment-Date: Wed, 11 Mar 2026 16:02:16 +0000
                          Gerrit-HasComments: Yes
                          Gerrit-Has-Labels: No
                          satisfied_requirement
                          unsatisfied_requirement
                          open
                          diffy
                          Reply all
                          Reply to author
                          Forward
                          0 new messages