Chromium Code Reviews| 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 c9744c5af5e4a1ff042bfd3feb47b03160144c99..ecc54dec5444a65d9ec8f42f08ba45936899dc52 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp |
| @@ -83,8 +83,7 @@ void LayoutMedia::layout() { |
| LayoutUnit width = newRect.width(); |
| if (child->node()->isMediaControls()) { |
| width = computePanelWidth(newRect); |
| - if (width != oldSize.width()) |
| - newPanelWidth = width; |
| + newPanelWidth = width; |
| } |
| LayoutBox* layoutBox = toLayoutBox(child); |
| @@ -102,8 +101,13 @@ void LayoutMedia::layout() { |
| // Notify our MediaControls that a layout has happened. |
| if (mediaElement() && mediaElement()->mediaControls() && |
| newPanelWidth.has_value()) { |
| - mediaElement()->mediaControls()->notifyPanelWidthChanged( |
| - newPanelWidth.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 |
|
whywhat
2016/12/08 23:21:06
nit: Use proper sentence format for consistency (s
billorr
2016/12/08 23:34:58
Done.
|
| + m_lastReportedPanelWidth = newPanelWidth.value(); |
| + } |
| } |
| } |