| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |