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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 if (renderer()) | 114 if (renderer()) |
115 toRenderImage(renderer())->imageResource()->setImageResource(0); | 115 toRenderImage(renderer())->imageResource()->setImageResource(0); |
116 } | 116 } |
117 // Notify the player when the poster image URL changes. | 117 // Notify the player when the poster image URL changes. |
118 if (player()) | 118 if (player()) |
119 player()->setPoster(posterImageURL()); | 119 player()->setPoster(posterImageURL()); |
120 } else | 120 } else |
121 HTMLMediaElement::parseAttribute(name, value); | 121 HTMLMediaElement::parseAttribute(name, value); |
122 } | 122 } |
123 | 123 |
| 124 bool HTMLVideoElement::supportsFullscreen() const |
| 125 { |
| 126 if (!document().page()) |
| 127 return false; |
| 128 |
| 129 if (!player()) |
| 130 return false; |
| 131 |
| 132 return true; |
| 133 } |
| 134 |
124 unsigned HTMLVideoElement::videoWidth() const | 135 unsigned HTMLVideoElement::videoWidth() const |
125 { | 136 { |
126 if (!player()) | 137 if (!player()) |
127 return 0; | 138 return 0; |
128 return player()->naturalSize().width(); | 139 return player()->naturalSize().width(); |
129 } | 140 } |
130 | 141 |
131 unsigned HTMLVideoElement::videoHeight() const | 142 unsigned HTMLVideoElement::videoHeight() const |
132 { | 143 { |
133 if (!player()) | 144 if (!player()) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 201 } |
191 | 202 |
192 bool HTMLVideoElement::hasAvailableVideoFrame() const | 203 bool HTMLVideoElement::hasAvailableVideoFrame() const |
193 { | 204 { |
194 if (!player()) | 205 if (!player()) |
195 return false; | 206 return false; |
196 | 207 |
197 return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCu
rrentData; | 208 return player()->hasVideo() && player()->readyState() >= MediaPlayer::HaveCu
rrentData; |
198 } | 209 } |
199 | 210 |
| 211 void HTMLVideoElement::webkitEnterFullscreen(ExceptionState& exceptionState) |
| 212 { |
| 213 if (isFullscreen()) |
| 214 return; |
| 215 |
| 216 if (!supportsFullscreen()) { |
| 217 exceptionState.throwDOMException(InvalidStateError, "This element does n
ot support fullscreen mode."); |
| 218 return; |
| 219 } |
| 220 |
| 221 enterFullscreen(); |
| 222 } |
| 223 |
| 224 void HTMLVideoElement::webkitExitFullscreen() |
| 225 { |
| 226 if (isFullscreen()) |
| 227 exitFullscreen(); |
| 228 } |
| 229 |
| 230 bool HTMLVideoElement::webkitSupportsFullscreen() |
| 231 { |
| 232 return supportsFullscreen(); |
| 233 } |
| 234 |
| 235 bool HTMLVideoElement::webkitDisplayingFullscreen() |
| 236 { |
| 237 return isFullscreen(); |
| 238 } |
| 239 |
200 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) | 240 void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument) |
201 { | 241 { |
202 if (m_imageLoader) | 242 if (m_imageLoader) |
203 m_imageLoader->elementDidMoveToNewDocument(); | 243 m_imageLoader->elementDidMoveToNewDocument(); |
204 HTMLMediaElement::didMoveToNewDocument(oldDocument); | 244 HTMLMediaElement::didMoveToNewDocument(oldDocument); |
205 } | 245 } |
206 | 246 |
207 unsigned HTMLVideoElement::webkitDecodedFrameCount() const | 247 unsigned HTMLVideoElement::webkitDecodedFrameCount() const |
208 { | 248 { |
209 if (!player()) | 249 if (!player()) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 { | 297 { |
258 return !hasSingleSecurityOrigin() || (!(player() && player()->didPassCORSAcc
essCheck()) && destinationSecurityOrigin->taintsCanvas(currentSrc())); | 298 return !hasSingleSecurityOrigin() || (!(player() && player()->didPassCORSAcc
essCheck()) && destinationSecurityOrigin->taintsCanvas(currentSrc())); |
259 } | 299 } |
260 | 300 |
261 FloatSize HTMLVideoElement::sourceSize() const | 301 FloatSize HTMLVideoElement::sourceSize() const |
262 { | 302 { |
263 return FloatSize(videoWidth(), videoHeight()); | 303 return FloatSize(videoWidth(), videoHeight()); |
264 } | 304 } |
265 | 305 |
266 } | 306 } |
OLD | NEW |