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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMediaTest.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/layout/LayoutMedia.cpp ('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/LayoutMediaTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMediaTest.cpp b/third_party/WebKit/Source/core/layout/LayoutMediaTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8732b61700351cb21f573564511a782c0d562176
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/LayoutMediaTest.cpp
@@ -0,0 +1,53 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/layout/LayoutVideo.h"
+
+#include "core/layout/LayoutTestHelper.h"
+
+namespace blink {
+
+using LayoutMediaTest = RenderingTest;
+
+TEST_F(LayoutMediaTest, DisallowInlineChild) {
+ setBodyInnerHTML(
+ "<style>"
+ " ::-webkit-media-controls { display: inline; }"
+ "</style>"
+ "<video id='video'></video>");
+
+ EXPECT_FALSE(getLayoutObjectByElementId("video")->slowFirstChild());
+}
+
+TEST_F(LayoutMediaTest, DisallowBlockChild) {
+ setBodyInnerHTML(
+ "<style>"
+ " ::-webkit-media-controls { display: block; }"
+ "</style>"
+ "<video id='video'></video>");
+
+ EXPECT_FALSE(getLayoutObjectByElementId("video")->slowFirstChild());
+}
+
+TEST_F(LayoutMediaTest, DisallowOutOfFlowPositionedChild) {
+ setBodyInnerHTML(
+ "<style>"
+ " ::-webkit-media-controls { position: absolute; }"
+ "</style>"
+ "<video id='video'></video>");
+
+ EXPECT_FALSE(getLayoutObjectByElementId("video")->slowFirstChild());
+}
+
+TEST_F(LayoutMediaTest, DisallowFloatingChild) {
+ setBodyInnerHTML(
+ "<style>"
+ " ::-webkit-media-controls { float: left; }"
+ "</style>"
+ "<video id='video'></video>");
+
+ EXPECT_FALSE(getLayoutObjectByElementId("video")->slowFirstChild());
+}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMedia.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698