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

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

Issue 2536563003: Fix missing warning for canceling touchmove when in default not passive mode. (Closed)
Patch Set: Fix test Created 4 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/touch/touch-event-cancelable-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void TouchEvent::preventDefault() { 257 void TouchEvent::preventDefault() {
258 UIEventWithKeyState::preventDefault(); 258 UIEventWithKeyState::preventDefault();
259 259
260 // A common developer error is to wait too long before attempting to stop 260 // A common developer error is to wait too long before attempting to stop
261 // scrolling by consuming a touchmove event. Generate a warning if this 261 // scrolling by consuming a touchmove event. Generate a warning if this
262 // event is uncancelable. 262 // event is uncancelable.
263 String warningMessage; 263 String warningMessage;
264 switch (handlingPassive()) { 264 switch (handlingPassive()) {
265 case PassiveMode::NotPassive: 265 case PassiveMode::NotPassive:
266 case PassiveMode::NotPassiveDefault:
266 if (!cancelable()) { 267 if (!cancelable()) {
267 warningMessage = "Ignored attempt to cancel a " + type() + 268 warningMessage = "Ignored attempt to cancel a " + type() +
268 " event with cancelable=false, for example " 269 " event with cancelable=false, for example "
269 "because scrolling is in progress and " 270 "because scrolling is in progress and "
270 "cannot be interrupted."; 271 "cannot be interrupted.";
271 } 272 }
272 break; 273 break;
273 case PassiveMode::PassiveForcedDocumentLevel: 274 case PassiveMode::PassiveForcedDocumentLevel:
274 // Only enable the warning when the current touch action is auto because 275 // Only enable the warning when the current touch action is auto because
275 // an author may use touch action but call preventDefault for interop with 276 // an author may use touch action but call preventDefault for interop with
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return toTouchEvent(EventDispatchMediator::event()); 349 return toTouchEvent(EventDispatchMediator::event());
349 } 350 }
350 351
351 DispatchEventResult TouchEventDispatchMediator::dispatchEvent( 352 DispatchEventResult TouchEventDispatchMediator::dispatchEvent(
352 EventDispatcher& dispatcher) const { 353 EventDispatcher& dispatcher) const {
353 event().eventPath().adjustForTouchEvent(event()); 354 event().eventPath().adjustForTouchEvent(event());
354 return dispatcher.dispatch(); 355 return dispatcher.dispatch();
355 } 356 }
356 357
357 } // namespace blink 358 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/events/touch/touch-event-cancelable-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698