Changeset 199856 in webkit
- Timestamp:
- Apr 21, 2016 6:13:33 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r199853 r199856 1 2016-04-21 Zalan Bujtas <zalan@apple.com> 2 3 RenderVideo should always update the intrinsic size before layout. 4 https://bugs.webkit.org/show_bug.cgi?id=156878 5 6 Reviewed by Simon Fraser. 7 8 In order to layout video element properly we need to know the correct intrinsic size. 9 This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout. 10 11 This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests) 12 13 * rendering/RenderVideo.cpp: 14 (WebCore::RenderVideo::updateIntrinsicSize): 15 (WebCore::RenderVideo::layout): 16 (WebCore::RenderVideo::updatePlayer): 17 * rendering/RenderVideo.h: 18 1 19 2016-04-21 Brady Eidson <beidson@apple.com> 2 20 -
trunk/Source/WebCore/rendering/RenderVideo.cpp
r194496 r199856 77 77 } 78 78 79 voidRenderVideo::updateIntrinsicSize()79 bool RenderVideo::updateIntrinsicSize() 80 80 { 81 81 LayoutSize size = calculateIntrinsicSize(); … … 84 84 // Never set the element size to zero when in a media document. 85 85 if (size.isEmpty() && document().isMediaDocument()) 86 return ;86 return false; 87 87 88 88 if (size == intrinsicSize()) 89 return ;89 return false; 90 90 91 91 setIntrinsicSize(size); 92 92 setPreferredLogicalWidthsDirty(true); 93 93 setNeedsLayout(); 94 return true; 94 95 } 95 96 … … 200 201 { 201 202 StackStats::LayoutCheckPoint layoutCheckPoint; 203 updateIntrinsicSize(); 202 204 RenderMedia::layout(); 203 205 updatePlayer(); … … 220 222 return; 221 223 222 updateIntrinsicSize(); 224 bool intrinsicSizeChanged; 225 intrinsicSizeChanged = updateIntrinsicSize(); 226 ASSERT_UNUSED(intrinsicSizeChanged, !intrinsicSizeChanged || !view().frameView().isInRenderTreeLayout()); 223 227 224 228 MediaPlayer* mediaPlayer = videoElement().player(); -
trunk/Source/WebCore/rendering/RenderVideo.h
r197563 r199856 60 60 void intrinsicSizeChanged() override; 61 61 LayoutSize calculateIntrinsicSize(); 62 voidupdateIntrinsicSize();62 bool updateIntrinsicSize(); 63 63 64 64 void imageChanged(WrappedImagePtr, const IntRect*) override;
Note: See TracChangeset
for help on using the changeset viewer.