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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing.html

Issue 1530303003: Implement Layout Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to Ahem. Created 4 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 | « no previous file | third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing.html b/third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing.html
new file mode 100644
index 0000000000000000000000000000000000000000..d18b20faec1d3eddb2157e88e4402a06c90a2794
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<style>
+body {
+ font: 10px Ahem;
+}
+.containLayout {
+ contain: strict;
+ background-color: green;
+}
+.sized {
+ height: 20px;
+ width: 10px;
+}
+.overhangingFloat {
+ float: left;
+ width: 10px;
+ height: 50px;
+ background-color: papayawhip;
+}
+.inlineBlock {
+ display: inline-block;
+}
+.testContainer {
+ line-height: 15px;
+}
+.absolute {
+ position: absolute;
+ left: 200px;
+}
+</style>
+
+Test an unsized contained block collapses.
+<div class="containLayout" data-expected-height=0><div class="sized"></div></div>
+
+Test a sized contained block respects its size, not its content's size.
+<div class="containLayout sized" data-expected-height=20><div class="overhangingFloat"></div></div>
+
+Test that the contents of an unsized contained block doesn't effect its parent.
+<div class="testContainer" data-expected-height=0>
+ <div class="containLayout" data-expected-height=0><div class="overhangingFloat"></div></div>
+</div>
+
+Test that the contents of an unsized contained inline-block doesn't change the baseline
+of its parent. Having an inline-block (or other replaced content), even if it's empty,
+creates a line, hence we get a line-height worth of height.
+<div class="testContainer" data-expected-height=15>
+ <div class="containLayout inlineBlock" data-expected-height=0><div class="overhangingFloat"></div></div>
+</div>
+
+Test a sized inline-block uses the proper baseline. Result is 25 instead of 20 due to
+normal inline layout shenanigans.
+<div class="testContainer" data-expected-height=25>
+ <div class="containLayout inlineBlock sized" data-expected-height=20><div class="overhangingFloat"></div></div>
+</div>
+
+Test that a contained block avoids floats.
+<div class="absolute" style="top: 100px; width: 10px;">
+ <div class="overhangingFloat"></div>
+ <div class="containLayout sized" data-offset-y=50></div>
+</div>
+
+Test that a contained inline-block avoids floats.
+<div class="absolute" style="top: 200px width: 100px;">
+ <div class="overhangingFloat"></div>
+ <div class="containLayout sized inlineBlock" data-offset-x=10></div>
+</div>
+
+<script src="../../../resources/check-layout.js"></script>
+<script>
+checkLayout('.testContainer');
+checkLayout('.containLayout');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/containment/layout-containment-sizing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698