Remove special text node behavior from streaming sanitizer [chromium/src : main]

0 views
Skip to first unread message

Noam Rosenthal (Gerrit)

unread,
Apr 28, 2026, 7:06:20 AM (yesterday) Apr 28
to Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Daniel Vogelheim

Noam Rosenthal added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Vogelheim
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: I676bb55da63d23d2be65b1fa452728b8eda9f16d
Gerrit-Change-Number: 7762013
Gerrit-PatchSet: 4
Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
Gerrit-Attention: Daniel Vogelheim <voge...@chromium.org>
Gerrit-Comment-Date: Tue, 28 Apr 2026 11:06:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Vogelheim (Gerrit)

unread,
9:29 AM (7 hours ago) 9:29 AM
to Noam Rosenthal, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
Attention needed from Noam Rosenthal

Daniel Vogelheim voted and added 5 comments

Votes added by Daniel Vogelheim

Code-Review+1

5 comments

Patchset-level comments
Daniel Vogelheim . resolved

Looks good.

I'm a little annoyed by the formatting changes; although I have to concede you're technically in the right there... :)

File third_party/blink/renderer/core/dom/document.cc
Line 10171, Patchset 4 (Latest): doc->setSanitizer(sanitizer);
doc->SetContent(html);
doc->SetMimeType(keywords::kTextHtml);
if (sanitizer) {
sanitizer->DidParseDocument(doc);
}
Daniel Vogelheim . unresolved

[maybe] I find this construction with setting a Document member odd... I wonder if it'd be easier to instead have a second parameter to SetContent (i.e., `doc->SetContent(html, sanitizer)`).

Is Document::sanitizer_ used for other purposes I may be overlooking right now? Is it still useful after this method has finished, or should it be cleared?

File third_party/blink/renderer/core/html/parser/html_tree_builder.cc
Line 330, Patchset 4 (Latest): if (++current_ == end_) {
Daniel Vogelheim . unresolved

It seems nearly all changes in this file, other than the constructor changes in lines 372..383 are trivial formating changes that have nothing to do with the remainder of this CL and make it cumbersome to review. Could we revert those?

(There's a few more instances in other files.)

(I think technically, the style guide is on your side here as the style guide now wants any conditional to have braces. On the other hand, I don't think we usually like this type of churn.)

File third_party/blink/renderer/core/sanitizer/sanitizer.h
Line 182, Patchset 4 (Latest): StreamingSanitizer(Sanitizer* sanitizer, Sanitizer::Mode mode)
Daniel Vogelheim . resolved

I like this simplification.

I do think at this point the StreamingSanitizer is just a wrapper around Sanitizer.

File third_party/blink/renderer/core/sanitizer/sanitizer.cc
Line 1301, Patchset 4 (Latest):void StreamingSanitizer::DidParseDocument(Document* document) {
Daniel Vogelheim . resolved

I wonder whether this can replace the special treatment in https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/sanitizer/sanitizer_api.cc;l=51-57

(Although... I think the current impl is very close to the current spec, which is useful on its own.)

Open in Gerrit

Related details

Attention is currently required from:
  • Noam Rosenthal
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
    Gerrit-Change-Number: 7762013
    Gerrit-PatchSet: 4
    Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
    Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
    Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
    Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
    Gerrit-Comment-Date: Wed, 29 Apr 2026 13:29:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Noam Rosenthal (Gerrit)

    unread,
    10:33 AM (6 hours ago) 10:33 AM
    to Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

    Noam Rosenthal added 2 comments

    File third_party/blink/renderer/core/dom/document.cc
    Line 10171, Patchset 4: doc->setSanitizer(sanitizer);

    doc->SetContent(html);
    doc->SetMimeType(keywords::kTextHtml);
    if (sanitizer) {
    sanitizer->DidParseDocument(doc);
    }
    Daniel Vogelheim . resolved

    [maybe] I find this construction with setting a Document member odd... I wonder if it'd be easier to instead have a second parameter to SetContent (i.e., `doc->SetContent(html, sanitizer)`).

    Is Document::sanitizer_ used for other purposes I may be overlooking right now? Is it still useful after this method has finished, or should it be cleared?

    Noam Rosenthal

    Done

    File third_party/blink/renderer/core/html/parser/html_tree_builder.cc
    Line 330, Patchset 4: if (++current_ == end_) {
    Daniel Vogelheim . resolved

    It seems nearly all changes in this file, other than the constructor changes in lines 372..383 are trivial formating changes that have nothing to do with the remainder of this CL and make it cumbersome to review. Could we revert those?

    (There's a few more instances in other files.)

    (I think technically, the style guide is on your side here as the style guide now wants any conditional to have braces. On the other hand, I don't think we usually like this type of churn.)

    Noam Rosenthal

    Done

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
      Gerrit-Change-Number: 7762013
      Gerrit-PatchSet: 5
      Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
      Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
      Gerrit-Comment-Date: Wed, 29 Apr 2026 14:33:20 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Daniel Vogelheim <voge...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Philip Jägenstedt (Gerrit)

      unread,
      11:34 AM (5 hours ago) 11:34 AM
      to Noam Rosenthal, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
      Attention needed from Noam Rosenthal

      Philip Jägenstedt voted and added 1 comment

      Votes added by Philip Jägenstedt

      Code-Review+1

      1 comment

      File third_party/blink/renderer/core/dom/document.cc
      Line 10219, Patchset 5 (Latest): SanitizerAPI::SanitizeInternal(
      Philip Jägenstedt . unresolved

      Should this path be reachable even after the runtime feature is enabled? Depends on whether `CreateStreamingSanitizer()` can return nullptr, which isn't obvious here at the call site. If not, then add an assert here?

      Same below.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Noam Rosenthal
      Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement satisfiedCode-Owners
      • requirement satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
      Gerrit-Change-Number: 7762013
      Gerrit-PatchSet: 5
      Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
      Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
      Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
      Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
      Gerrit-Attention: Noam Rosenthal <nrose...@google.com>
      Gerrit-Comment-Date: Wed, 29 Apr 2026 15:33:57 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Noam Rosenthal (Gerrit)

      unread,
      11:39 AM (4 hours ago) 11:39 AM
      to Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

      Noam Rosenthal added 1 comment

      File third_party/blink/renderer/core/dom/document.cc
      Line 10219, Patchset 5: SanitizerAPI::SanitizeInternal(
      Philip Jägenstedt . resolved

      Should this path be reachable even after the runtime feature is enabled? Depends on whether `CreateStreamingSanitizer()` can return nullptr, which isn't obvious here at the call site. If not, then add an assert here?

      Same below.

      Noam Rosenthal

      Done

      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
        Gerrit-Change-Number: 7762013
        Gerrit-PatchSet: 5
        Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
        Gerrit-Comment-Date: Wed, 29 Apr 2026 15:38:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Philip Jägenstedt <foo...@chromium.org>
        satisfied_requirement
        open
        diffy

        Noam Rosenthal (Gerrit)

        unread,
        11:39 AM (4 hours ago) 11:39 AM
        to Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

        Noam Rosenthal voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
        Gerrit-Change-Number: 7762013
        Gerrit-PatchSet: 6
        Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
        Gerrit-Comment-Date: Wed, 29 Apr 2026 15:39:07 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Blink W3C Test Autoroller (Gerrit)

        unread,
        11:50 AM (4 hours ago) 11:50 AM
        to Noam Rosenthal, Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

        Message from Blink W3C Test Autoroller

        Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/59541.

        When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.

        WPT Export docs:
        https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
        Gerrit-Change-Number: 7762013
        Gerrit-PatchSet: 6
        Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 29 Apr 2026 15:50:00 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        open
        diffy

        Noam Rosenthal (Gerrit)

        unread,
        1:03 PM (3 hours ago) 1:03 PM
        to Blink W3C Test Autoroller, Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

        Noam Rosenthal voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
        Gerrit-Change-Number: 7762013
        Gerrit-PatchSet: 7
        Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 29 Apr 2026 17:03:36 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Noam Rosenthal (Gerrit)

        unread,
        1:04 PM (3 hours ago) 1:04 PM
        to Blink W3C Test Autoroller, Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

        Noam Rosenthal voted Commit-Queue+1

        Commit-Queue+1
        Gerrit-Comment-Date: Wed, 29 Apr 2026 17:04:36 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Noam Rosenthal (Gerrit)

        unread,
        1:06 PM (3 hours ago) 1:06 PM
        to Blink W3C Test Autoroller, Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org

        Noam Rosenthal voted Commit-Queue+2

        Commit-Queue+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement satisfiedCode-Owners
        • requirement satisfiedCode-Review
        • requirement satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I676bb55da63d23d2be65b1fa452728b8eda9f16d
        Gerrit-Change-Number: 7762013
        Gerrit-PatchSet: 8
        Gerrit-Owner: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Daniel Vogelheim <voge...@chromium.org>
        Gerrit-Reviewer: Noam Rosenthal <nrose...@google.com>
        Gerrit-Reviewer: Philip Jägenstedt <foo...@chromium.org>
        Gerrit-CC: Blink W3C Test Autoroller <blink-w3c-te...@chromium.org>
        Gerrit-Comment-Date: Wed, 29 Apr 2026 17:06:15 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy

        Noam Rosenthal (Gerrit)

        unread,
        2:53 PM (1 hour ago) 2:53 PM
        to Blink W3C Test Autoroller, Philip Jägenstedt, Daniel Vogelheim, android-bu...@system.gserviceaccount.com, Chromium LUCI CQ, chromium...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org, kinuko...@chromium.org, loading-rev...@chromium.org
        Gerrit-Comment-Date: Wed, 29 Apr 2026 18:53:02 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages