Index: third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html |
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html b/third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3a08795615ed42e64f1a35427c5d66d282832d05 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/intersection-observer/zero-area-element-visible.html |
@@ -0,0 +1,26 @@ |
+<!DOCTYPE html> |
+<script src="../resources/js-test.js"></script> |
+<script src="../resources/intersection-observer-helper-functions.js"></script> |
+<div id='target' style='width:0px; height:0px'</div>" |
+<script> |
+description("Ensure that a visible zero-area element is given the correct intersection ratio."); |
+ |
+var entries = []; |
+var target; |
+ |
+onload = function() { |
+ target = document.getElementById("target"); |
+ new IntersectionObserver((changes) => { |
+ entries.push(...changes); |
+ }).observe(target); |
+ waitForNotification(step0); |
+}; |
+ |
+function step0() { |
+ shouldBeEqualToNumber("entries.length", 1); |
+ if (entries.length > 0) { |
foolip
2016/12/08 16:28:59
The above line says that it should be true, so no
Sami
2016/12/09 17:24:36
Very true, fixed. The existing tests had this guar
|
+ shouldBe("entries[0].intersectionRatio", "1"); |
+ } |
+ finishJSTest(); |
+} |
+</script> |