[Webkit-unassigned] [Bug 226215] New: SecurityPolicyViolationEvent.constructor do not throw any exception as expected when eventInitDict param do not include all the members required

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 25 03:19:10 PDT 2021


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

            Bug ID: 226215
           Summary: SecurityPolicyViolationEvent.constructor do not throw
                    any exception as expected when eventInitDict param do
                    not include all the members required
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zyscoder at gmail.com

Steps to reproduce:

(1) Open a tab and navigate to any URL;
(2) Run the following code in the Console of Devtools:
```
new SecurityPolicyViolationEvent('', {});
```
(3) Then this code would be evaluated successfully without throwing any exception.

Actual results:

This code is evaluated successfully without throwing any exception.

Expected results:

As https://docs.w3cub.com/dom/securitypolicyviolationevent/securitypolicyviolationevent says, "eventInitDict is a dictionary object containing information about the properties of the SecurityPolicyViolationEvent to be constructed. This can include the following properties, but bear in mind that if you do include an eventInitDict, certain properties must be included (marked below with required, like disposition)."
That means the code above should throw an exception since the required members are undefined, just like what the Chrome would throw: Uncaught TypeError: Failed to construct 'SecurityPolicyViolationEvent': required member disposition is undefined.

-- 
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/20210525/325e5596/attachment.htm>


More information about the webkit-unassigned mailing list