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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMedia.cpp

Issue 2701433003: Hide overlay play button if it can't be shown without clipping (Closed)
Patch Set: Add delay to layout test to allow ResizeObserver to run Created 3 years, 10 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
Index: third_party/WebKit/Source/core/layout/LayoutMedia.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
index ae50013ff9ecb3b817429f21eccb38bf6018c019..c5cfabd5438825095e56c340f62c4091a9059c36 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
@@ -54,7 +54,9 @@ void LayoutMedia::layout() {
LayoutState state(*this);
- Optional<LayoutUnit> newPanelWidth;
+ // Used to notify MediaControls of initial size.
+ Optional<LayoutUnit> newWidth;
+ Optional<LayoutUnit> newHeight;
// Iterate the children in reverse order so that the media controls are laid
// out before the text track container. This is to ensure that the text
@@ -83,7 +85,8 @@ void LayoutMedia::layout() {
LayoutUnit width = newRect.width();
if (child->node()->isMediaControls()) {
width = computePanelWidth(newRect);
- newPanelWidth = width;
+ newWidth = width;
+ newHeight = newRect.height();
}
LayoutBox* layoutBox = toLayoutBox(child);
@@ -100,14 +103,9 @@ void LayoutMedia::layout() {
// Notify our MediaControls that a layout has happened.
if (mediaElement() && mediaElement()->mediaControls() &&
- newPanelWidth.has_value()) {
- if (!m_lastReportedPanelWidth.has_value() ||
- m_lastReportedPanelWidth.value() != newPanelWidth.value()) {
- mediaElement()->mediaControls()->notifyPanelWidthChanged(
- newPanelWidth.value());
- // Store the last value we reported, so we know if it has changed.
- m_lastReportedPanelWidth = newPanelWidth.value();
- }
+ newWidth.has_value() && newHeight.has_value()) {
+ mediaElement()->mediaControls()->onLayout(newWidth->toInt(),
+ newHeight->toInt());
}
}

Powered by Google App Engine
This is Rietveld 408576698