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

Unified Diff: LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html

Issue 1330113002: Rename WebSourceBuffer::abort into WebSourceBuffer::resetParserState (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html
diff --git a/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html b/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html
new file mode 100644
index 0000000000000000000000000000000000000000..489ea3422463073d8abd18b1fe7d6fce10748c9b
--- /dev/null
+++ b/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<style>
+ body { margin: 0px; }
+ #sandbox {
+ width: 400px;
+ height: 200px;
+ }
+ #sandbox iframe {
+ display: block;
+ box-sizing: border-box;
+ width: 200px;
+ height: 200px;
+ border: none;
+ }
+ #sandbox {
+ box-sizing: border-box;
+ height: 100px;
+ width: 200px;
+ border: 1px solid black;
+ }
+</style>
+
+<script src="../../../resources/js-test.js"></script>
+<script src="resources/nodesFromRect.js"></script>
+
+<body id="body">
+ <input id="text-input" type="text"> <br>
+ <iframe id="iframe" src="resources/child-frame-scrolled.html"></iframe>
+ <div id="console"></div>
+</body>
+
+<script>
+description("nodesFromRect returns correct rects when the rect is overlapping" +
+ " an iframe with scrolled contents");
+
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
+
+window.addEventListener("message", function(evt) {
+ if (evt.data == "subframe-loaded") {
+ var inputElement = document.getElementById('text-input');
+ var inputBoundingRect = inputElement.getBoundingClientRect();
+ var inputCenterX = inputBoundingRect.left + inputBoundingRect.width / 2;
+ var inputCenterY = inputBoundingRect.top + inputBoundingRect.height / 2;
+ var inputHeight = inputBoundingRect.height;
+
+ var iframeElement = document.getElementById('iframe');
+ var iframeBoundingRect = iframeElement.getBoundingClientRect();
+ var iframeCenterX = iframeBoundingRect.left + iframeBoundingRect.width / 2;
+ var iframeCenterY = iframeBoundingRect.top + iframeBoundingRect.height / 2;
+
+ // Rect is totally within input box.
+ checkRect(inputCenterX, inputCenterY, 1, 1, "DIV#inner-editor");
+ // Rect covers both input box and iframe.
+ checkRect(inputCenterX, inputCenterY, inputHeight, inputHeight,
+ "DIV#content, IFRAME#iframe, DIV#inner-editor, INPUT#text-input, BODY#body");
+ // Rect is totally within iframe.
+ checkRect(iframeCenterX, iframeCenterY, 1, 1, "DIV#content");
+
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+}, true);
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698