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

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

Issue 1578853002: [m48 merge] Remove clientWidth call during MediaControls::reset. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2564
Patch Set: nopresubmit / notry Created 4 years, 11 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 | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp » ('j') | 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 5ae1bf111926b3e06c1b2177035ac8772c686334..c5084915b9490eb8992e6a2e24f81cdc611b44b4 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControls.cpp
@@ -260,13 +260,6 @@ void MediaControls::reset()
m_fullScreenButton->setIsWanted(shouldShowFullscreenButton(mediaElement()));
refreshCastButtonVisibilityWithoutUpdate();
-
- // Set the panel width here, and force a layout, before the controls update.
- // This would be harmless for the !useNewUi case too, but it causes
- // compositing/geometry/video-fixed-scrolling.html to fail with two extra
- // 0 height nodes in the render tree.
- if (useNewUi)
- m_panelWidth = m_panel->clientWidth();
}
LayoutObject* MediaControls::layoutObjectForTextTrackLayout()
@@ -652,9 +645,6 @@ void MediaControls::computeWhichControlsFit()
if (!RuntimeEnabledFeatures::newMediaPlaybackUiEnabled())
return;
- if (!m_panelWidth)
- return;
-
// Controls that we'll hide / show, in order of decreasing priority.
MediaControlElement* elements[] = {
m_playButton.get(),
@@ -668,6 +658,18 @@ void MediaControls::computeWhichControlsFit()
m_durationDisplay.get(),
};
+ if (!m_panelWidth) {
+ // No layout yet -- hide everything, then make them show up later.
+ // This prevents the wrong controls from being shown briefly
+ // immediately after the first layout and paint, but before we have
+ // a chance to revise them.
+ for (MediaControlElement* element : elements) {
+ if (element)
+ element->setDoesFit(false);
+ }
+ return;
+ }
+
int usedWidth = 0;
bool droppedCastButton = false;
// Assume that all controls require 48px. Ideally, we could get this
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698