https://bugs.webkit.org/show_bug.cgi?id=156878
Reviewed by Simon Fraser.
In order to layout video element properly we need to know the correct intrinsic size.
This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::updateIntrinsicSize):
(WebCore::RenderVideo::layout):
(WebCore::RenderVideo::updatePlayer):
* rendering/RenderVideo.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199856
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-04-21 Zalan Bujtas <zalan@apple.com>
+
+ RenderVideo should always update the intrinsic size before layout.
+ https://bugs.webkit.org/show_bug.cgi?id=156878
+
+ Reviewed by Simon Fraser.
+
+ In order to layout video element properly we need to know the correct intrinsic size.
+ This patch also asserts if we end up updating the intrinsic size right after finishing video renderer layout.
+
+ This issues was discovered as part of webkit.org/b/156245. (hence covered by existing tests)
+
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::updateIntrinsicSize):
+ (WebCore::RenderVideo::layout):
+ (WebCore::RenderVideo::updatePlayer):
+ * rendering/RenderVideo.h:
+
2016-04-21 Brady Eidson <beidson@apple.com>
Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
2016-04-21 Brady Eidson <beidson@apple.com>
Modern IDB (Workers): Get the IDBConnectionProxy from the Document to the WorkerGlobalScope.
-void RenderVideo::updateIntrinsicSize()
+bool RenderVideo::updateIntrinsicSize()
{
LayoutSize size = calculateIntrinsicSize();
size.scale(style().effectiveZoom());
// Never set the element size to zero when in a media document.
if (size.isEmpty() && document().isMediaDocument())
{
LayoutSize size = calculateIntrinsicSize();
size.scale(style().effectiveZoom());
// Never set the element size to zero when in a media document.
if (size.isEmpty() && document().isMediaDocument())
if (size == intrinsicSize())
if (size == intrinsicSize())
setIntrinsicSize(size);
setPreferredLogicalWidthsDirty(true);
setNeedsLayout();
setIntrinsicSize(size);
setPreferredLogicalWidthsDirty(true);
setNeedsLayout();
}
LayoutSize RenderVideo::calculateIntrinsicSize()
}
LayoutSize RenderVideo::calculateIntrinsicSize()
void RenderVideo::layout()
{
StackStats::LayoutCheckPoint layoutCheckPoint;
void RenderVideo::layout()
{
StackStats::LayoutCheckPoint layoutCheckPoint;
RenderMedia::layout();
updatePlayer();
}
RenderMedia::layout();
updatePlayer();
}
if (documentBeingDestroyed())
return;
if (documentBeingDestroyed())
return;
+ bool intrinsicSizeChanged;
+ intrinsicSizeChanged = updateIntrinsicSize();
+ ASSERT_UNUSED(intrinsicSizeChanged, !intrinsicSizeChanged || !view().frameView().isInRenderTreeLayout());
MediaPlayer* mediaPlayer = videoElement().player();
if (!mediaPlayer)
MediaPlayer* mediaPlayer = videoElement().player();
if (!mediaPlayer)
void intrinsicSizeChanged() override;
LayoutSize calculateIntrinsicSize();
void intrinsicSizeChanged() override;
LayoutSize calculateIntrinsicSize();
- void updateIntrinsicSize();
+ bool updateIntrinsicSize();
void imageChanged(WrappedImagePtr, const IntRect*) override;
void imageChanged(WrappedImagePtr, const IntRect*) override;