Bug 229381

Summary: Add onsecuritypolicyviolation on GlobalEventHandlers
Product: WebKit Reporter: Sonia Singla <soniasingla.1812>
Component: DOMAssignee: Sonia Singla <soniasingla.1812>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, changseok, clopez, dbarton, esprehn+autocc, ews-watchlist, fred.wang, gyuyoung.kim, kangil.han, kondapallykalyan, mkwst, sam, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
fred.wang: review-
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Sonia Singla 2021-08-21 22:06:33 PDT
See https://github.com/whatwg/html/pull/2651
Comment 1 Sonia Singla 2021-08-21 22:19:02 PDT
Created attachment 436107 [details]
Patch
Comment 2 Sonia Singla 2021-08-21 22:21:52 PDT
:fredw, is it fine to edit LayoutTests/imported/w3c/**  to make the tests pass? thanks
Comment 3 Sonia Singla 2021-08-21 23:14:54 PDT
Created attachment 436112 [details]
Patch
Comment 4 EWS Watchlist 2021-08-21 23:15:47 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 5 Sonia Singla 2021-08-21 23:15:58 PDT
Created attachment 436113 [details]
Patch
Comment 6 Sam Weinig 2021-08-22 11:24:46 PDT
Comment on attachment 436113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436113&action=review

> Source/WebCore/dom/ShadowRoot.idl:34
> +    attribute EventHandler onsecuritypolicyviolation;

I don't see onsecuritypolicyviolation on ShadowRoot in the ShadowRoot spec - https://dom.spec.whatwg.org/#interface-shadowroot. Why did you decide to add this? If this is something other browsers do, we should make sure there is a spec bug about this.
Comment 7 Sam Weinig 2021-08-22 11:26:39 PDT
(In reply to Sonia Singla from comment #2)
> :fredw, is it fine to edit LayoutTests/imported/w3c/**  to make the tests
> pass? thanks

You can edit the results, but not the tests themselves. Instead, the changes to tests should happen in the WPT repository (https://github.com/web-platform-tests/wpt) and then re-imported into LayoutTests.
Comment 8 Sonia Singla 2021-08-22 11:59:56 PDT
Created attachment 436120 [details]
Patch
Comment 9 Frédéric Wang (:fredw) 2021-08-22 23:54:11 PDT
Comment on attachment 436113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436113&action=review

Thanks for the patch. It seems there are more tests passing so you can just update the results, no need to edit the test themselves, right? (if it turns out that the tests are not up-to-date, we would need to sync first).

> Source/WebCore/ChangeLog:3
> +        Add onsecuritypolicyviolation on ShadowRoot and GlobalEventHandlers

Here, in the bug title and elsewhere should just be "GlobalEventHandlers" (not ShadowRoot and not only on SVG/HTML elements). Please also explain the change briefly and add a reference to the spec definition and/or discussion.

>> Source/WebCore/dom/ShadowRoot.idl:34
>> +    attribute EventHandler onsecuritypolicyviolation;
> 
> I don't see onsecuritypolicyviolation on ShadowRoot in the ShadowRoot spec - https://dom.spec.whatwg.org/#interface-shadowroot. Why did you decide to add this? If this is something other browsers do, we should make sure there is a spec bug about this.

yes, this is not in the spec, please remove this. I guess the confusion is because Sonia is working on onslotchange too, which exists on the two interfaces.

> LayoutTests/ChangeLog:3
> +        Add onsecuritypolicyviolation on ShadowRoot and GlobalEventHandlers

Ditto.

> LayoutTests/imported/w3c/ChangeLog:3
> +        Add onsecuritypolicyviolation on ShadowRoot and GlobalEventHandlers

Ditto.
Comment 10 Sonia Singla 2021-08-24 04:09:20 PDT
Created attachment 436275 [details]
Patch
Comment 11 Sonia Singla 2021-08-24 04:47:22 PDT
Created attachment 436277 [details]
Patch
Comment 12 Sonia Singla 2021-08-24 05:34:17 PDT
Created attachment 436281 [details]
Patch
Comment 13 Frédéric Wang (:fredw) 2021-08-24 09:11:10 PDT
Comment on attachment 436281 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436281&action=review

LGTM, with the "PASSS" typo fixed.

> LayoutTests/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:5084
> +PASSS SVGElement interface: attribute onsecuritypolicyviolation

"PASS" without extra S. I guess the EWS tests are not failing since we have other idlharness.https-expected.txt for mac, but that's going to fail once we land it.
Comment 14 Sonia Singla 2021-08-24 09:29:50 PDT
Created attachment 436295 [details]
Patch
Comment 15 Frédéric Wang (:fredw) 2021-08-24 22:59:02 PDT
Comment on attachment 436295 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=436295&action=review

> Source/WebCore/ChangeLog:18
> +        Reviewed by NOBODY (OOPS!).

Oops, sorry I forgot to say that this line should be after https://bugs.webkit.org/show_bug.cgi?id=229381 (compare with other ChangeLog entries)
Comment 16 Sonia Singla 2021-08-25 01:10:12 PDT
Created attachment 436379 [details]
Patch
Comment 17 EWS 2021-08-25 03:18:47 PDT
Found 1 new test failure: imported/w3c/web-platform-tests/IndexedDB/serialize-sharedarraybuffer-throws.https.html
Comment 18 Sonia Singla 2021-08-25 08:33:07 PDT
Created attachment 436391 [details]
Patch
Comment 19 EWS 2021-08-25 11:45:23 PDT
Committed r281569 (240934@main): <https://commits.webkit.org/240934@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 436391 [details].
Comment 20 Radar WebKit Bug Importer 2021-08-25 11:46:22 PDT
<rdar://problem/82350346>