| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 Tokenizer* MediaDocument::createTokenizer() | 141 Tokenizer* MediaDocument::createTokenizer() |
| 142 { | 142 { |
| 143 return new MediaTokenizer(this); | 143 return new MediaTokenizer(this); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void MediaDocument::defaultEventHandler(Event* event) | 146 void MediaDocument::defaultEventHandler(Event* event) |
| 147 { | 147 { |
| 148 // Match the default Quicktime plugin behavior to allow | 148 // Match the default Quicktime plugin behavior to allow |
| 149 // clicking and double-clicking to pause and play the media. | 149 // clicking and double-clicking to pause and play the media. |
| 150 Node* targetNode = event->target()->toNode(); | 150 EventTargetNode* targetNode = event->target()->toNode(); |
| 151 if (targetNode && targetNode->hasTagName(videoTag)) { | 151 if (targetNode && targetNode->hasTagName(videoTag)) { |
| 152 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(targetNode); | 152 HTMLVideoElement* video = static_cast<HTMLVideoElement*>(targetNode); |
| 153 ExceptionCode ec; | 153 ExceptionCode ec; |
| 154 if (event->type() == eventNames().clickEvent) { | 154 if (event->type() == eventNames().clickEvent) { |
| 155 if (!video->canPlay()) { | 155 if (!video->canPlay()) { |
| 156 video->pause(ec); | 156 video->pause(ec); |
| 157 event->setDefaultHandled(); | 157 event->setDefaultHandled(); |
| 158 } | 158 } |
| 159 } else if (event->type() == eventNames().dblclickEvent) { | 159 } else if (event->type() == eventNames().dblclickEvent) { |
| 160 if (video->canPlay()) { | 160 if (video->canPlay()) { |
| 161 video->play(ec); | 161 video->play(ec); |
| 162 event->setDefaultHandled(); | 162 event->setDefaultHandled(); |
| 163 } | 163 } |
| 164 } | 164 } |
| 165 } | 165 } |
| 166 } | 166 } |
| 167 | 167 |
| 168 } | 168 } |
| 169 #endif | 169 #endif |
| OLD | NEW |