[SVG] Add window-reflecting event handlers to SVGSVGElement per SVG2 spec [chromium/src : main]

0 views
Skip to first unread message

Vinay Singh (Gerrit)

unread,
Mar 30, 2026, 3:33:32 PM (3 days ago) Mar 30
to Chromium LUCI CQ, chromium...@chromium.org, Fredrik Söderquist, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org

Vinay Singh voted Commit-Queue+1

Commit-Queue+1
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 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: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
Gerrit-Change-Number: 7665863
Gerrit-PatchSet: 11
Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Comment-Date: Mon, 30 Mar 2026 19:32:52 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Vinay Singh (Gerrit)

unread,
Mar 31, 2026, 3:45:40 AM (2 days ago) Mar 31
to Divyansh Mangal, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Fredrik Söderquist, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
Attention needed from Divyansh Mangal and Virali Purbey

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Virali Purbey
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
Gerrit-Change-Number: 7665863
Gerrit-PatchSet: 13
Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Fredrik Söderquist <f...@opera.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Comment-Date: Tue, 31 Mar 2026 07:45:02 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Divyansh Mangal (Gerrit)

unread,
Mar 31, 2026, 9:03:36 AM (2 days ago) Mar 31
to Vinay Singh, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Fredrik Söderquist, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
Attention needed from Vinay Singh and Virali Purbey

Divyansh Mangal added 22 comments

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Divyansh Mangal . unresolved

Since there are changes to an IDL this will require an I2S as well, please create an entry in the Chrome Status Entry and add the link here or in the description

File-level comment, Patchset 13 (Latest):
Divyansh Mangal . unresolved
WindowEventHandlers mixin includes more than just these 6 events. The CL focuses on the ones that overlap with `GlobalEventHandlers1 (which need explicit shadowing). This is the right prioritization, but a follow-up CL for the remaining WindowEventHandlers
attributes should be tracked.
Commit Message
Line 9, Patchset 13 (Latest):The SVG2 spec requires SVGSVGElement to forward certain event handler
IDL attributes (onblur, onerror, onfocus, onload, onresize, onscroll) to
the window object — matching HTMLBodyElement behavior.

Previously only inline content attributes (e.g., <svg onresize="...">)
were forwarded via ParseAttribute(). The IDL property path
(svgElement.onresize = fn) went through GlobalEventHandlers and set the
listener on the SVG element itself, not the window.

This CL:
- Adds CORE_EXPORT to SVGSVGElement for cross-component visibility
- Adds WindowEventHandlers C++ mixin to SVGSVGElement class
- Shadows the 6 GlobalEventHandlers events that overlap with
window-reflecting behavior (blur, error, focus, load, resize,
scroll) using DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER macros
- Adds explicit IDL attribute overrides for these 6 events
- Extends ParseAttribute to forward onblur, onfocus content
attributes to the window for the outermost <svg> element
- Adds WPT tests for the new behavior
- Updates webexposed test baselines
Divyansh Mangal . unresolved

Consider using quotes(`) for code/element/event to separate them from normal text. There are atleast 15+ such references in this description.

