summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/MouseEvent.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/WebCore/dom/MouseEvent.cpp
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebCore/dom/MouseEvent.cpp')
-rw-r--r--Source/WebCore/dom/MouseEvent.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/Source/WebCore/dom/MouseEvent.cpp b/Source/WebCore/dom/MouseEvent.cpp
index cf2e2660a..9edda71ea 100644
--- a/Source/WebCore/dom/MouseEvent.cpp
+++ b/Source/WebCore/dom/MouseEvent.cpp
@@ -207,22 +207,21 @@ bool MouseEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons
dispatcher->dispatchEvent(event());
bool swallowEvent = event()->defaultHandled() || event()->defaultPrevented();
+ if (event()->type() != eventNames().clickEvent || event()->detail() != 2)
+ return swallowEvent;
// Special case: If it's a double click event, we also send the dblclick event. This is not part
// of the DOM specs, but is used for compatibility with the ondblclick="" attribute. This is treated
// as a separate event in other DOM-compliant browsers like Firefox, and so we do the same.
- if (event()->type() == eventNames().clickEvent && event()->detail() == 2) {
- RefPtr<MouseEvent> doubleClickEvent = MouseEvent::create();
- doubleClickEvent->initMouseEvent(eventNames().dblclickEvent, event()->bubbles(), event()->cancelable(), event()->view(),
- event()->detail(), event()->screenX(), event()->screenY(), event()->clientX(), event()->clientY(),
- event()->ctrlKey(), event()->altKey(), event()->shiftKey(), event()->metaKey(),
- event()->button(), relatedTarget);
- if (event()->defaultHandled())
- doubleClickEvent->setDefaultHandled();
- dispatcher->dispatchEvent(doubleClickEvent);
- if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented())
- swallowEvent = true;
- }
-
+ RefPtr<MouseEvent> doubleClickEvent = MouseEvent::create();
+ doubleClickEvent->initMouseEvent(eventNames().dblclickEvent, event()->bubbles(), event()->cancelable(), event()->view(),
+ event()->detail(), event()->screenX(), event()->screenY(), event()->clientX(), event()->clientY(),
+ event()->ctrlKey(), event()->altKey(), event()->shiftKey(), event()->metaKey(),
+ event()->button(), relatedTarget);
+ if (event()->defaultHandled())
+ doubleClickEvent->setDefaultHandled();
+ EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediator::create(doubleClickEvent));
+ if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented())
+ return true;
return swallowEvent;
}