Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: Source/core/paint/MediaControlsPainter.cpp

Issue 1296333002: Removed clientHeight() from MediaControlsPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed TODO. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutMedia.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/layout/LayoutMedia.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698