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

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

Issue 2702473002: Don't allow out-of-flow positioned and floating children under LayoutMedia (Closed)
Patch Set: Fix a typo 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
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/LayoutMediaTest.cpp » ('j') | 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 0c884a8794529ef2ba18d6d7b22becc18f7018d8..ae50013ff9ecb3b817429f21eccb38bf6018c019 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMedia.cpp
@@ -112,11 +112,16 @@ void LayoutMedia::layout() {
}
bool LayoutMedia::isChildAllowed(LayoutObject* child,
- const ComputedStyle&) const {
+ const ComputedStyle& style) const {
// Two types of child layout objects are allowed: media controls
// and the text track container. Filter children by node type.
ASSERT(child->node());
+ // Out-of-flow positioned or floating child breaks layout hierarchy.
+ // This check can be removed if ::-webkit-media-controls is made internal.
+ if (style.hasOutOfFlowPosition() || style.isFloating())
+ return false;
+
// The user agent stylesheet (mediaControls.css) has
// ::-webkit-media-controls { display: flex; }. If author style
// sets display: inline we would get an inline layoutObject as a child
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/LayoutMediaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698