Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
2010-10-19 Antonio Gomes <agomes@rim.com>
Reviewed by Kenneth Rohde Christiansen. Add an inner frame test to Document::nodesFromRect https://bugs.webkit.org/show_bug.cgi?id=47794 Patch continues to improve the test coverage of Document::nodesFromRect, similarly to bugs 47795 (Add a test to nodesFromRect involving links and text nodes) and 47766 (Enrich /fast/dom/nodesFromRect-basic.html test). This time it is being adding tests involving inner frame contents. Three situations are added: 1) Hit testing an inner frame from an outer document should not include nodes of the former in the returned result, but the inner frame itself; 2) Hit testing inner frame and outer frame contents should return all nodes in the later whose area intersect with the hit area and the intersected inner frame itself; 3) Hit testing an inner document content should return all nodes in the inner document whose area intersect the hit area. Tests skipped on Win, Qt, GTK and Chromium. * fast/dom/nodesFromRect-inner-documents-expected.txt: Added. * fast/dom/nodesFromRect-inner-documents.html: Added. * fast/dom/resources/nodesFromRect.css: * fast/dom/resources/nodesFromRect.js: Canonical link: https://commits.webkit.org/60702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@70147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Antonio Gomes
committed
Oct 20, 2010
1 parent
9cb7ee2
commit c909b95e00365f8844a17942ebeec50a97014a41
Showing
9 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,10 @@ | ||
A PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
PASS All correct nodes found for rect [176,120], [0,0,0,0] | ||
PASS All correct nodes found for rect [176,120], [10,10,10,10] | ||
PASS All correct nodes found for rect [14,167], [0,10,0,0] | ||
PASS All correct nodes found for rect [150,17], [0,0,0,0] | ||
PASS All correct nodes found for rect [150,17], [0,0,10,0] | ||
PASS All correct nodes found for rect [150,17], [0,0,25,0] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,58 @@ | ||
<html> | ||
<head> | ||
<title>Document::nodesFromRect : basic text nodes and links test - bug 47795</title> | ||
<style type="text/css"> @import "resources/nodesFromRect.css"; </style> | ||
<script src="../js/resources/js-test-pre.js"></script> | ||
<script src="resources/nodesFromRect.js"></script> | ||
<script type="application/javascript"> | ||
function runTest() | ||
{ | ||
if (window.layoutTestController) { | ||
layoutTestController.dumpAsText(); | ||
layoutTestController.waitUntilDone(); | ||
} | ||
|
||
var e = {}; | ||
|
||
// Set up shortcut access to elements | ||
e['html'] = document.getElementsByTagName("html")[0]; | ||
['a1', 'iframe1', 'body'].forEach(function(a) { | ||
e[a] = document.getElementById(a); | ||
}); | ||
|
||
window.scrollTo(0, 0); | ||
|
||
var a1Center = getCenterFor(e.a1); | ||
var iframe1Center = getCenterFor(e.iframe1); | ||
|
||
// Elements inside iframe shouldn't be returned: | ||
check(iframe1Center.x, iframe1Center.y, 0, 0, 0, 0, [e.iframe1]); | ||
check(iframe1Center.x, iframe1Center.y, 10, 10, 10, 10, [e.iframe1]); | ||
|
||
// NOTE: e.body.childNodes[2] is a TextNode whose content is ' '. | ||
check(a1Center.x, a1Center.y, 0, e.iframe1.getBoundingClientRect().left - a1Center.x, 0, 0, [e.iframe1, e.body.childNodes[2], e.a1.firstChild, e.a1, e.body]); | ||
|
||
// Testing nodesFromRect in an inner node. | ||
var innerDocument = window.frames[0].document; | ||
var div = innerDocument.getElementsByTagName('div')[0]; | ||
var p = innerDocument.getElementsByTagName('p')[0]; | ||
var body = innerDocument.getElementsByTagName('body')[0]; | ||
var divCenter = getCenterFor(div); | ||
check(divCenter.x, divCenter.y, 0, 0, 0, 0, [div], innerDocument); | ||
check(divCenter.x, divCenter.y, 0, 0, 10, 0, [div, body], innerDocument); | ||
check(divCenter.x, divCenter.y, 0, 0, 25, 0, [p, div, body], innerDocument); | ||
|
||
if (window.layoutTestController) | ||
layoutTestController.notifyDone(); | ||
} | ||
|
||
window.onload = runTest; | ||
</script> | ||
</head> | ||
<body id="body"> | ||
<a id="a1" href="#">A</a> | ||
<iframe id="iframe1" src="data:text/html,<div>div</div><p>p</p>"></iframe> | ||
<span id="console"></span> | ||
<script src="../js/resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -3,7 +3,7 @@ body { | ||
padding: 0; | ||
} | ||
|
||
h1, div, p, iframe { | ||
h1, div, p { | ||
display: block; | ||
width: 100px; | ||
height: 30px; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters