| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 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 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "core/html/HTMLVideoElement.h" | 27 #include "core/html/HTMLVideoElement.h" |
| 28 | 28 |
| 29 #include "CSSPropertyNames.h" | 29 #include "CSSPropertyNames.h" |
| 30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
| 31 #include "bindings/v8/ExceptionMessages.h" | |
| 32 #include "bindings/v8/ExceptionState.h" | 31 #include "bindings/v8/ExceptionState.h" |
| 33 #include "core/dom/Attribute.h" | 32 #include "core/dom/Attribute.h" |
| 34 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
| 35 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
| 36 #include "core/html/HTMLImageLoader.h" | 35 #include "core/html/HTMLImageLoader.h" |
| 37 #include "core/html/parser/HTMLParserIdioms.h" | 36 #include "core/html/parser/HTMLParserIdioms.h" |
| 38 #include "core/page/Settings.h" | 37 #include "core/page/Settings.h" |
| 39 #include "core/rendering/RenderImage.h" | 38 #include "core/rendering/RenderImage.h" |
| 40 #include "core/rendering/RenderVideo.h" | 39 #include "core/rendering/RenderVideo.h" |
| 41 #include "platform/UserGestureIndicator.h" | 40 #include "platform/UserGestureIndicator.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 205 } |
| 207 | 206 |
| 208 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) | 207 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) |
| 209 { | 208 { |
| 210 if (isFullscreen()) | 209 if (isFullscreen()) |
| 211 return; | 210 return; |
| 212 | 211 |
| 213 // Generate an exception if this isn't called in response to a user gesture,
or if the | 212 // Generate an exception if this isn't called in response to a user gesture,
or if the |
| 214 // element does not support fullscreen. | 213 // element does not support fullscreen. |
| 215 if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingU
serGesture()) { | 214 if (userGestureRequiredForFullscreen() && !UserGestureIndicator::processingU
serGesture()) { |
| 216 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f
ailedToExecute("enterFullscreen", "HTMLVideoElement", "This element may only ent
er fullscreen mode in response to a user gesture ('click', for example).")); | 215 exceptionState.throwDOMException(InvalidStateError, "This element may on
ly enter fullscreen mode in response to a user gesture ('click', for example).")
; |
| 217 return; | 216 return; |
| 218 } | 217 } |
| 219 if (!supportsFullscreen()) { | 218 if (!supportsFullscreen()) { |
| 220 exceptionState.throwDOMException(InvalidStateError, ExceptionMessages::f
ailedToExecute("enterFullscreen", "HTMLVideoElement", "This element does not sup
port fullscreen mode.")); | 219 exceptionState.throwDOMException(InvalidStateError, "This element does n
ot support fullscreen mode."); |
| 221 return; | 220 return; |
| 222 } | 221 } |
| 223 | 222 |
| 224 enterFullscreen(); | 223 enterFullscreen(); |
| 225 } | 224 } |
| 226 | 225 |
| 227 void HTMLVideoElement::webkitExitFullscreen() | 226 void HTMLVideoElement::webkitExitFullscreen() |
| 228 { | 227 { |
| 229 if (isFullscreen()) | 228 if (isFullscreen()) |
| 230 exitFullscreen(); | 229 exitFullscreen(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 | 264 |
| 266 KURL HTMLVideoElement::posterImageURL() const | 265 KURL HTMLVideoElement::posterImageURL() const |
| 267 { | 266 { |
| 268 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); | 267 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); |
| 269 if (url.isEmpty()) | 268 if (url.isEmpty()) |
| 270 return KURL(); | 269 return KURL(); |
| 271 return document().completeURL(url); | 270 return document().completeURL(url); |
| 272 } | 271 } |
| 273 | 272 |
| 274 } | 273 } |
| OLD | NEW |