Commit 9ffe1ee8 authored by liberato@chromium.org's avatar liberato@chromium.org

Removed clientHeight() from MediaControlsPainter.

Relayout during paint asserts.  There were a few cases where
the layout was actually dirty during paint, causing the
clientHeight() to relayout and crash.

Instead, we now cache the last known layout size in the media
element, and use it to compute things during paint.  It would be
much nicer if we could use CSS for this, but it doesn't seem to
be possible for the media shadow controls.  They all paint as
background images.

This may also be related to crbug.com/519495 .

BUG=520914

Review URL: https://codereview.chromium.org/1296333002

git-svn-id: svn://svn.chromium.org/blink/trunk@200770 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8dba9158
......@@ -173,7 +173,10 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton(LayoutObject* object, con
if (RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) {
// Overlay play button covers the entire player, so center and draw a
// smaller button. Center in the entire element.
int mediaHeight = mediaElement->clientHeight();
const LayoutBox* box = mediaElement->layoutObject()->enclosingBox();
if (!box)
return false;
int mediaHeight = box->pixelSnappedHeight();
buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidthNew / 2);
buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeightNew / 2
+ (mediaHeight - rect.height()) / 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment