Bug 143569

Summary: Add force property to MouseEvents
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, buildbot, commit-queue, dbates, dino, eoconnor, jonlee, rniwa, sam, thorton
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mavericks
none
Archive of layout-test-results from ews104 for mac-mavericks-wk2
none
Patch
none
Patch
none
Patch that also adds force to PlatformMouseEvent darin: review+

Beth Dakin
Reported 2015-04-09 11:43:32 PDT
Right now, WebKitMouseForceEvent inherits from MouseEvent and includes a force property. Instead, force should be a property on all mouse events. rdar://problem/20472954
Attachments
Patch (59.07 KB, patch)
2015-04-09 11:58 PDT, Beth Dakin
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-mavericks (563.10 KB, application/zip)
2015-04-09 13:05 PDT, Build Bot
no flags
Archive of layout-test-results from ews104 for mac-mavericks-wk2 (618.46 KB, application/zip)
2015-04-09 13:13 PDT, Build Bot
no flags
Patch (65.64 KB, patch)
2015-04-09 13:52 PDT, Beth Dakin
no flags
Patch (66.79 KB, patch)
2015-04-09 15:26 PDT, Beth Dakin
no flags
Patch that also adds force to PlatformMouseEvent (83.61 KB, patch)
2015-04-11 12:20 PDT, Beth Dakin
darin: review+
Beth Dakin
Comment 1 2015-04-09 11:58:05 PDT
WebKit Commit Bot
Comment 2 2015-04-09 11:59:29 PDT
Attachment 250451 [details] did not pass style-queue: ERROR: Source/WebCore/dom/Element.cpp:2279: Missing space after , [whitespace/comma] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:117: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:128: Wrong number of spaces before statement. (expected: 27) [whitespace/indent] [4] ERROR: Source/WebCore/dom/MouseEvent.cpp:276: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 4 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3 2015-04-09 13:05:28 PDT
Comment on attachment 250451 [details] Patch Attachment 250451 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/6034319655043072 New failing tests: js/dom/global-constructors-attributes.html
Build Bot
Comment 4 2015-04-09 13:05:32 PDT
Created attachment 250453 [details] Archive of layout-test-results from ews101 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-mavericks Platform: Mac OS X 10.9.5
Build Bot
Comment 5 2015-04-09 13:13:31 PDT
Comment on attachment 250451 [details] Patch Attachment 250451 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/4670016649691136 New failing tests: js/dom/global-constructors-attributes.html
Build Bot
Comment 6 2015-04-09 13:13:35 PDT
Created attachment 250455 [details] Archive of layout-test-results from ews104 for mac-mavericks-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-mavericks-wk2 Platform: Mac OS X 10.9.5
Beth Dakin
Comment 7 2015-04-09 13:52:43 PDT
WebKit Commit Bot
Comment 8 2015-04-09 13:54:49 PDT
Attachment 250465 [details] did not pass style-queue: ERROR: Source/WebCore/dom/MouseEvent.cpp:117: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:128: Wrong number of spaces before statement. (expected: 27) [whitespace/indent] [4] ERROR: Source/WebCore/dom/MouseEvent.cpp:276: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 3 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Beth Dakin
Comment 9 2015-04-09 15:26:28 PDT
WebKit Commit Bot
Comment 10 2015-04-09 15:28:36 PDT
Attachment 250472 [details] did not pass style-queue: ERROR: Source/WebCore/dom/MouseEvent.cpp:117: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:128: Wrong number of spaces before statement. (expected: 27) [whitespace/indent] [4] ERROR: Source/WebCore/dom/MouseEvent.cpp:276: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 3 in 18 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 11 2015-04-10 12:14:56 PDT
Comment on attachment 250472 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=250472&action=review > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1092 > + RefPtr<MouseEvent> mouseEvent = MouseEvent::create(eventNames().clickEvent, true, true, currentTime(), nullptr, singleClick, screenPoint.x(), screenPoint.y(), documentPoint.x(), documentPoint.y(), false, false, false, false, 0, nullptr, 0, nullptr); Can we improve this? We discussed a zero-force constant to make these things better.
Beth Dakin
Comment 12 2015-04-11 12:20:04 PDT
Created attachment 250577 [details] Patch that also adds force to PlatformMouseEvent Simon thought it would make more sense to add force to PlatformMouseEvent in addition to adding it to MouseEvent. It is an AppKit implementation detail that force is not a part of the Mac platform mouse events, but Simon feels it should still be a part of PlatformMouseEvent.
WebKit Commit Bot
Comment 13 2015-04-11 12:23:04 PDT
Attachment 250577 [details] did not pass style-queue: ERROR: Source/WebCore/platform/PlatformMouseEvent.h:69: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/platform/PlatformMouseEvent.h:76: Wrong number of spaces before statement. (expected: 31) [whitespace/indent] [4] ERROR: Source/WebCore/page/DragController.cpp:96: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:117: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] ERROR: Source/WebCore/dom/MouseEvent.cpp:128: Wrong number of spaces before statement. (expected: 27) [whitespace/indent] [4] ERROR: Source/WebCore/dom/MouseEvent.cpp:276: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 6 in 31 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 14 2015-04-12 13:03:06 PDT
Comment on attachment 250577 [details] Patch that also adds force to PlatformMouseEvent View in context: https://bugs.webkit.org/attachment.cgi?id=250577&action=review Looks fine. Broke the iOS and Windows builds, though. > Source/WebCore/platform/PlatformMouseEvent.h:47 > +static const double ForceAtClick = 0; > +static const double ForceAtForceClick = 1; These should not be marked static, since they are in a header file. > Source/WebKit2/Shared/mac/WebEventFactory.mm:378 > +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003 I don’t think MAX_ALLOWED is the right way to check this. Is it?
Beth Dakin
Comment 15 2015-04-13 12:10:10 PDT
Thanks Darin! (In reply to comment #14) > Comment on attachment 250577 [details] > Patch that also adds force to PlatformMouseEvent > > View in context: > https://bugs.webkit.org/attachment.cgi?id=250577&action=review > > Looks fine. Broke the iOS and Windows builds, though. > I think I have those fixed now. > > Source/WebCore/platform/PlatformMouseEvent.h:47 > > +static const double ForceAtClick = 0; > > +static const double ForceAtForceClick = 1; > > These should not be marked static, since they are in a header file. > Fixed! > > Source/WebKit2/Shared/mac/WebEventFactory.mm:378 > > +#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101003 > > I don’t think MAX_ALLOWED is the right way to check this. Is it? Actually, I think it is. I did work through this with Dan and Tim. It seems like the dot releases, i.e. 101003, are only defined in the context of MAX_ALLOWED, not the usual MIN_REQUIRED.
Beth Dakin
Comment 16 2015-04-13 12:19:21 PDT
Note You need to log in before you can comment on or make changes to this bug.