| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 // Spec text from 4.8.6 | 91 // Spec text from 4.8.6 |
| 92 // | 92 // |
| 93 // The intrinsic width of a video element's playback area is the intrinsic w
idth | 93 // The intrinsic width of a video element's playback area is the intrinsic w
idth |
| 94 // of the video resource, if that is available; otherwise it is the intrinsi
c | 94 // of the video resource, if that is available; otherwise it is the intrinsi
c |
| 95 // width of the poster frame, if that is available; otherwise it is 300 CSS
pixels. | 95 // width of the poster frame, if that is available; otherwise it is 300 CSS
pixels. |
| 96 // | 96 // |
| 97 // The intrinsic height of a video element's playback area is the intrinsic
height | 97 // The intrinsic height of a video element's playback area is the intrinsic
height |
| 98 // of the video resource, if that is available; otherwise it is the intrinsi
c | 98 // of the video resource, if that is available; otherwise it is the intrinsi
c |
| 99 // height of the poster frame, if that is available; otherwise it is 150 CSS
pixels. | 99 // height of the poster frame, if that is available; otherwise it is 150 CSS
pixels. |
| 100 MediaPlayer* player = mediaElement()->player(); | 100 blink::WebMediaPlayer* webMediaPlayer = mediaElement()->webMediaPlayer(); |
| 101 if (player && video->readyState() >= HTMLVideoElement::HAVE_METADATA) { | 101 if (webMediaPlayer && video->readyState() >= HTMLVideoElement::HAVE_METADATA
) { |
| 102 LayoutSize size = player->naturalSize(); | 102 IntSize size = webMediaPlayer->naturalSize(); |
| 103 if (!size.isEmpty()) | 103 if (!size.isEmpty()) |
| 104 return size; | 104 return size; |
| 105 } | 105 } |
| 106 | 106 |
| 107 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im
ageResource()->errorOccurred()) | 107 if (video->shouldDisplayPosterImage() && !m_cachedImageSize.isEmpty() && !im
ageResource()->errorOccurred()) |
| 108 return m_cachedImageSize; | 108 return m_cachedImageSize; |
| 109 | 109 |
| 110 // <video> in standalone media documents should not use the default 300x150 | 110 // <video> in standalone media documents should not use the default 300x150 |
| 111 // size since they also have audio-only files. By setting the intrinsic | 111 // size since they also have audio-only files. By setting the intrinsic |
| 112 // size to 300x1 the video will resize itself in these cases, and audio will | 112 // size to 300x1 the video will resize itself in these cases, and audio will |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 return CompositingReasonVideo; | 282 return CompositingReasonVideo; |
| 283 } | 283 } |
| 284 | 284 |
| 285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated
Rendering()) | 285 if ((triggers & VideoTrigger) && shouldDisplayVideo() && supportsAccelerated
Rendering()) |
| 286 return CompositingReasonVideo; | 286 return CompositingReasonVideo; |
| 287 | 287 |
| 288 return CompositingReasonNone; | 288 return CompositingReasonNone; |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace WebCore | 291 } // namespace WebCore |
| OLD | NEW |