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

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

Issue 2534183003: Media Controls: don't "cut" controls if fully hidden. (Closed)
Patch Set: Created 4 years, 1 month 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/controls/overflow-fully-hidden.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/layout/LayoutMedia.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
index 1ba695f653116c3c001ae59c7f833f3de8aaba60..e85413688c4df85a8552f5c983d458e03b198e69 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
@@ -180,7 +180,10 @@ LayoutUnit LayoutMedia::computePanelWidth(const LayoutRect& mediaRect) const {
FloatPoint(mediaRect.location()),
UseTransforms | ApplyContainerFlip | TraverseDocumentBoundaries)
.x());
- DCHECK_GE(visibleWidth - absoluteXOffset, 0);
+ const LayoutUnit newWidth = visibleWidth - absoluteXOffset;
+
+ if (newWidth < 0)
+ return mediaRect.width();
return std::min(mediaRect.width(), visibleWidth - absoluteXOffset);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/media/controls/overflow-fully-hidden.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698