Diff
Modified: trunk/Source/WebCore/ChangeLog (224114 => 224115)
--- trunk/Source/WebCore/ChangeLog 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/ChangeLog 2017-10-27 16:49:56 UTC (rev 224115)
@@ -1,5 +1,29 @@
2017-10-27 Chris Dumez <[email protected]>
+ Audit init*Event() method to make sure they reset internal data members
+ https://bugs.webkit.org/show_bug.cgi?id=178886
+
+ Reviewed by Ryosuke Niwa.
+
+ Audit init*Event() method to make sure they reset internal data members.
+
+ * dom/Event.cpp:
+ (WebCore::Event::initEvent):
+ * dom/KeyboardEvent.cpp:
+ (WebCore::KeyboardEvent::initKeyboardEvent):
+ * dom/MessageEvent.cpp:
+ (WebCore::MessageEvent::initMessageEvent):
+ * dom/MouseEvent.cpp:
+ (WebCore::MouseEvent::initMouseEvent):
+ * dom/MouseRelatedEvent.h:
+ (WebCore::MouseRelatedEvent::setIsSimulated):
+ * dom/TextEvent.cpp:
+ (WebCore::TextEvent::initTextEvent):
+ * dom/WheelEvent.cpp:
+ (WebCore::WheelEvent::initWheelEvent):
+
+2017-10-27 Chris Dumez <[email protected]>
+
Add initial support for serviceWorkerClient.postMessage()
https://bugs.webkit.org/show_bug.cgi?id=178794
Modified: trunk/Source/WebCore/dom/Event.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/Event.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/Event.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -89,6 +89,8 @@
m_type = eventTypeArg;
m_canBubble = canBubbleArg;
m_cancelable = cancelableArg;
+
+ m_underlyingEvent = nullptr;
}
bool Event::composed() const
Modified: trunk/Source/WebCore/dom/KeyboardEvent.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/KeyboardEvent.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/KeyboardEvent.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -157,6 +157,7 @@
initUIEvent(type, canBubble, cancelable, view, 0);
+ m_keyEvent = nullptr;
m_keyIdentifier = keyIdentifier;
m_location = location;
m_ctrlKey = ctrlKey;
@@ -164,6 +165,11 @@
m_altKey = altKey;
m_metaKey = metaKey;
m_altGraphKey = altGraphKey;
+
+#if PLATFORM(COCOA)
+ m_handledByInputMethod = false;
+ m_keypressCommands = { };
+#endif
}
bool KeyboardEvent::getModifierState(const String& keyIdentifier) const
Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/MessageEvent.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -144,6 +144,9 @@
m_dataAsScriptValue = Deprecated::ScriptValue(state.vm(), data);
m_dataAsSerializedScriptValue = nullptr;
m_triedToSerialize = false;
+ m_dataAsString = { };
+ m_dataAsBlob = nullptr;
+ m_dataAsArrayBuffer = nullptr;
m_origin = origin;
m_lastEventId = lastEventId;
m_source = WTFMove(source);
Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/MouseEvent.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -146,8 +146,8 @@
initCoordinates(IntPoint(clientX, clientY));
- // FIXME: m_isSimulated is not set to false here.
- // FIXME: m_dataTransfer is not set to 0 here.
+ setIsSimulated(false);
+ m_dataTransfer = nullptr;
}
// FIXME: We need this quirk because iAd Producer is calling this function with a relatedTarget that is not an EventTarget (rdar://problem/30640101).
Modified: trunk/Source/WebCore/dom/MouseRelatedEvent.h (224114 => 224115)
--- trunk/Source/WebCore/dom/MouseRelatedEvent.h 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/MouseRelatedEvent.h 2017-10-27 16:49:56 UTC (rev 224115)
@@ -55,6 +55,7 @@
WEBCORE_EXPORT int offsetX();
WEBCORE_EXPORT int offsetY();
bool isSimulated() const { return m_isSimulated; }
+ void setIsSimulated(bool value) { m_isSimulated = value; }
int pageX() const final;
int pageY() const final;
WEBCORE_EXPORT FloatPoint locationInRootViewCoordinates() const;
Modified: trunk/Source/WebCore/dom/TextEvent.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/TextEvent.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/TextEvent.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -112,7 +112,15 @@
initUIEvent(type, canBubble, cancelable, view, 0);
+ m_inputType = TextEventInputKeyboard;
+
m_data = data;
+
+ m_pastingFragment = nullptr;
+ m_shouldSmartReplace = false;
+ m_shouldMatchStyle = false;
+ m_mailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote;
+ m_dictationAlternatives = { };
}
EventInterface TextEvent::eventInterface() const
Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (224114 => 224115)
--- trunk/Source/WebCore/dom/WheelEvent.cpp 2017-10-27 16:38:36 UTC (rev 224114)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp 2017-10-27 16:49:56 UTC (rev 224115)
@@ -69,13 +69,7 @@
if (isBeingDispatched())
return;
- initUIEvent(eventNames().wheelEvent, true, true, view, 0);
-
- m_screenLocation = { screenX, screenY };
- m_ctrlKey = ctrlKey;
- m_altKey = altKey;
- m_shiftKey = shiftKey;
- m_metaKey = metaKey;
+ initMouseEvent(eventNames().wheelEvent, true, true, view, 0, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey, 0, nullptr);
// Normalize to 120 multiple for compatibility with IE.
m_wheelDelta = { rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier };
@@ -84,7 +78,8 @@
m_deltaMode = DOM_DELTA_PIXEL;
- initCoordinates({ pageX, pageY });
+ m_initializedWithPlatformWheelEvent = false;
+ m_wheelEvent = { };
}
EventInterface WheelEvent::eventInterface() const