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

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEvent.cpp

Issue 2716063002: Send pointer events regardless of it being a disabled form control. (Closed)
Patch Set: Disable layout test on mac Created 3 years, 9 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/events/PointerEvent.h" 5 #include "core/events/PointerEvent.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/events/EventDispatcher.h" 8 #include "core/events/EventDispatcher.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 PointerEventDispatchMediator::PointerEventDispatchMediator( 76 PointerEventDispatchMediator::PointerEventDispatchMediator(
77 PointerEvent* pointerEvent) 77 PointerEvent* pointerEvent)
78 : EventDispatchMediator(pointerEvent) {} 78 : EventDispatchMediator(pointerEvent) {}
79 79
80 PointerEvent& PointerEventDispatchMediator::event() const { 80 PointerEvent& PointerEventDispatchMediator::event() const {
81 return toPointerEvent(EventDispatchMediator::event()); 81 return toPointerEvent(EventDispatchMediator::event());
82 } 82 }
83 83
84 DispatchEventResult PointerEventDispatchMediator::dispatchEvent( 84 DispatchEventResult PointerEventDispatchMediator::dispatchEvent(
85 EventDispatcher& dispatcher) const { 85 EventDispatcher& dispatcher) const {
86 if (isDisabledFormControl(&dispatcher.node()))
87 return DispatchEventResult::CanceledBeforeDispatch;
88
89 if (event().type().isEmpty()) 86 if (event().type().isEmpty())
90 return DispatchEventResult::NotCanceled; // Shouldn't happen. 87 return DispatchEventResult::NotCanceled; // Shouldn't happen.
91 88
92 DCHECK(!event().target() || event().target() != event().relatedTarget()); 89 DCHECK(!event().target() || event().target() != event().relatedTarget());
93 90
94 event().eventPath().adjustForRelatedTarget(dispatcher.node(), 91 event().eventPath().adjustForRelatedTarget(dispatcher.node(),
95 event().relatedTarget()); 92 event().relatedTarget());
96 93
97 return dispatcher.dispatch(); 94 return dispatcher.dispatch();
98 } 95 }
99 96
100 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/external/wpt_automation/pointerevents/pointerevent_disabled_form_control-manual-automation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698