| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 104 // size to 300x1 the video will resize itself in these cases, and audio will | 104 // size to 300x1 the video will resize itself in these cases, and audio will |
| 105 // have the correct height (it needs to be > 0 for controls to layout proper
ly). | 105 // have the correct height (it needs to be > 0 for controls to layout proper
ly). |
| 106 if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) | 106 if (video->ownerDocument() && video->ownerDocument()->isMediaDocument()) |
| 107 return LayoutSize(defaultSize().width(), 1); | 107 return LayoutSize(defaultSize().width(), LayoutUnit(1)); |
| 108 | 108 |
| 109 return defaultSize(); | 109 return defaultSize(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void LayoutVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect) | 112 void LayoutVideo::imageChanged(WrappedImagePtr newImage, const IntRect* rect) |
| 113 { | 113 { |
| 114 LayoutMedia::imageChanged(newImage, rect); | 114 LayoutMedia::imageChanged(newImage, rect); |
| 115 | 115 |
| 116 // Cache the image intrinsic size so we can continue to use it to draw the i
mage correctly | 116 // Cache the image intrinsic size so we can continue to use it to draw the i
mage correctly |
| 117 // even if we know the video intrinsic size but aren't able to draw video fr
ames yet | 117 // even if we know the video intrinsic size but aren't able to draw video fr
ames yet |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) | 250 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) |
| 251 return CompositingReasonVideo; | 251 return CompositingReasonVideo; |
| 252 | 252 |
| 253 if (shouldDisplayVideo() && supportsAcceleratedRendering()) | 253 if (shouldDisplayVideo() && supportsAcceleratedRendering()) |
| 254 return CompositingReasonVideo; | 254 return CompositingReasonVideo; |
| 255 | 255 |
| 256 return CompositingReasonNone; | 256 return CompositingReasonNone; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace blink | 259 } // namespace blink |
| OLD | NEW |