Index: Source/core/events/TouchEvent.cpp |
diff --git a/Source/core/events/TouchEvent.cpp b/Source/core/events/TouchEvent.cpp |
index f252c9a155de4d8f7ae1a1d6ad339e77be6bbb3e..6c28ef62ec1011334c9988789201df4f271e7028 100644 |
--- a/Source/core/events/TouchEvent.cpp |
+++ b/Source/core/events/TouchEvent.cpp |
@@ -29,6 +29,8 @@ |
#include "core/events/TouchEvent.h" |
#include "core/events/EventDispatcher.h" |
+#include "core/frame/FrameConsole.h" |
+#include "core/frame/LocalFrame.h" |
namespace WebCore { |
@@ -91,6 +93,18 @@ bool TouchEvent::isTouchEvent() const |
return true; |
} |
+void TouchEvent::preventDefault() |
+{ |
+ MouseRelatedEvent::preventDefault(); |
+ |
+ if (!cancelable()) { |
pfeldman
2014/05/07 15:36:21
Blink's recommendation is to stack guard expressio
|
+ LocalFrame* frame = view() ? view()->frame() : 0; |
+ if (frame) { |
+ frame->console().addMessage(JSMessageSource, WarningMessageLevel, |
+ "Ignored attempt to cancel a " + type() + " event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."); |
+ } |
+ } |
+} |
void TouchEvent::trace(Visitor* visitor) |
{ |
visitor->trace(m_touches); |