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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp

Issue 2219673004: Adjust MediaControls for effective zoom when dropping controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reorganized conditionals Created 4 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 | « third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
index abb61be1737dbf90b0fbd6bf02ba85b5ec31cd1f..439d99210e77e9af92bf438d7df587fef0aa61a0 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -706,9 +706,11 @@ void MediaControls::computeWhichControlsFit()
// should be available the first time we're called after layout. This will
// also be the first time we have m_panelWidth!=0, so it won't matter if
// we get this wrong before that.
- int minimumWidth = (m_playButton->layoutObject() && m_playButton->layoutObject()->style())
- ? m_playButton->layoutObject()->style()->width().pixels()
- : 48;
+ int minimumWidth = 48;
+ if (m_playButton->layoutObject() && m_playButton->layoutObject()->style()) {
+ const ComputedStyle* style = m_playButton->layoutObject()->style();
+ minimumWidth = ceil(style->width().pixels() / style->effectiveZoom());
+ }
// Special-case the play button; it always fits.
if (m_playButton->isWanted()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/media/media-controls-fit-properly-while-zoomed.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698