[Webkit-unassigned] [Bug 284692] New: SVGElement event handler default context does not include DOM properties

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Dec 14 10:10:14 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=284692

            Bug ID: 284692
           Summary: SVGElement event handler default context does not
                    include DOM properties
           Product: WebKit
           Version: Safari 18
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: eyalgruss at gmail.com

doing <svg onclick="console.log(parentElement)"> will give the error: ReferenceError: Can't find variable: parentElement

the error does not happen when:
1. using the same event handler on a div element
2. adding "this." before parentElement
3. running the same on Chromium or Firefox

code to recreate:

<div id="hello">
  <div onclick="console.log(this.parentElement.id)">Click me 1</div>
  <div onclick="console.log(parentElement.id)">Click me 2</div>
  <svg id="hi">
    <text x="0" y="20" onclick="console.log(this.parentElement.id)">Click me 3</text>
    <text x="0" y="40" onclick="console.log(parentElement.id)">Click me 4 (Webkit error)</text>
  </svg>
<div>

try here: https://codepen.io/eyaler/pen/MYgbXEr

I am testing via playwright - 18.2 Safari/605.1.15

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241214/7f2b7366/attachment.htm>


More information about the webkit-unassigned mailing list