OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 Node* targetNode = event->target()->toNode(); | 249 Node* targetNode = event->target()->toNode(); |
250 if (!targetNode) | 250 if (!targetNode) |
251 return; | 251 return; |
252 | 252 |
253 if (event->type() == EventTypeNames::keydown && event->isKeyboardEvent()) { | 253 if (event->type() == EventTypeNames::keydown && event->isKeyboardEvent()) { |
254 HTMLVideoElement* video = Traversal<HTMLVideoElement>::firstWithin(*targ
etNode); | 254 HTMLVideoElement* video = Traversal<HTMLVideoElement>::firstWithin(*targ
etNode); |
255 if (!video) | 255 if (!video) |
256 return; | 256 return; |
257 | 257 |
258 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); | 258 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); |
259 if (keyboardEvent->keyIdentifier() == "U+0020" || keyboardEvent->keyCode
() == VKEY_MEDIA_PLAY_PAUSE) { | 259 if (keyboardEvent->key() == " " || keyboardEvent->keyCode() == VKEY_MEDI
A_PLAY_PAUSE) { |
260 // space or media key (play/pause) | 260 // space or media key (play/pause) |
261 video->togglePlayState(); | 261 video->togglePlayState(); |
262 event->setDefaultHandled(); | 262 event->setDefaultHandled(); |
263 } | 263 } |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 } // namespace blink | 267 } // namespace blink |
OLD | NEW |