File third_party/blink/renderer/core/svg/svg_svg_element.cc
Line 205, Patchset 13 (Latest): GetExecutionContext(), name, value));
} else if (name == html_names::kOnblurAttr) {
GetDocument().SetWindowAttributeEventListener(
event_type_names::kBlur, JSEventHandlerForContentAttribute::Create(
GetExecutionContext(), name, value));
} else if (name == html_names::kOnfocusAttr) {
GetDocument().SetWindowAttributeEventListener(
event_type_names::kFocus, JSEventHandlerForContentAttribute::Create(
GetExecutionContext(), name, value));
Divyansh Mangal . unresolved

Are you missing some attributes here like `html_names::kOnLoad` ?

File third_party/blink/renderer/core/svg/svg_svg_element.idl
Line 70, Patchset 13 (Latest): // https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSVGElement
Divyansh Mangal . unresolved

nit: link is already given at the top of the interface no need to include it again.

Line 71, Patchset 13 (Latest): attribute EventHandler onblur;
attribute OnErrorEventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler onload;
attribute EventHandler onresize;
attribute EventHandler onscroll;
Divyansh Mangal . unresolved

On that note, I don't see attributes like these on the IDL at all, infact the idl mentions the mixin like this

`SVGSVGElement includes WindowEventHandlers;`

The corresponding html_body_element.idl has them but there is a todo for that as well. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_body_element.idl;drc=e207afe9704990b39825430e89912140cfee2b84;l=35

From my finding Gecko does not support these attributes in their IDL, but they also don't have the mixin `WindowEventHandlers` in their IDL so I am assuming it's not supported there currently.

But their `HTMLBodyElement` IDL does have the mixin without these attributes
https://searchfox.org/firefox-main/source/dom/webidl/HTMLBodyElement.webidl

I think the line `SVGSVGElement includes WindowEventHandlers;` should be added but should the attributes be added like this as you did in this CL?

Line 71, Patchset 13 (Latest): attribute EventHandler onblur;
attribute OnErrorEventHandler onerror;
attribute EventHandler onfocus;
attribute EventHandler onload;
attribute EventHandler onresize;
attribute EventHandler onscroll;
Divyansh Mangal . unresolved

if at all we even need them these should be behind runtime feature flag

`[RuntimeEnabled=]`

File third_party/blink/web_tests/external/wpt/svg/struct/scripted/svg-window-event-handlers.html
Line 3, Patchset 13 (Latest):<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#InterfaceSVGSVGElement">
Divyansh Mangal . unresolved

I think you are missing a test for the `onload` here too.

Line 4, Patchset 13 (Latest):<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Divyansh Mangal . unresolved

You can add an author link like:

`<link rel="author" title="Divyansh Mangal" href="mailto:dma...@microsoft.com">`

Line 6, Patchset 13 (Latest):<div id="log"></div>
Divyansh Mangal . unresolved

is this needed?

Line 37, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 51, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 68, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 72, Patchset 13 (Latest): var handler = function() {};
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 73, Patchset 13 (Latest): var previousHandler = window.onerror;
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 85, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 99, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 115, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 143, Patchset 13 (Latest): var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 147, Patchset 13 (Latest): var handler = function() {};
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

Line 148, Patchset 13 (Latest): var previousHandler = window.onresize;
Divyansh Mangal . unresolved

nit: can this be made `const` or `let`

File third_party/blink/web_tests/svg/custom/svg-window-event-debug.html
Line 1, Patchset 13 (Latest):<!DOCTYPE html>
Divyansh Mangal . unresolved

do we need this custom test at all? doesn't the WPT already covers forwarding a bit better?

Open in Gerrit

Related details

Attention is currently required from:
  • Vinay Singh
  • Virali Purbey
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
    Gerrit-Change-Number: 7665863
    Gerrit-PatchSet: 13
    Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
    Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
    Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
    Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Fredrik Söderquist <f...@opera.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
    Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
    Gerrit-Comment-Date: Tue, 31 Mar 2026 13:03:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Vinay Singh (Gerrit)

    unread,
    Apr 1, 2026, 12:25:21 AM (yesterday) Apr 1
    to Fredrik Söderquist, Divyansh Mangal, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
    Attention needed from Divyansh Mangal, Fredrik Söderquist and Virali Purbey

    Vinay Singh added 22 comments

    Patchset-level comments
    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Agreed, good call. Added a follow-up tracking note in the CL description to track the remaining `WindowEventHandlers` attributes (`onafterprint`, `onbeforeprint`, `onhashchange`, `onmessage`, etc.) in a subsequent CL.

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Acknowledged. Will create a Chrome Status entry for the I2S as a follow-up action item before landing.

    Commit Message
    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Done. Added backtick formatting for all code/element/event references throughout the description.

    File third_party/blink/renderer/core/svg/svg_svg_element.cc
    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Good catch! Added `html_names::kOnloadAttr` forwarding in `ParseAttribute()` for the outermost `<svg>` element, matching `HTMLBodyElement` behavior.

    File third_party/blink/renderer/core/svg/svg_svg_element.idl
    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    The explicit IDL attributes are intentional and necessary here. `SVGElement` includes `GlobalEventHandlers`, which already defines `onblur`, `onerror`, `onfocus`, `onload`, `onresize`, `onscroll` with element-local semantics. Without explicit overrides in the IDL, the inherited `GlobalEventHandlers` versions would be used, setting handlers on the element itself rather than forwarding to the window.

    This is the exact same pattern `HTMLBodyElement` uses (see html_body_element.idl) - it also has explicit attribute overrides for these 6 events alongside `HTMLBodyElement includes WindowEventHandlers;`.

    Adding `SVGSVGElement includes WindowEventHandlers;` alone would only add the *non-overlapping* `WindowEventHandlers` events (`onafterprint`, `onbeforeprint`, etc.) but would NOT handle the shadowing of the 6 `GlobalEventHandlers` events. That mixin line is planned for the follow-up CL.

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Done, removed the duplicate link.

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    `HTMLBodyElement` has the equivalent explicit attributes without a `[RuntimeEnabled]` flag. This implements spec-mandated behavior that has existed for `<body>` since the beginning. Adding a flag here would create an inconsistency with `HTMLBodyElement` and diverge from the spec for no clear benefit. The behavior for content attributes (`<svg onresize='...'>`) already works without a flag - this CL just fixes the IDL property path to match.

    File third_party/blink/web_tests/external/wpt/svg/struct/scripted/svg-window-event-handlers.html
    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Done. Added an `onload` test using property reflection (same approach as the `onerror` test, to avoid interfering with testharness.js).

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Yes, `<div id='log'>` is the standard WPT testharness.js convention for rendering test results. While testharness.js will create one if missing, including it explicitly is the recommended pattern per WPT documentation.

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Done, added author link.

    File-level comment, Patchset 14 (Latest):
    Vinay Singh . resolved

    Done. Changed all `var` declarations to `const` (or `let` where reassignment occurs) throughout the test.

    File third_party/blink/web_tests/svg/custom/svg-window-event-debug.html
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Divyansh Mangal
    • Fredrik Söderquist
    • Virali Purbey
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
      Gerrit-Change-Number: 7665863
      Gerrit-PatchSet: 14
      Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
      Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
      Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Kentaro Hara <har...@chromium.org>
      Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
      Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-Comment-Date: Wed, 01 Apr 2026 04:24:52 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Divyansh Mangal (Gerrit)

      unread,
      Apr 1, 2026, 12:48:51 AM (yesterday) Apr 1
      to Vinay Singh, Fredrik Söderquist, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
      Attention needed from Fredrik Söderquist, Vinay Singh and Virali Purbey

      Divyansh Mangal added 5 comments

      Patchset-level comments
      Vinay Singh . unresolved

      Acknowledged. Will create a Chrome Status entry for the I2S as a follow-up action item before landing.

      Divyansh Mangal

      You can create a Chrome Status entry as a placeholder as well. The details can be filled later, you only need the link here.

      Vinay Singh . unresolved

      Agreed, good call. Added a follow-up tracking note in the CL description to track the remaining `WindowEventHandlers` attributes (`onafterprint`, `onbeforeprint`, `onhashchange`, `onmessage`, etc.) in a subsequent CL.

      Divyansh Mangal

      Please add a TODO for this before closing this.

      Commit Message
      Vinay Singh . unresolved

      Done. Added backtick formatting for all code/element/event references throughout the description.

      Divyansh Mangal

      You say its done, but I still see many references without the backtick (`). Please check again

      File third_party/blink/renderer/core/svg/svg_svg_element.idl
      Vinay Singh . unresolved

      `HTMLBodyElement` has the equivalent explicit attributes without a `[RuntimeEnabled]` flag. This implements spec-mandated behavior that has existed for `<body>` since the beginning. Adding a flag here would create an inconsistency with `HTMLBodyElement` and diverge from the spec for no clear benefit. The behavior for content attributes (`<svg onresize='...'>`) already works without a flag - this CL just fixes the IDL property path to match.

      Divyansh Mangal

      But this is a new API change specific to `SVGSVGElement` we generally start with Runtime feature flag where IDL is getting changed.

      Vinay Singh . unresolved

      The explicit IDL attributes are intentional and necessary here. `SVGElement` includes `GlobalEventHandlers`, which already defines `onblur`, `onerror`, `onfocus`, `onload`, `onresize`, `onscroll` with element-local semantics. Without explicit overrides in the IDL, the inherited `GlobalEventHandlers` versions would be used, setting handlers on the element itself rather than forwarding to the window.

      This is the exact same pattern `HTMLBodyElement` uses (see html_body_element.idl) - it also has explicit attribute overrides for these 6 events alongside `HTMLBodyElement includes WindowEventHandlers;`.

      Adding `SVGSVGElement includes WindowEventHandlers;` alone would only add the *non-overlapping* `WindowEventHandlers` events (`onafterprint`, `onbeforeprint`, etc.) but would NOT handle the shadowing of the 6 `GlobalEventHandlers` events. That mixin line is planned for the follow-up CL.

      Divyansh Mangal

      Please add the TODO before closing this, there is a similar TODO in `HTMLBodyElement` as well

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Fredrik Söderquist
      • Vinay Singh
      • Virali Purbey
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
        Gerrit-Change-Number: 7665863
        Gerrit-PatchSet: 14
        Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
        Gerrit-Comment-Date: Wed, 01 Apr 2026 04:48:14 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Vinay Singh (Gerrit)

        unread,
        Apr 1, 2026, 4:30:54 AM (yesterday) Apr 1
        to Fredrik Söderquist, Divyansh Mangal, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
        Attention needed from Divyansh Mangal, Fredrik Söderquist and Virali Purbey

        New activity on the change

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Divyansh Mangal
        • Fredrik Söderquist
        • Virali Purbey
        Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ibcd2fe6d099630ca63453cce860986d9c8fb80c4
        Gerrit-Change-Number: 7665863
        Gerrit-PatchSet: 15
        Gerrit-Owner: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Reviewer: Virali Purbey <virali...@microsoft.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Kentaro Hara <har...@chromium.org>
        Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
        Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Comment-Date: Wed, 01 Apr 2026 08:30:28 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Fredrik Söderquist (Gerrit)

        unread,
        Apr 1, 2026, 8:24:46 AM (22 hours ago) Apr 1
        to Vinay Singh, Divyansh Mangal, Virali Purbey, Chromium LUCI CQ, chromium...@chromium.org, Stephen Chenney, Kentaro Hara, Raphael Kubo da Costa, Dirk Schulze, AyeAye, peter+watch...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, jmedle...@chromium.org, fmalit...@chromium.org, blink-...@chromium.org, pdr+svgw...@chromium.org, kouhe...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org
        Attention needed from Divyansh Mangal, Vinay Singh and Virali Purbey

        Fredrik Söderquist added 14 comments

        File third_party/blink/renderer/core/svg/svg_svg_element.h
        Line 61, Patchset 15 (Latest): DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(resize, kResize)
        DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(scroll, kScroll)
        Fredrik Söderquist . unresolved

        So, the content attribute processing for these only apply if the element is outermost, while here it always apply.

        Line 57, Patchset 15 (Latest): DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(blur, kBlur)
        DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(error, kError)
        DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(focus, kFocus)
        DEFINE_WINDOW_ATTRIBUTE_EVENT_LISTENER(load, kLoad)
        Fredrik Söderquist . unresolved

        Some of these are not handled the same as content attributes.

        Line 55, Patchset 15 (Latest): // WindowEventHandlers overrides for events that also exist in
        // GlobalEventHandlers (same pattern as HTMLBodyElement).
        Fredrik Söderquist . unresolved

        I think this might be more helpful if it said why. (Also, `WindowEventHandlers` not really relevant (yet).)

        Line 48, Patchset 15 (Latest): public WindowEventHandlers {
        Fredrik Söderquist . unresolved

        We're not really exposing any of these though, so at this point, this is jut dead weight. You can defined `GetDocumentForWindowEventHandler()` without overriding it.

        File third_party/blink/renderer/core/svg/svg_svg_element.idl
        Vinay Singh . unresolved

        `HTMLBodyElement` has the equivalent explicit attributes without a `[RuntimeEnabled]` flag. This implements spec-mandated behavior that has existed for `<body>` since the beginning. Adding a flag here would create an inconsistency with `HTMLBodyElement` and diverge from the spec for no clear benefit. The behavior for content attributes (`<svg onresize='...'>`) already works without a flag - this CL just fixes the IDL property path to match.

        Divyansh Mangal

        But this is a new API change specific to `SVGSVGElement` we generally start with Runtime feature flag where IDL is getting changed.

        Fredrik Söderquist

        👍

        File third_party/blink/web_tests/external/wpt/svg/struct/scripted/svg-window-event-handlers.html
        File-level comment, Patchset 15 (Latest):
        Fredrik Söderquist . unresolved

        Are the content attribute versions tested somewhere? If not, it might make sense to do that here as well?

        Line 17, Patchset 15 (Latest): const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
        document.body.appendChild(svg);
        this.add_cleanup(function() { svg.remove(); });

        // SVGSVGElement should have the window-reflecting event handler attributes.
        assert_true('onblur' in svg,
        "SVGSVGElement should have onblur");
        assert_true('onerror' in svg,
        "SVGSVGElement should have onerror");
        assert_true('onfocus' in svg,
        "SVGSVGElement should have onfocus");
        assert_true('onload' in svg,
        "SVGSVGElement should have onload");
        assert_true('onresize' in svg,
        "SVGSVGElement should have onresize");
        assert_true('onscroll' in svg,
        "SVGSVGElement should have onscroll");
        Fredrik Söderquist . unresolved

        This looks like it may be better suited to an IDL harness test? Reagrdless there should be no need to create an instance, and testharness has better functions for this style of test.

        Line 42, Patchset 15 (Latest): svg.onresize = t.step_func(function(e) {
        Fredrik Söderquist . unresolved

        `step_func_done()` (and drop the `t.done()`).

        Line 37, Patchset 15 (Latest):async_test(function(t) {
        const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
        document.body.appendChild(svg);
        t.add_cleanup(function() { svg.remove(); });

        svg.onresize = t.step_func(function(e) {
        assert_equals(e.currentTarget, window,
        "resize event dispatched on window should have currentTarget === window");
        t.done();
        });
        window.dispatchEvent(new Event('resize'));
        }, "Setting SVGSVGElement.onresize should forward the handler to the window");
        Fredrik Söderquist . unresolved

        It looks like you could write this test once and parameterize it on the event name.

        Line 81, Patchset 15 (Latest): window.onerror = previousHandler;
        Fredrik Söderquist . unresolved

        I guess you want this to be part of the cleanup as well?

        Line 131, Patchset 15 (Latest):// Test: addEventListener('resize', ...) on SVGSVGElement does NOT forward to
        // the window. Only IDL attribute (onresize) and content attribute
        // (<svg onresize="...">) forwarding is specified.
        Fredrik Söderquist . unresolved

        This looks like something that should hold true in general for the events tested? Why limit to `resize`?

        Line 134, Patchset 15 (Latest):async_test(function(t) {
        Fredrik Söderquist . unresolved

        Does this test need to be async? The way it's written currently it sort of assumes synchronicity.

        Line 150, Patchset 15 (Latest): window.addEventListener('resize', function handler(e) {
        Fredrik Söderquist . unresolved

        This looks like it should `unreachable_func()`?

        Line 152, Patchset 15 (Latest): window.removeEventListener('resize', handler);
        Fredrik Söderquist . unresolved

        Use `{once: true}`, but we don't expect it to happen, so should probably just clean it up unconditionally at the end of the test.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Divyansh Mangal
        • Vinay Singh
        • Virali Purbey
        Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Comment-Date: Wed, 01 Apr 2026 12:24:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
        Comment-In-Reply-To: Divyansh Mangal <dma...@microsoft.com>
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy
        Reply all
        Reply to author
        Forward
        0 new messages