Diff
Modified: trunk/LayoutTests/ChangeLog (207040 => 207041)
--- trunk/LayoutTests/ChangeLog 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/LayoutTests/ChangeLog 2016-10-11 04:43:26 UTC (rev 207041)
@@ -1,5 +1,21 @@
2016-10-10 Chris Dumez <cdu...@apple.com>
+ Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
+ https://bugs.webkit.org/show_bug.cgi?id=163254
+
+ Reviewed by Darin Adler.
+
+ Update existing tests now that:
+ - Exception messages are now slightly different in some cases.
+ - We now throw when an invalid relatedTarget type is passed in the dictionary.
+
+ * fast/events/constructors/mouse-event-constructor.html:
+ * fast/events/constructors/wheel-event-constructor.html:
+ * platform/mac/fast/events/constructors/mouse-event-constructor-expected.txt:
+ * platform/mac/fast/events/constructors/wheel-event-constructor-expected.txt:
+
+2016-10-10 Chris Dumez <cdu...@apple.com>
+
Add support for languagechange event
https://bugs.webkit.org/show_bug.cgi?id=163222
Modified: trunk/LayoutTests/fast/events/constructors/mouse-event-constructor.html (207040 => 207041)
--- trunk/LayoutTests/fast/events/constructors/mouse-event-constructor.html 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/LayoutTests/fast/events/constructors/mouse-event-constructor.html 2016-10-11 04:43:26 UTC (rev 207041)
@@ -136,19 +136,19 @@
shouldBe("new MouseEvent('eventType', { relatedTarget: window }).relatedTarget", "window");
// Invalid objects.
-shouldBe("new MouseEvent('eventType', { relatedTarget: testObject }).relatedTarget", "null");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: testObject })", "TypeError");
shouldBe("new MouseEvent('eventType', { relatedTarget: undefined }).relatedTarget", "null");
shouldBe("new MouseEvent('eventType', { relatedTarget: null }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: false }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: true }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: '' }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: 12345 }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget", "null");
-shouldBe("new MouseEvent('eventType', { relatedTarget: NaN }).relatedTarget", "null");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: false })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: true })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: '' })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: 'chocolate' })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: 12345 })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: 18446744073709551615 })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: NaN })", "TypeError");
// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldBeFalse("new MouseEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv");
-shouldBe("new MouseEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget", "null");
+shouldThrowErrorName("new MouseEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } })", "TypeError");
+shouldThrowErrorName("new MouseEvent('eventType', { get relatedTarget() { return 123; } })", "TypeError");
shouldThrow("new MouseEvent('eventType', { get relatedTarget() { throw 'MouseEvent Error'; } })");
// All initializers are passed.
Modified: trunk/LayoutTests/fast/events/constructors/wheel-event-constructor.html (207040 => 207041)
--- trunk/LayoutTests/fast/events/constructors/wheel-event-constructor.html 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/LayoutTests/fast/events/constructors/wheel-event-constructor.html 2016-10-11 04:43:26 UTC (rev 207041)
@@ -172,19 +172,19 @@
shouldBe("new WheelEvent('eventType', { relatedTarget: xhr }).relatedTarget", "xhr");
// Invalid objects.
-shouldBe("new WheelEvent('eventType', { relatedTarget: testObject }).relatedTarget", "null");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: testObject })", "TypeError");
shouldBe("new WheelEvent('eventType', { relatedTarget: undefined }).relatedTarget", "null");
shouldBe("new WheelEvent('eventType', { relatedTarget: null }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: false }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: true }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: '' }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 12345 }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget", "null");
-shouldBe("new WheelEvent('eventType', { relatedTarget: NaN }).relatedTarget", "null");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: false })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: true })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: '' })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: 'chocolate' })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: 12345 })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: 18446744073709551615 })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: NaN })", "TypeError");
// Note that valueOf() is not called, when the left hand side is evaluated.
-shouldBeFalse("new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv");
-shouldBe("new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget", "null");
+shouldThrowErrorName("new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } })", "TypeError");
+shouldThrowErrorName("new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget", "TypeError");
shouldThrow("new WheelEvent('eventType', { get relatedTarget() { throw 'WheelEvent Error'; } })");
// All initializers are passed.
Modified: trunk/LayoutTests/platform/mac/fast/events/constructors/mouse-event-constructor-expected.txt (207040 => 207041)
--- trunk/LayoutTests/platform/mac/fast/events/constructors/mouse-event-constructor-expected.txt 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/LayoutTests/platform/mac/fast/events/constructors/mouse-event-constructor-expected.txt 2016-10-11 04:43:26 UTC (rev 207041)
@@ -23,19 +23,19 @@
PASS new MouseEvent('eventType', { cancelable: true }).cancelable is true
PASS new MouseEvent('eventType', { view: window }).view is window
PASS new MouseEvent('eventType', { view: this }).view is this
-PASS new MouseEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new MouseEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: document }).view threw exception TypeError: Type error.
PASS new MouseEvent('eventType', { view: undefined }).view is null
PASS new MouseEvent('eventType', { view: null }).view is null
-PASS new MouseEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new MouseEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new MouseEvent('eventType', { view: false }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: true }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
PASS new MouseEvent('eventType', { get view() { throw 'MouseEvent Error'; } }) threw exception MouseEvent Error.
PASS new MouseEvent('eventType', { detail: 0 }).detail is 0
PASS new MouseEvent('eventType', { detail: 2147483647 }).detail is 2147483647
@@ -176,18 +176,18 @@
PASS new MouseEvent('eventType', { relatedTarget: document }).relatedTarget is document
PASS new MouseEvent('eventType', { relatedTarget: xhr }).relatedTarget is xhr
PASS new MouseEvent('eventType', { relatedTarget: window }).relatedTarget is window
-PASS new MouseEvent('eventType', { relatedTarget: testObject }).relatedTarget is null
+PASS new MouseEvent('eventType', { relatedTarget: testObject }) threw exception TypeError: Type error.
PASS new MouseEvent('eventType', { relatedTarget: undefined }).relatedTarget is null
PASS new MouseEvent('eventType', { relatedTarget: null }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: false }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: true }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: '' }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: 12345 }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: NaN }).relatedTarget is null
-PASS new MouseEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv is false
-PASS new MouseEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget is null
+PASS new MouseEvent('eventType', { relatedTarget: false }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: true }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: '' }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: 'chocolate' }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: 12345 }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: 18446744073709551615 }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: NaN }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }) threw exception TypeError: Type error.
+PASS new MouseEvent('eventType', { get relatedTarget() { return 123; } }) threw exception TypeError: Type error.
PASS new MouseEvent('eventType', { get relatedTarget() { throw 'MouseEvent Error'; } }) threw exception MouseEvent Error.
PASS new MouseEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrlKey: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarget: testDiv }).bubbles is true
PASS new MouseEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrlKey: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarget: testDiv }).cancelable is true
Modified: trunk/LayoutTests/platform/mac/fast/events/constructors/wheel-event-constructor-expected.txt (207040 => 207041)
--- trunk/LayoutTests/platform/mac/fast/events/constructors/wheel-event-constructor-expected.txt 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/LayoutTests/platform/mac/fast/events/constructors/wheel-event-constructor-expected.txt 2016-10-11 04:43:26 UTC (rev 207041)
@@ -26,19 +26,19 @@
PASS new WheelEvent('eventType', { cancelable: true }).cancelable is true
PASS new WheelEvent('eventType', { view: window }).view is window
PASS new WheelEvent('eventType', { view: this }).view is this
-PASS new WheelEvent('eventType', { view: testObject }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: document }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new WheelEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: document }).view threw exception TypeError: Type error.
PASS new WheelEvent('eventType', { view: undefined }).view is null
PASS new WheelEvent('eventType', { view: null }).view is null
-PASS new WheelEvent('eventType', { view: false }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: true }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: '' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: 12345 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: NaN }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Dictionary member is not of type Window.
-PASS new WheelEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Dictionary member is not of type Window.
+PASS new WheelEvent('eventType', { view: false }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: true }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
PASS new WheelEvent('eventType', { get view() { throw 'WheelEvent Error'; } }) threw exception WheelEvent Error.
PASS new WheelEvent('eventType', { detail: 0 }).detail is 0
PASS new WheelEvent('eventType', { detail: 2147483647 }).detail is 2147483647
@@ -245,18 +245,18 @@
PASS new WheelEvent('eventType', { relatedTarget: testDiv }).relatedTarget is testDiv
PASS new WheelEvent('eventType', { relatedTarget: document }).relatedTarget is document
PASS new WheelEvent('eventType', { relatedTarget: xhr }).relatedTarget is xhr
-PASS new WheelEvent('eventType', { relatedTarget: testObject }).relatedTarget is null
+PASS new WheelEvent('eventType', { relatedTarget: testObject }) threw exception TypeError: Type error.
PASS new WheelEvent('eventType', { relatedTarget: undefined }).relatedTarget is null
PASS new WheelEvent('eventType', { relatedTarget: null }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: false }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: true }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: '' }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: 12345 }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: NaN }).relatedTarget is null
-PASS new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv is false
-PASS new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget is null
+PASS new WheelEvent('eventType', { relatedTarget: false }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: true }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: '' }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: 'chocolate' }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: 12345 }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: 18446744073709551615 }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: NaN }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }) threw exception TypeError: Type error.
+PASS new WheelEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget threw exception TypeError: Type error.
PASS new WheelEvent('eventType', { get relatedTarget() { throw 'WheelEvent Error'; } }) threw exception WheelEvent Error.
PASS new WheelEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrlKey: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarget: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA_PAGE }).bubbles is true
PASS new WheelEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, screenX: 222, screenY: 333, clientX: 444, clientY: 555, ctrlKey: true, shiftKey: true, altKey: true, metaKey: true, button: 666, relatedTarget: testDiv, wheelDeltaX: 777, wheelDeltaY: 888, deltaMode: WheelEvent.DOM_DELTA_PAGE }).cancelable is true
Modified: trunk/Source/WebCore/CMakeLists.txt (207040 => 207041)
--- trunk/Source/WebCore/CMakeLists.txt 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/CMakeLists.txt 2016-10-11 04:43:26 UTC (rev 207041)
@@ -412,6 +412,7 @@
dom/MessageEvent.idl
dom/MessagePort.idl
dom/MouseEvent.idl
+ dom/MouseEventInit.idl
dom/MutationEvent.idl
dom/MutationObserver.idl
dom/MutationRecord.idl
Modified: trunk/Source/WebCore/ChangeLog (207040 => 207041)
--- trunk/Source/WebCore/ChangeLog 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/ChangeLog 2016-10-11 04:43:26 UTC (rev 207041)
@@ -1,5 +1,44 @@
2016-10-10 Chris Dumez <cdu...@apple.com>
+ Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
+ https://bugs.webkit.org/show_bug.cgi?id=163254
+
+ Reviewed by Darin Adler.
+
+ Update WheelEvent / MouseEvent to stop using legacy [ConstructorTemplate=Event]
+ and use a regular constructor instead, as in the specification:
+ - https://www.w3.org/TR/uievents/#interface-mouseevent
+ - https://www.w3.org/TR/uievents/#interface-wheelevent
+
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateHeader):
+ (GenerateDictionaryHeader):
+ Fix our broken dependency tracking when it comes to dictionaries.
+
+ * dom/MouseEvent.cpp:
+ (WebCore::MouseEvent::create):
+ (WebCore::MouseEvent::MouseEvent):
+ * dom/MouseEvent.h:
+ * dom/MouseEvent.idl:
+ * dom/MouseEventInit.h: Added.
+ * dom/MouseEventInit.idl: Added.
+ * dom/MouseRelatedEvent.cpp:
+ (WebCore::MouseRelatedEvent::MouseRelatedEvent):
+ * dom/MouseRelatedEvent.h:
+ * dom/UIEventWithKeyState.h:
+ (WebCore::UIEventWithKeyState::UIEventWithKeyState):
+ * dom/WheelEvent.cpp:
+ (WebCore::WheelEvent::WheelEvent):
+ * dom/WheelEvent.h:
+ * dom/WheelEvent.idl:
+
+2016-10-10 Chris Dumez <cdu...@apple.com>
+
Add support for languagechange event
https://bugs.webkit.org/show_bug.cgi?id=163222
Modified: trunk/Source/WebCore/DerivedSources.cpp (207040 => 207041)
--- trunk/Source/WebCore/DerivedSources.cpp 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/DerivedSources.cpp 2016-10-11 04:43:26 UTC (rev 207041)
@@ -347,6 +347,7 @@
#include "JSMessageEvent.cpp"
#include "JSMessagePort.cpp"
#include "JSMouseEvent.cpp"
+#include "JSMouseEventInit.cpp"
#include "JSMutationEvent.cpp"
#include "JSMutationObserver.cpp"
#include "JSMutationRecord.cpp"
Modified: trunk/Source/WebCore/DerivedSources.make (207040 => 207041)
--- trunk/Source/WebCore/DerivedSources.make 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/DerivedSources.make 2016-10-11 04:43:26 UTC (rev 207041)
@@ -321,6 +321,7 @@
$(WebCore)/dom/MessageEvent.idl \
$(WebCore)/dom/MessagePort.idl \
$(WebCore)/dom/MouseEvent.idl \
+ $(WebCore)/dom/MouseEventInit.idl \
$(WebCore)/dom/MutationEvent.idl \
$(WebCore)/dom/MutationObserver.idl \
$(WebCore)/dom/MutationRecord.idl \
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (207040 => 207041)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2016-10-11 04:43:26 UTC (rev 207041)
@@ -2877,6 +2877,8 @@
830519961BB0F11000F3772E /* HTMLTimeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 830519931BB0F0E700F3772E /* HTMLTimeElement.h */; };
8306EFF11B8BCEA50031D032 /* NativeNodeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8306EFF01B8BCE7C0031D032 /* NativeNodeFilter.cpp */; };
830784B21C52EE2C00104D1D /* XMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 830784B11C52EE1900104D1D /* XMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 830A36BC1DAC5FAD006D7D09 /* JSMouseEventInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 830A36BA1DAC5FA7006D7D09 /* JSMouseEventInit.cpp */; };
+ 830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */; };
83120C701C56F3F6001CB112 /* HTMLDataElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 831D1F291C56ECA000F5F6C0 /* HTMLDataElement.cpp */; };
83120C711C56F3FB001CB112 /* HTMLDataElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B86A71C56E83A00F3F0E3 /* HTMLDataElement.h */; };
832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
@@ -2902,6 +2904,7 @@
836FBCEA178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */; };
836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */; };
8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB301A6780A800C697C5 /* DiagnosticLoggingResultType.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 83765F951DAC522F00C06537 /* MouseEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83765F941DAC521800C06537 /* MouseEventInit.h */; settings = {ATTRIBUTES = (Private, ); }; };
8386A96D19F61B2E00E1EC4A /* StyleBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */; };
8386A97019F61E4F00E1EC4A /* StyleBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */; };
838867351D13BA5F003697D0 /* RenderObjectEnums.h in Headers */ = {isa = PBXBuildFile; fileRef = 838867341D13BA59003697D0 /* RenderObjectEnums.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10023,6 +10026,8 @@
8306EFF01B8BCE7C0031D032 /* NativeNodeFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeNodeFilter.cpp; sourceTree = "<group>"; };
830784B01C52EE1900104D1D /* XMLDocument.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XMLDocument.idl; sourceTree = "<group>"; };
830784B11C52EE1900104D1D /* XMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLDocument.h; sourceTree = "<group>"; };
+ 830A36BA1DAC5FA7006D7D09 /* JSMouseEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMouseEventInit.cpp; sourceTree = "<group>"; };
+ 830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMouseEventInit.h; sourceTree = "<group>"; };
831D1F291C56ECA000F5F6C0 /* HTMLDataElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDataElement.cpp; sourceTree = "<group>"; };
8329DCC21C7A6AE300730B33 /* HTMLHyperlinkElementUtils.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLHyperlinkElementUtils.idl; sourceTree = "<group>"; };
832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = "<group>"; };
@@ -10052,6 +10057,8 @@
836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; };
836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; };
8372DB301A6780A800C697C5 /* DiagnosticLoggingResultType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingResultType.h; sourceTree = "<group>"; };
+ 83765F931DAC521800C06537 /* MouseEventInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MouseEventInit.idl; sourceTree = "<group>"; };
+ 83765F941DAC521800C06537 /* MouseEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MouseEventInit.h; sourceTree = "<group>"; };
8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilder.h; sourceTree = "<group>"; };
8386A96E19F61E4F00E1EC4A /* StyleBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleBuilder.cpp; sourceTree = "<group>"; };
838867341D13BA59003697D0 /* RenderObjectEnums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderObjectEnums.h; sourceTree = "<group>"; };
@@ -19759,6 +19766,8 @@
E1ADEDD80E76BD93004A1A5E /* JSMessagePort.h */,
A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */,
A86629CB09DA2B47009633A5 /* JSMouseEvent.h */,
+ 830A36BA1DAC5FA7006D7D09 /* JSMouseEventInit.cpp */,
+ 830A36BB1DAC5FA7006D7D09 /* JSMouseEventInit.h */,
65DF31E709D1CC60000BE325 /* JSMutationEvent.cpp */,
65DF31E809D1CC60000BE325 /* JSMutationEvent.h */,
1A0D573E0A5C7867007EDD4C /* JSOverflowEvent.cpp */,
@@ -23234,6 +23243,8 @@
85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */,
85031B300A44EFC700F992E0 /* MouseEvent.h */,
141B94E509EC4223000E9413 /* MouseEvent.idl */,
+ 83765F941DAC521800C06537 /* MouseEventInit.h */,
+ 83765F931DAC521800C06537 /* MouseEventInit.idl */,
85031B310A44EFC700F992E0 /* MouseRelatedEvent.cpp */,
85031B320A44EFC700F992E0 /* MouseRelatedEvent.h */,
C6F0900114327B6100685849 /* MutationCallback.h */,
@@ -26580,6 +26591,7 @@
97BC6A571505F081001B74AC /* SQLTransactionCoordinator.h in Headers */,
97BC6A581505F081001B74AC /* SQLTransactionErrorCallback.h in Headers */,
FE36FD1816C7826500F887C1 /* SQLTransactionState.h in Headers */,
+ 83765F951DAC522F00C06537 /* MouseEventInit.h in Headers */,
FE36FD1716C7826500F887C1 /* SQLTransactionStateMachine.h in Headers */,
1A2E6E5A0CC55213004A2062 /* SQLValue.h in Headers */,
93F1996308245E59001E9ABC /* SSLKeyGenerator.h in Headers */,
@@ -27042,6 +27054,7 @@
7CC289DF1AA0FE5D009A9CE3 /* URLRegistry.h in Headers */,
93D437A21D57B3FE00AB85EA /* URLUtils.h in Headers */,
A72763BF16689BFB002FCACB /* UserActionElementSet.h in Headers */,
+ 830A36BD1DAC5FAD006D7D09 /* JSMouseEventInit.h in Headers */,
868160D618766A130021E79D /* UserActivity.h in Headers */,
26255F0318878E110006E1FD /* UserAgent.h in Headers */,
CDAB6D3117C9259500C60B34 /* UserAgentScripts.h in Headers */,
@@ -27703,6 +27716,7 @@
37DDCD9E13844FFA0008B793 /* Archive.cpp in Sources */,
512DD8FA0D91E6AF000F89EE /* ArchiveFactory.cpp in Sources */,
512DD8FB0D91E6AF000F89EE /* ArchiveResource.cpp in Sources */,
+ 830A36BC1DAC5FAD006D7D09 /* JSMouseEventInit.cpp in Sources */,
512DD8F70D91E6AF000F89EE /* ArchiveResourceCollection.cpp in Sources */,
49B3760C15C6C6840059131D /* ArrayValue.cpp in Sources */,
FD5686C913AC180200B69C68 /* AsyncAudioDecoder.cpp in Sources */,
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207040 => 207041)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-10-11 04:43:26 UTC (rev 207041)
@@ -1711,6 +1711,13 @@
my $currentInterface = shift;
push(@ancestors, $currentInterface->name);
}, 0);
+ for my $dictionary (@$dictionaries) {
+ my $parentDictionary = $dictionary->parent;
+ while (defined($parentDictionary)) {
+ push(@ancestors, $parentDictionary) if $codeGenerator->IsExternalDictionaryType($parentDictionary);
+ $parentDictionary = $codeGenerator->GetDictionaryByName($parentDictionary)->parent;
+ }
+ }
push(@depsContent, "$className.h : ", join(" ", map { "$_.idl" } @ancestors), "\n");
push(@depsContent, map { "$_.idl :\n" } @ancestors);
}
@@ -4321,6 +4328,18 @@
push(@headerContent, "\nnamespace WebCore {\n\n");
push(@headerContent, GenerateDictionaryHeaderContent($dictionary, $className));
push(@headerContent, "} // namespace WebCore\n");
+
+ # - Generate dependencies.
+ if ($writeDependencies) {
+ my @ancestors;
+ my $parentDictionary = $dictionary->parent;
+ while (defined($parentDictionary)) {
+ push(@ancestors, $parentDictionary) if $codeGenerator->IsExternalDictionaryType($parentDictionary);
+ $parentDictionary = $codeGenerator->GetDictionaryByName($parentDictionary)->parent;
+ }
+ push(@depsContent, "$className.h : ", join(" ", map { "$_.idl" } @ancestors), "\n");
+ push(@depsContent, map { "$_.idl :\n" } @ancestors);
+ }
}
sub GenerateDictionaryImplementation
Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (207040 => 207041)
--- trunk/Source/WebCore/dom/MouseEvent.cpp 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp 2016-10-11 04:43:26 UTC (rev 207041)
@@ -33,9 +33,9 @@
namespace WebCore {
-Ref<MouseEvent> MouseEvent::createForBindings(const AtomicString& type, const MouseEventInit& initializer)
+Ref<MouseEvent> MouseEvent::create(const AtomicString& type, const MouseEventInit& initializer, IsTrusted isTrusted)
{
- return adoptRef(*new MouseEvent(type, initializer));
+ return adoptRef(*new MouseEvent(type, initializer, isTrusted));
}
Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, DOMWindow* view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
@@ -130,8 +130,8 @@
initCoordinates(IntPoint(clientX, clientY));
}
-MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer)
- : MouseRelatedEvent(eventType, initializer)
+MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer, IsTrusted isTrusted)
+ : MouseRelatedEvent(eventType, initializer, isTrusted)
, m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button)
, m_buttonDown(initializer.button != (unsigned short)-1)
, m_relatedTarget(initializer.relatedTarget)
Modified: trunk/Source/WebCore/dom/MouseEvent.h (207040 => 207041)
--- trunk/Source/WebCore/dom/MouseEvent.h 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/MouseEvent.h 2016-10-11 04:43:26 UTC (rev 207041)
@@ -23,6 +23,7 @@
#pragma once
+#include "MouseEventInit.h"
#include "MouseRelatedEvent.h"
namespace WebCore {
@@ -30,13 +31,6 @@
class DataTransfer;
class PlatformMouseEvent;
-struct MouseEventInit : public MouseRelatedEventInit {
- int clientX { 0 };
- int clientY { 0 };
- unsigned short button { 0 };
- RefPtr<EventTarget> relatedTarget;
-};
-
class MouseEvent : public MouseRelatedEvent {
public:
static Ref<MouseEvent> create(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*,
@@ -67,7 +61,7 @@
return adoptRef(*new MouseEvent);
}
- static Ref<MouseEvent> createForBindings(const AtomicString& eventType, const MouseEventInit&);
+ static Ref<MouseEvent> create(const AtomicString& eventType, const MouseEventInit&, IsTrusted = IsTrusted::No);
virtual ~MouseEvent();
@@ -115,7 +109,7 @@
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey,
unsigned short button, unsigned short syntheticClickType, PassRefPtr<EventTarget> relatedTarget);
- MouseEvent(const AtomicString& type, const MouseEventInit&);
+ MouseEvent(const AtomicString& type, const MouseEventInit&, IsTrusted);
MouseEvent();
Modified: trunk/Source/WebCore/dom/MouseEvent.idl (207040 => 207041)
--- trunk/Source/WebCore/dom/MouseEvent.idl 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/MouseEvent.idl 2016-10-11 04:43:26 UTC (rev 207041)
@@ -18,23 +18,22 @@
*/
[
- ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
- ConstructorTemplate=Event,
+ Constructor(DOMString type, optional MouseEventInit eventInitDict),
DoNotCheckConstants,
] interface MouseEvent : UIEvent {
[Conditional=MOUSE_FORCE_EVENTS] const double WEBKIT_FORCE_AT_MOUSE_DOWN = 1;
[Conditional=MOUSE_FORCE_EVENTS] const double WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN = 2;
- [InitializedByEventConstructor] readonly attribute long screenX;
- [InitializedByEventConstructor] readonly attribute long screenY;
- [InitializedByEventConstructor] readonly attribute long clientX;
- [InitializedByEventConstructor] readonly attribute long clientY;
- [InitializedByEventConstructor] readonly attribute boolean ctrlKey;
- [InitializedByEventConstructor] readonly attribute boolean shiftKey;
- [InitializedByEventConstructor] readonly attribute boolean altKey;
- [InitializedByEventConstructor] readonly attribute boolean metaKey;
- [InitializedByEventConstructor] readonly attribute unsigned short button;
- [InitializedByEventConstructor] readonly attribute EventTarget? relatedTarget;
+ readonly attribute long screenX;
+ readonly attribute long screenY;
+ readonly attribute long clientX;
+ readonly attribute long clientY;
+ readonly attribute boolean ctrlKey;
+ readonly attribute boolean shiftKey;
+ readonly attribute boolean altKey;
+ readonly attribute boolean metaKey;
+ readonly attribute unsigned short button;
+ readonly attribute EventTarget? relatedTarget;
[Conditional=POINTER_LOCK] readonly attribute long movementX;
[Conditional=POINTER_LOCK] readonly attribute long movementY;
[Conditional=MOUSE_FORCE_EVENTS, ImplementedAs=force]readonly attribute double webkitForce;
Added: trunk/Source/WebCore/dom/MouseEventInit.h (0 => 207041)
--- trunk/Source/WebCore/dom/MouseEventInit.h (rev 0)
+++ trunk/Source/WebCore/dom/MouseEventInit.h 2016-10-11 04:43:26 UTC (rev 207041)
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "MouseRelatedEvent.h"
+
+namespace WebCore {
+
+struct MouseEventInit : MouseRelatedEventInit {
+ int clientX { 0 };
+ int clientY { 0 };
+ unsigned short button { 0 };
+ RefPtr<EventTarget> relatedTarget;
+};
+
+}
Added: trunk/Source/WebCore/dom/MouseEventInit.idl (0 => 207041)
--- trunk/Source/WebCore/dom/MouseEventInit.idl (rev 0)
+++ trunk/Source/WebCore/dom/MouseEventInit.idl 2016-10-11 04:43:26 UTC (rev 207041)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+dictionary MouseEventInit : EventModifierInit {
+ long screenX = 0;
+ long screenY = 0;
+ long clientX = 0;
+ long clientY = 0;
+ unsigned short button = 0;
+
+ // FIXME: We need to support the following member.
+ // unsigned short buttons = 0;
+
+ EventTarget? relatedTarget = null;
+};
Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.cpp (207040 => 207041)
--- trunk/Source/WebCore/dom/MouseRelatedEvent.cpp 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.cpp 2016-10-11 04:43:26 UTC (rev 207041)
@@ -71,8 +71,8 @@
init(isSimulated, windowLocation);
}
-MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, const MouseRelatedEventInit& initializer)
- : UIEventWithKeyState(eventType, initializer)
+MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, const MouseRelatedEventInit& initializer, IsTrusted isTrusted)
+ : UIEventWithKeyState(eventType, initializer, isTrusted)
, m_screenLocation(IntPoint(initializer.screenX, initializer.screenY))
#if ENABLE(POINTER_LOCK)
, m_movementDelta(IntPoint(0, 0))
Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.h (207040 => 207041)
--- trunk/Source/WebCore/dom/MouseRelatedEvent.h 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.h 2016-10-11 04:43:26 UTC (rev 207041)
@@ -72,7 +72,7 @@
const IntPoint& movementDelta,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
- MouseRelatedEvent(const AtomicString& type, const MouseRelatedEventInit&);
+ MouseRelatedEvent(const AtomicString& type, const MouseRelatedEventInit&, IsTrusted = IsTrusted::No);
void initCoordinates();
void initCoordinates(const LayoutPoint& clientLocation);
Modified: trunk/Source/WebCore/dom/UIEventWithKeyState.h (207040 => 207041)
--- trunk/Source/WebCore/dom/UIEventWithKeyState.h 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/UIEventWithKeyState.h 2016-10-11 04:43:26 UTC (rev 207041)
@@ -62,7 +62,7 @@
{
}
- UIEventWithKeyState(const AtomicString& type, const EventModifierInit& initializer, IsTrusted isTrusted = IsTrusted::No)
+ UIEventWithKeyState(const AtomicString& type, const EventModifierInit& initializer, IsTrusted isTrusted)
: UIEvent(type, initializer, isTrusted)
, m_ctrlKey(initializer.ctrlKey)
, m_altKey(initializer.altKey)
Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (207040 => 207041)
--- trunk/Source/WebCore/dom/WheelEvent.cpp 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp 2016-10-11 04:43:26 UTC (rev 207041)
@@ -35,16 +35,6 @@
return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL;
}
-WheelEventInit::WheelEventInit()
- : deltaX(0)
- , deltaY(0)
- , deltaZ(0)
- , deltaMode(WheelEvent::DOM_DELTA_PIXEL)
- , wheelDeltaX(0)
- , wheelDeltaY(0)
-{
-}
-
WheelEvent::WheelEvent()
: m_deltaX(0)
, m_deltaY(0)
@@ -54,8 +44,8 @@
{
}
-WheelEvent::WheelEvent(const AtomicString& type, const WheelEventInit& initializer)
- : MouseEvent(type, initializer)
+WheelEvent::WheelEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
+ : MouseEvent(type, initializer, isTrusted)
, m_wheelDelta(initializer.wheelDeltaX ? initializer.wheelDeltaX : -initializer.deltaX, initializer.wheelDeltaY ? initializer.wheelDeltaY : -initializer.deltaY)
, m_deltaX(initializer.deltaX ? initializer.deltaX : -initializer.wheelDeltaX)
, m_deltaY(initializer.deltaY ? initializer.deltaY : -initializer.wheelDeltaY)
Modified: trunk/Source/WebCore/dom/WheelEvent.h (207040 => 207041)
--- trunk/Source/WebCore/dom/WheelEvent.h 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/WheelEvent.h 2016-10-11 04:43:26 UTC (rev 207041)
@@ -32,17 +32,6 @@
class PlatformWheelEvent;
-struct WheelEventInit : public MouseEventInit {
- WheelEventInit();
-
- double deltaX;
- double deltaY;
- double deltaZ;
- unsigned deltaMode;
- int wheelDeltaX; // Deprecated.
- int wheelDeltaY; // Deprecated.
-};
-
class WheelEvent final : public MouseEvent {
public:
enum { TickMultiplier = 120 };
@@ -63,9 +52,18 @@
return adoptRef(*new WheelEvent);
}
- static Ref<WheelEvent> createForBindings(const AtomicString& type, const WheelEventInit& initializer)
+ struct Init : MouseEventInit {
+ double deltaX { 0 };
+ double deltaY { 0 };
+ double deltaZ { 0 };
+ unsigned deltaMode { DOM_DELTA_PIXEL };
+ int wheelDeltaX { 0 }; // Deprecated.
+ int wheelDeltaY { 0 }; // Deprecated.
+ };
+
+ static Ref<WheelEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
{
- return adoptRef(*new WheelEvent(type, initializer));
+ return adoptRef(*new WheelEvent(type, initializer, isTrusted));
}
WEBCORE_EXPORT void initWheelEvent(int rawDeltaX, int rawDeltaY, DOMWindow*,
@@ -96,7 +94,7 @@
private:
WheelEvent();
- WheelEvent(const AtomicString&, const WheelEventInit&);
+ WheelEvent(const AtomicString&, const Init&, IsTrusted);
WheelEvent(const PlatformWheelEvent&, DOMWindow*);
bool isWheelEvent() const override;
Modified: trunk/Source/WebCore/dom/WheelEvent.idl (207040 => 207041)
--- trunk/Source/WebCore/dom/WheelEvent.idl 2016-10-11 04:33:56 UTC (rev 207040)
+++ trunk/Source/WebCore/dom/WheelEvent.idl 2016-10-11 04:43:26 UTC (rev 207041)
@@ -20,8 +20,7 @@
*/
[
- ConstructorConditional=DOM4_EVENTS_CONSTRUCTOR,
- ConstructorTemplate=Event,
+ Constructor(DOMString type, optional WheelEventInit eventInitDict),
] interface WheelEvent : MouseEvent {
// DeltaModeCode
const unsigned long DOM_DELTA_PIXEL = 0x00;
@@ -28,14 +27,14 @@
const unsigned long DOM_DELTA_LINE = 0x01;
const unsigned long DOM_DELTA_PAGE = 0x02;
- [InitializedByEventConstructor] readonly attribute unrestricted double deltaX;
- [InitializedByEventConstructor] readonly attribute unrestricted double deltaY;
- [InitializedByEventConstructor] readonly attribute unrestricted double deltaZ;
- [InitializedByEventConstructor] readonly attribute unsigned long deltaMode;
+ readonly attribute unrestricted double deltaX;
+ readonly attribute unrestricted double deltaY;
+ readonly attribute unrestricted double deltaZ;
+ readonly attribute unsigned long deltaMode;
// Legacy MouseWheelEvent API replaced by standard WheelEvent API.
- [InitializedByEventConstructor] readonly attribute long wheelDeltaX;
- [InitializedByEventConstructor] readonly attribute long wheelDeltaY;
+ readonly attribute long wheelDeltaX;
+ readonly attribute long wheelDeltaY;
readonly attribute long wheelDelta;
readonly attribute boolean webkitDirectionInvertedFromDevice;
@@ -45,3 +44,14 @@
optional boolean ctrlKey = false, optional boolean altKey = false,
optional boolean shiftKey = false, optional boolean metaKey = false);
};
+
+dictionary WheelEventInit : MouseEventInit {
+ double deltaX = 0.0;
+ double deltaY = 0.0;
+ double deltaZ = 0.0;
+ unsigned long deltaMode = 0;
+
+ // Legacy members that we still support for backward compatibility.
+ long wheelDeltaX = 0;
+ long wheelDeltaY = 0;
+};