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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Spec text from 4.8.6 | 83 // Spec text from 4.8.6 |
84 // | 84 // |
85 // The intrinsic width of a video element's playback area is the intrinsic w
idth | 85 // The intrinsic width of a video element's playback area is the intrinsic w
idth |
86 // of the video resource, if that is available; otherwise it is the intrinsi
c | 86 // of the video resource, if that is available; otherwise it is the intrinsi
c |
87 // width of the poster frame, if that is available; otherwise it is 300 CSS
pixels. | 87 // width of the poster frame, if that is available; otherwise it is 300 CSS
pixels. |
88 // | 88 // |
89 // The intrinsic height of a video element's playback area is the intrinsic
height | 89 // The intrinsic height of a video element's playback area is the intrinsic
height |
90 // of the video resource, if that is available; otherwise it is the intrinsi
c | 90 // of the video resource, if that is available; otherwise it is the intrinsi
c |
91 // height of the poster frame, if that is available; otherwise it is 150 CSS
pixels. | 91 // height of the poster frame, if that is available; otherwise it is 150 CSS
pixels. |
92 WebMediaPlayer* webMediaPlayer = mediaElement()->webMediaPlayer(); | 92 WebMediaPlayer* webMediaPlayer = mediaElement()->webMediaPlayer(); |
93 if (webMediaPlayer && video->readyState() >= HTMLVideoElement::HAVE_METADATA
) { | 93 if (webMediaPlayer && video->getReadyState() >= HTMLVideoElement::HAVE_METAD
ATA) { |
94 IntSize size = webMediaPlayer->naturalSize(); | 94 IntSize size = webMediaPlayer->naturalSize(); |
95 if (!size.isEmpty()) | 95 if (!size.isEmpty()) |
96 return LayoutSize(size); | 96 return LayoutSize(size); |
97 } | 97 } |
98 | 98 |
99 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im
ageResource()->errorOccurred()) | 99 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im
ageResource()->errorOccurred()) |
100 return m_cachedImageSize; | 100 return m_cachedImageSize; |
101 | 101 |
102 // <video> in standalone media documents should not use the default 300x150 | 102 // <video> in standalone media documents should not use the default 300x150 |
103 // size since they also have audio-only files. By setting the intrinsic | 103 // size since they also have audio-only files. By setting the intrinsic |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) | 244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) |
245 return CompositingReasonVideo; | 245 return CompositingReasonVideo; |
246 | 246 |
247 if (shouldDisplayVideo() && supportsAcceleratedRendering()) | 247 if (shouldDisplayVideo() && supportsAcceleratedRendering()) |
248 return CompositingReasonVideo; | 248 return CompositingReasonVideo; |
249 | 249 |
250 return CompositingReasonNone; | 250 return CompositingReasonNone; |
251 } | 251 } |
252 | 252 |
253 } // namespace blink | 253 } // namespace blink |
OLD | NEW |