Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: Source/core/dom/Node.cpp

Issue 894913002: Prevent default actions for JS-generated mouse events other than click (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: changed failing tests to use eventsender Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2053 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event)); 2053 dispatchScopedEventDispatchMediator(EventDispatchMediator::create(event));
2054 } 2054 }
2055 2055
2056 void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa tchMediator> eventDispatchMediator) 2056 void Node::dispatchScopedEventDispatchMediator(PassRefPtrWillBeRawPtr<EventDispa tchMediator> eventDispatchMediator)
2057 { 2057 {
2058 EventDispatcher::dispatchScopedEvent(*this, eventDispatchMediator); 2058 EventDispatcher::dispatchScopedEvent(*this, eventDispatchMediator);
2059 } 2059 }
2060 2060
2061 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) 2061 bool Node::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event)
2062 { 2062 {
2063 if (event->isMouseEvent()) 2063 if (event->isMouseEvent()) {
2064 return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator: :create(static_pointer_cast<MouseEvent>(event), MouseEventDispatchMediator::Synt heticMouseEvent)); 2064 toMouseEvent(*event).setFromScript();
2065 return EventDispatcher::dispatchEvent(*this, MouseEventDispatchMediator: :create(static_pointer_cast<MouseEvent>(event)));
2066 }
2065 if (event->isTouchEvent()) 2067 if (event->isTouchEvent())
2066 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event)); 2068 return dispatchTouchEvent(static_pointer_cast<TouchEvent>(event));
2067 return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(e vent)); 2069 return EventDispatcher::dispatchEvent(*this, EventDispatchMediator::create(e vent));
2068 } 2070 }
2069 2071
2070 void Node::dispatchSubtreeModifiedEvent() 2072 void Node::dispatchSubtreeModifiedEvent()
2071 { 2073 {
2072 if (isInShadowTree()) 2074 if (isInShadowTree())
2073 return; 2075 return;
2074 2076
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
2448 node->showTreeForThis(); 2450 node->showTreeForThis();
2449 } 2451 }
2450 2452
2451 void showNodePath(const blink::Node* node) 2453 void showNodePath(const blink::Node* node)
2452 { 2454 {
2453 if (node) 2455 if (node)
2454 node->showNodePathForThis(); 2456 node->showNodePathForThis();
2455 } 2457 }
2456 2458
2457 #endif 2459 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698