<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[192903] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/192903">192903</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2015-12-01 13:14:46 -0800 (Tue, 01 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix anomaly where isMouseEvent returns false for wheel events
https://bugs.webkit.org/show_bug.cgi?id=151685

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Back three years ago when we made WheelEvent inherit from MouseEvent,
someone decided that isMouseEvent should return false for the wheel events.
An audit of all the callers of isMouseEvent indicated that in almost every
case, it's better to return true, so this patch does that.

All the other call sites that were checking isMouseEvent, here and in the
higher levels of WebKit, benefit from getting true even for wheel events.

* bindings/objc/DOMEvents.mm:
(kitClass): Use eventInterface instead of isMouseEvent to create the appropriate
wrapper class.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Eliminated a peculiar search and replace
mistake; &quot;stateution&quot; instead of &quot;execution&quot;.

* dom/Node.cpp:
(WebCore::Node::handleLocalEvents): Add an isWheelEvent check here so that we
will not ignore wheel events. This preserves behavior. A FIXME questions whether
that is the behavior we want.

* dom/WheelEvent.cpp:
(WebCore::WheelEvent::isMouseEvent): Deleted. No need to override and return false.
* dom/WheelEvent.h: Ditto.

* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::defaultEventHandler): Removed unneeded checks for
drag events and wheel events; both are types of mouse event, and so a single
isMouseEvent check takes care of all three of these.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent): Ditto.

Source/WebKit/win:

