Index: third_party/WebKit/LayoutTests/fast/dom/Element/offset-parent-contain.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offset-parent-contain.html b/third_party/WebKit/LayoutTests/fast/dom/Element/offset-parent-contain.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0e5897f49cca826e08c188a8a3ea9d5344db69ed |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offset-parent-contain.html |
@@ -0,0 +1,33 @@ |
+<!DOCTYPE html> |
+<!-- contain:paint establishes a containing block for out-of-flow positioned descendants. --> |
+<div id="containPaint" style="contain:paint;"> |
+ <div id="test1"></div> |
+</div> |
+<!-- contain:layout does NOT establish a containing block for out-of-flow positioned descendants. --> |
+<div id="containLayout" style="contain:layout;"> |
+ <div id="test2"></div> |
+</div> |
+<!-- contain:style does NOT establish a containing block for out-of-flow positioned descendants. --> |
+<div id="containStyle" style="contain:style;"> |
+ <div id="test3"></div> |
+</div> |
+<!-- contain:size does NOT establish a containing block for out-of-flow positioned descendants. --> |
+<div id="containStyle" style="contain:size;"> |
+ <div id="test4"></div> |
+</div> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+<script> |
+ test(function() { |
+ assert_equals(document.getElementById("test1").offsetParent, document.getElementById("containPaint")); |
+ }, "inside contain:paint"); |
+ test(function() { |
+ assert_equals(document.getElementById("test2").offsetParent, document.body); |
+ }, "inside contain:layout"); |
+ test(function() { |
+ assert_equals(document.getElementById("test3").offsetParent, document.body); |
+ }, "inside contain:style"); |
+ test(function() { |
+ assert_equals(document.getElementById("test4").offsetParent, document.body); |
+ }, "inside contain:size"); |
+</script> |