Chromium Code Reviews| Index: Source/core/paint/MediaControlsPainter.cpp |
| diff --git a/Source/core/paint/MediaControlsPainter.cpp b/Source/core/paint/MediaControlsPainter.cpp |
| index 21e8baebcf494a531e84babbaff431589830e6f5..e05dbf43b191f5bc33b8286dde5532989d26f1f1 100644 |
| --- a/Source/core/paint/MediaControlsPainter.cpp |
| +++ b/Source/core/paint/MediaControlsPainter.cpp |
| @@ -172,8 +172,17 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton(LayoutObject* object, con |
| IntRect buttonRect(rect); |
| 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(); |
| + // smaller button. Center in the entire element. Do not trigger |
| + // a relayout here. |
| + const LayoutSize& layoutSize = mediaElement->cachedLayoutSize(); |
| + if (layoutSize.isEmpty()) |
| + return false; |
| + int mediaHeight = layoutSize.height(); |
| + |
| + // Adjust for effective zoom. |
| + if (mediaElement->layoutObject() && mediaElement->layoutObject()->style()) |
|
fs
2015/08/18 07:39:41
I'm not sure in what cases mediaElement wouldn't h
liberato (no reviews please)
2015/08/18 16:26:41
all of this code has been removed.
|
| + mediaHeight = ceil(mediaHeight / mediaElement->layoutObject()->style()->effectiveZoom()); |
| + |
| buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidthNew / 2); |
| buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeightNew / 2 |
| + (mediaHeight - rect.height()) / 2); |