Bug 188929

Summary: Avoid calling setUntrusted in SimulatedMouseEvent
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: UI EventsAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, dbates, esprehn+autocc, ews-watchlist, kangil.han, rniwa, simon.fraser, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 170211    
Attachments:
Description Flags
Cleanup
none
Archive of layout-test-results from ews100 for mac-sierra
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Patch for landing none

Description Ryosuke Niwa 2018-08-24 13:46:55 PDT
Pass IsTrusted flag around to superclass' constructors instead.
Comment 1 Ryosuke Niwa 2018-08-24 13:49:12 PDT
Created attachment 348038 [details]
Cleanup
Comment 2 EWS Watchlist 2018-08-24 13:51:27 PDT
Attachment 348038 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/MouseEvent.cpp:84:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/MouseEvent.cpp:84:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/Event.h:146:  The parameter name "isTrusted" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/dom/MouseRelatedEvent.cpp:39:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/MouseRelatedEvent.cpp:39:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/WheelEvent.cpp:51:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/dom/UIEventWithKeyState.h:59:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 7 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Simon Fraser (smfr) 2018-08-24 14:05:37 PDT
Comment on attachment 348038 [details]
Cleanup

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

> Source/WebCore/ChangeLog:11
> +        This makes EventTarget::dispatchEventForBindings the only caller of setUntrusted().

Can some of these Event members variables be const variables after these changes?

> Source/WebCore/dom/Event.h:146
> +    Event(const AtomicString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, IsTrusted isTrusted = IsTrusted::Yes);

You don't need to name the parameter here.
Comment 4 EWS Watchlist 2018-08-24 15:02:21 PDT
Comment on attachment 348038 [details]
Cleanup

Attachment 348038 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/8975203

New failing tests:
imported/w3c/web-platform-tests/shadow-dom/event-composed.html
Comment 5 EWS Watchlist 2018-08-24 15:02:23 PDT
Created attachment 348043 [details]
Archive of layout-test-results from ews100 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 6 EWS Watchlist 2018-08-24 15:11:17 PDT
Comment on attachment 348038 [details]
Cleanup

Attachment 348038 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/8975217

New failing tests:
imported/w3c/web-platform-tests/shadow-dom/event-composed.html
Comment 7 EWS Watchlist 2018-08-24 15:11:18 PDT
Created attachment 348045 [details]
Archive of layout-test-results from ews104 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 8 Ryosuke Niwa 2018-08-24 15:12:39 PDT
Comment on attachment 348038 [details]
Cleanup

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

> Source/WebCore/dom/SimulatedClick.cpp:47
> -        : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, source == SimulatedClickSource::Bindings ? IsComposed::No : IsComposed::Yes,
> +        : MouseEvent(eventType, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes,

Oh oops, this is the unrelated change causing the test to fail.
Comment 9 Ryosuke Niwa 2018-08-24 15:13:28 PDT
Created attachment 348046 [details]
Patch for landing
Comment 10 Radar WebKit Bug Importer 2018-08-24 15:13:52 PDT
<rdar://problem/43699414>
Comment 11 EWS Watchlist 2018-08-24 15:14:51 PDT
Attachment 348046 [details] did not pass style-queue:


ERROR: Source/WebCore/dom/MouseEvent.cpp:84:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/MouseEvent.cpp:84:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/Event.h:146:  The parameter name "isTrusted" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/dom/MouseRelatedEvent.cpp:39:  Code inside a namespace should not be indented.  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/MouseRelatedEvent.cpp:39:  Wrong number of spaces before statement. (expected: 8)  [whitespace/indent] [4]
ERROR: Source/WebCore/dom/WheelEvent.cpp:51:  Comma should be at the beginning of the line in a member initialization list.  [whitespace/init] [4]
ERROR: Source/WebCore/dom/UIEventWithKeyState.h:59:  Wrong number of spaces before statement. (expected: 12)  [whitespace/indent] [4]
Total errors found: 7 in 13 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 WebKit Commit Bot 2018-08-24 15:51:40 PDT
Comment on attachment 348046 [details]
Patch for landing

Clearing flags on attachment: 348046

Committed r235335: <https://trac.webkit.org/changeset/235335>
Comment 13 WebKit Commit Bot 2018-08-24 15:51:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Lucas Forschler 2019-02-06 09:19:04 PST
Mass move bugs into the DOM component.