Index: LayoutTests/fast/events/hit-test-cache-iframes.html |
diff --git a/LayoutTests/fast/events/hit-test-cache-iframes.html b/LayoutTests/fast/events/hit-test-cache-iframes.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4f8a31e19c422607fa42a01d977c43d7d7a99092 |
--- /dev/null |
+++ b/LayoutTests/fast/events/hit-test-cache-iframes.html |
@@ -0,0 +1,33 @@ |
+<meta name="viewport" content="width=device-width, initial-scale=1"> |
pdr.
2015/08/08 05:44:14
Lets remove the meta viewport and instead put <!DO
dtapuska
2015/08/10 19:35:42
Done.
|
+<style> |
+#myframe { |
+ height: 35px; |
+ width: 100px; |
+} |
+</style> |
+ |
+<script src="../../resources/js-test.js"></script> |
+<script> |
+ |
+setPrintTestResultsLazily(); |
+window.jsTestIsAsync = true; |
+ |
+description("Ensure hit test cache works in when an iframe is in between loading and loaded."); |
pdr.
2015/08/08 05:44:14
Maybe rephrase this as "Ensure the hit test cache
dtapuska
2015/08/10 19:35:42
Done.
|
+ |
+function loaded() { |
+ document.body.insertAdjacentHTML('beforeend', '<iframe id="myframe" srcdoc="<p>Hi</p>" onload="iFrameLoaded()"></iframe>'); |
pdr.
2015/08/08 05:44:13
Lets remove <p>Hi</p> so it does't affect hit test
dtapuska
2015/08/10 19:35:42
Done.
|
+ doHit(); |
+} |
+ |
+function iFrameLoaded() { |
+ doHit(); |
+ finishJSTest(); |
+} |
+ |
+function doHit() { |
+ var rect = document.getElementById('myframe').getBoundingClientRect(); |
+ window.internals.elementFromPoint(document, rect.left + 8, rect.top + 8, false, false); |
+ shouldBe("window.internals.hitTestCacheHits(document)", "0"); |
+} |
+</script> |
+<body onload="loaded()" /> |