* DOMEventsClasses.cpp:
(DOMEvent::createInstance): Use eventInterface instead of isMouseEvent to create the appropriate
wrapper class.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMEventsmm">trunk/Source/WebCore/bindings/objc/DOMEvents.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventcpp">trunk/Source/WebCore/dom/WheelEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomWheelEventh">trunk/Source/WebCore/dom/WheelEvent.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTextAreaElementcpp">trunk/Source/WebCore/html/HTMLTextAreaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypecpp">trunk/Source/WebCore/html/TextFieldInputType.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinDOMEventsClassescpp">trunk/Source/WebKit/win/DOMEventsClasses.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/ChangeLog        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2015-12-01  Darin Adler  &lt;darin@apple.com&gt;
+
+        Fix anomaly where isMouseEvent returns false for wheel events
+        https://bugs.webkit.org/show_bug.cgi?id=151685
+
+        Reviewed by Alexey Proskuryakov.
+
+        Back three years ago when we made WheelEvent inherit from MouseEvent,
+        someone decided that isMouseEvent should return false for the wheel events.
+        An audit of all the callers of isMouseEvent indicated that in almost every
+        case, it's better to return true, so this patch does that.
+
+        All the other call sites that were checking isMouseEvent, here and in the
+        higher levels of WebKit, benefit from getting true even for wheel events.
+
+        * bindings/objc/DOMEvents.mm:
+        (kitClass): Use eventInterface instead of isMouseEvent to create the appropriate
+        wrapper class.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateConstructorDefinition): Eliminated a peculiar search and replace
+        mistake; &quot;stateution&quot; instead of &quot;execution&quot;.
+
+        * dom/Node.cpp:
+        (WebCore::Node::handleLocalEvents): Add an isWheelEvent check here so that we
+        will not ignore wheel events. This preserves behavior. A FIXME questions whether
+        that is the behavior we want.
+
+        * dom/WheelEvent.cpp:
+        (WebCore::WheelEvent::isMouseEvent): Deleted. No need to override and return false.
+        * dom/WheelEvent.h: Ditto.
+
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::defaultEventHandler): Removed unneeded checks for
+        drag events and wheel events; both are types of mouse event, and so a single
+        isMouseEvent check takes care of all three of these.
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::forwardEvent): Ditto.
+
</ins><span class="cx"> 2015-12-01  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Use Optional for matrix inverses
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMEventsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOMEvents.mm (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOMEvents.mm        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/bindings/objc/DOMEvents.mm        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -52,38 +52,41 @@
</span><span class="cx"> 
</span><span class="cx"> Class kitClass(WebCore::Event* impl)
</span><span class="cx"> {
</span><del>-    if (impl-&gt;isUIEvent()) {
-        if (impl-&gt;isKeyboardEvent())
-            return [DOMKeyboardEvent class];
-        if (impl-&gt;isMouseEvent())
-            return [DOMMouseEvent class];
</del><ins>+    switch (impl-&gt;eventInterface()) {
+    case WebCore::BeforeLoadEventInterfaceType:
+        return [DOMBeforeLoadEvent class];
+    case WebCore::KeyboardEventInterfaceType:
+        return [DOMKeyboardEvent class];
+    case WebCore::MessageEventInterfaceType:
+        return [DOMMessageEvent class];
+    case WebCore::MouseEventInterfaceType:
+        return [DOMMouseEvent class];
+    case WebCore::MutationEventInterfaceType:
+        return [DOMMutationEvent class];
+    case WebCore::OverflowEventInterfaceType:
+        return [DOMOverflowEvent class];
+    case WebCore::ProgressEventInterfaceType:
+    case WebCore::XMLHttpRequestProgressEventInterfaceType:
+        return [DOMProgressEvent class];
+    case WebCore::TextEventInterfaceType:
+        return [DOMTextEvent class];
+    case WebCore::WheelEventInterfaceType:
+        return [DOMWheelEvent class];
</ins><span class="cx"> 
</span><del>-        WebCore::EventInterface desiredInterface = impl-&gt;eventInterface();
-        if (desiredInterface == WebCore::TextEventInterfaceType)
-            return [DOMTextEvent class];
-        if (desiredInterface == WebCore::WheelEventInterfaceType)
-            return [DOMWheelEvent class];        
</del><span class="cx"> #if PLATFORM(IOS) &amp;&amp; ENABLE(TOUCH_EVENTS)
</span><del>-        if (desiredInterface == WebCore::TouchEventInterfaceType) 
-            return [DOMTouchEvent class];
</del><ins>+    case WebCore::TouchEventInterfaceType:
+        return [DOMTouchEvent class];
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(IOS_GESTURE_EVENTS) || ENABLE(MAC_GESTURE_EVENTS)
</span><del>-        if (desiredInterface == WebCore::GestureEventInterfaceType)
-            return [DOMGestureEvent class];
</del><ins>+    case WebCore::GestureEventInterfaceType:
+        return [DOMGestureEvent class];
</ins><span class="cx"> #endif
</span><del>-        return [DOMUIEvent class];
</del><ins>+
+    default:
+        if (impl-&gt;isUIEvent())
+            return [DOMUIEvent class];
+
+        return [DOMEvent class];
</ins><span class="cx">     }
</span><del>-
-    WebCore::EventInterface desiredInterface = impl-&gt;eventInterface();
-    if (desiredInterface == WebCore::MutationEventInterfaceType)
-        return [DOMMutationEvent class];
-    if (desiredInterface == WebCore::OverflowEventInterfaceType)
-        return [DOMOverflowEvent class];
-    if (desiredInterface == WebCore::MessageEventInterfaceType)
-        return [DOMMessageEvent class];
-    if (desiredInterface == WebCore::ProgressEventInterfaceType || desiredInterface == WebCore::XMLHttpRequestProgressEventInterfaceType)
-        return [DOMProgressEvent class];
-    if (desiredInterface == WebCore::BeforeLoadEventInterfaceType)
-        return [DOMBeforeLoadEvent class];
-    return [DOMEvent class];
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -4704,9 +4704,8 @@
</span><span class="cx"> {
</span><span class="cx">     auto* jsConstructor = jsCast&lt;${constructorClassName}*&gt;(state-&gt;callee());
</span><span class="cx"> 
</span><del>-    ScriptExecutionContext* stateutionContext = jsConstructor-&gt;scriptExecutionContext();
-    if (!stateutionContext)
-        return throwVMError(state, createReferenceError(state, &quot;Constructor associated stateution context is unavailable&quot;));
</del><ins>+    if (!jsConstructor-&gt;scriptExecutionContext())
+        return throwVMError(state, createReferenceError(state, &quot;Constructor associated execution context is unavailable&quot;));
</ins><span class="cx"> 
</span><span class="cx">     if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
</span><span class="cx">         return throwVMError(state, createNotEnoughArgumentsError(state));
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -2087,7 +2087,8 @@
</span><span class="cx">     if (!hasEventTargetData())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (is&lt;Element&gt;(*this) &amp;&amp; downcast&lt;Element&gt;(*this).isDisabledFormControl() &amp;&amp; event.isMouseEvent())
</del><ins>+    // FIXME: Should we deliver wheel events to disabled form controls or not?
+    if (is&lt;Element&gt;(*this) &amp;&amp; downcast&lt;Element&gt;(*this).isDisabledFormControl() &amp;&amp; event.isMouseEvent() &amp;&amp; !event.isWheelEvent())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     fireEventListeners(event);
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/WheelEvent.cpp        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -114,11 +114,6 @@
</span><span class="cx">     return WheelEventInterfaceType;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool WheelEvent::isMouseEvent() const
-{
-    return false;
-}
-
</del><span class="cx"> bool WheelEvent::isWheelEvent() const
</span><span class="cx"> {
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebCoredomWheelEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/WheelEvent.h (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/WheelEvent.h        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/dom/WheelEvent.h        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -91,7 +91,6 @@
</span><span class="cx">     bool isHorizontal() const { return m_wheelDelta.x(); }
</span><span class="cx"> 
</span><span class="cx">     virtual EventInterface eventInterface() const override;
</span><del>-    virtual bool isMouseEvent() const override;
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     PlatformWheelEventPhase phase() const { return m_wheelEvent.phase(); }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTextAreaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLTextAreaElement::defaultEventHandler(Event* event)
</span><span class="cx"> {
</span><del>-    if (renderer() &amp;&amp; (event-&gt;isMouseEvent() || event-&gt;isDragEvent() || event-&gt;eventInterface() == WheelEventInterfaceType || event-&gt;type() == eventNames().blurEvent))
</del><ins>+    if (renderer() &amp;&amp; (event-&gt;isMouseEvent() || event-&gt;type() == eventNames().blurEvent))
</ins><span class="cx">         forwardEvent(event);
</span><span class="cx">     else if (renderer() &amp;&amp; is&lt;BeforeTextInsertedEvent&gt;(*event))
</span><span class="cx">         handleBeforeTextInsertedEvent(downcast&lt;BeforeTextInsertedEvent&gt;(event));
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/TextFieldInputType.cpp        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -187,8 +187,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (event-&gt;isMouseEvent()
</span><del>-        || event-&gt;isDragEvent()
-        || event-&gt;eventInterface() == WheelEventInterfaceType
</del><span class="cx">         || event-&gt;type() == eventNames().blurEvent
</span><span class="cx">         || event-&gt;type() == eventNames().focusEvent)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebKit/win/ChangeLog        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-12-01  Darin Adler  &lt;darin@apple.com&gt;
+
+        Fix anomaly where isMouseEvent returns false for wheel events
+        https://bugs.webkit.org/show_bug.cgi?id=151685
+
+        Reviewed by Alexey Proskuryakov.
+
+        * DOMEventsClasses.cpp:
+        (DOMEvent::createInstance): Use eventInterface instead of isMouseEvent to create the appropriate
+        wrapper class.
+
</ins><span class="cx"> 2015-11-24  Per Arne Vollan  &lt;peavo@outlook.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Implement methods to get and set inner html.
</span></span></pre></div>
<a id="trunkSourceWebKitwinDOMEventsClassescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/DOMEventsClasses.cpp (192902 => 192903)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/DOMEventsClasses.cpp        2015-12-01 21:11:44 UTC (rev 192902)
+++ trunk/Source/WebKit/win/DOMEventsClasses.cpp        2015-12-01 21:14:46 UTC (rev 192903)
</span><span class="lines">@@ -105,28 +105,41 @@
</span><span class="cx">     HRESULT hr;
</span><span class="cx">     IDOMEvent* domEvent = nullptr;
</span><span class="cx"> 
</span><del>-    if (e-&gt;isKeyboardEvent()) {
</del><ins>+    switch (e-&gt;eventInterface()) {
+    case WebCore::KeyboardEventInterfaceType: {
</ins><span class="cx">         DOMKeyboardEvent* newEvent = new DOMKeyboardEvent(e);
</span><span class="cx">         hr = newEvent-&gt;QueryInterface(IID_IDOMKeyboardEvent, (void**)&amp;domEvent);
</span><del>-    } else if (e-&gt;isMouseEvent()) {
</del><ins>+        break;
+    }
+    case WebCore::MouseEventInterfaceType: {
</ins><span class="cx">         DOMMouseEvent* newEvent = new DOMMouseEvent(e);
</span><span class="cx">         hr = newEvent-&gt;QueryInterface(IID_IDOMMouseEvent, (void**)&amp;domEvent);
</span><del>-    } else if (e-&gt;eventInterface() == WebCore::MutationEventInterfaceType) {
</del><ins>+        break;
+    }
+    case WebCore::MutationEventInterfaceType: {
</ins><span class="cx">         DOMMutationEvent* newEvent = new DOMMutationEvent(e);
</span><span class="cx">         hr = newEvent-&gt;QueryInterface(IID_IDOMMutationEvent, (void**)&amp;domEvent);
</span><del>-    } else if (e-&gt;eventInterface() == WebCore::OverflowEventInterfaceType) {
</del><ins>+        break;
+    }
+    case WebCore::OverflowEventInterfaceType: {
</ins><span class="cx">         DOMOverflowEvent* newEvent = new DOMOverflowEvent(e);
</span><span class="cx">         hr = newEvent-&gt;QueryInterface(IID_IDOMOverflowEvent, (void**)&amp;domEvent);
</span><del>-    } else if (e-&gt;eventInterface() == WebCore::WheelEventInterfaceType) {
</del><ins>+        break;
+    }
+    case WebCore::WheelEventInterfaceType: {
</ins><span class="cx">         DOMWheelEvent* newEvent = new DOMWheelEvent(e);
</span><span class="cx">         hr = newEvent-&gt;QueryInterface(IID_IDOMWheelEvent, (void**)&amp;domEvent);
</span><del>-    } else if (e-&gt;isUIEvent()) {
-        DOMUIEvent* newEvent = new DOMUIEvent(e);
-        hr = newEvent-&gt;QueryInterface(IID_IDOMUIEvent, (void**)&amp;domEvent);
-    } else {
-        DOMEvent* newEvent = new DOMEvent(e);
-        hr = newEvent-&gt;QueryInterface(IID_IDOMEvent, (void**)&amp;domEvent);
</del><ins>+        break;
</ins><span class="cx">     }
</span><ins>+    default:
+        if (e-&gt;isUIEvent()) {
+            DOMUIEvent* newEvent = new DOMUIEvent(e);
+            hr = newEvent-&gt;QueryInterface(IID_IDOMUIEvent, (void**)&amp;domEvent);
+        } else {
+            DOMEvent* newEvent = new DOMEvent(e);
+            hr = newEvent-&gt;QueryInterface(IID_IDOMEvent, (void**)&amp;domEvent);
+        }
+    }
</ins><span class="cx"> 
</span><span class="cx">     if (FAILED(hr))
</span><span class="cx">         return nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>