Allow child-frame content in hit-tests.
authorallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2012 11:56:46 +0000 (11:56 +0000)
committerallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Sep 2012 11:56:46 +0000 (11:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95204

.:

Reviewed by Antonio Gomes.

Update exported symbols.

* Source/autotools/symbols.filter:

Source/WebCore:

Reviewed by Antonio Gomes.

Refactors how EventHandler::hitTestResultAtPoint handles child-frame content,
it is now handled by the hit test itself controlled by the AllowChildFrameContent
flag in HitTestRequest.

Tests: fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html
       touchadjustment/iframe-boundary.html

* WebCore.exp.in:
* WebCore.order:
* dom/Document.cpp:
(WebCore::Document::nodesFromRect):
* dom/Document.h:
(Document):
* page/EventHandler.cpp:
(WebCore::EventHandler::hitTestResultAtPoint):
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::allowChildFrameContent):
(WebCore::HitTestRequest::childFrameHitTest):
(WebCore::HitTestRequest::testChildFrameScrollBars):
* rendering/RenderFrameBase.cpp:
(WebCore::RenderFrameBase::nodeAtPoint):
(WebCore):
* rendering/RenderFrameBase.h:
(RenderFrameBase):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

Source/WebKit2:

Reviewed by Antonio Gomes.

Update symbols for the Windows build-system.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

Reviewed by Antonio Gomes.
Touch-Adjustment test by Kevin Ellis

Two new tests for hit-testing child frame content. One for testing it as an option to
nodesFromRect, and one testing its improvement on touch adjustment on iframe boundaries.

* fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt: Added.
* fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html: Added.
* fast/dom/nodesFromRect/resources/child-frame.html: Added.
* fast/dom/nodesFromRect/resources/nodesFromRect.js:
(check):
(checkShadowContent):
(checkRect):
(nodesFromRectAsString):
* touchadjustment/iframe-boundary-expected.txt: Added.
* touchadjustment/iframe-boundary.html: Added.
* touchadjustment/resources/inner-content-page.html: Added.
* touchadjustment/resources/inner-navigation-frame.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127457 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/resources/child-frame.html [new file with mode: 0644]
LayoutTests/fast/dom/nodesFromRect/resources/nodesFromRect.js
LayoutTests/touchadjustment/iframe-boundary-expected.txt [new file with mode: 0644]
LayoutTests/touchadjustment/iframe-boundary.html [new file with mode: 0644]
LayoutTests/touchadjustment/resources/inner-content-page.html [new file with mode: 0644]
LayoutTests/touchadjustment/resources/inner-navigation-frame.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/page/EventHandler.cpp
Source/WebCore/rendering/HitTestRequest.h
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/HitTestResult.h
Source/WebCore/rendering/RenderFrameBase.cpp
Source/WebCore/rendering/RenderFrameBase.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index d3bbaad..5086422 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Allow child-frame content in hit-tests.
+        https://bugs.webkit.org/show_bug.cgi?id=95204
+
+        Reviewed by Antonio Gomes.
+
+        Update exported symbols.
+
+        * Source/autotools/symbols.filter:
+
 2012-09-04  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         [CMAKE] Update cmakeconfig.h.cmake 
index 1fa34e1..1aa395e 100644 (file)
@@ -1,3 +1,27 @@
+2012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Allow child-frame content in hit-tests.
+        https://bugs.webkit.org/show_bug.cgi?id=95204
+
+        Reviewed by Antonio Gomes.
+        Touch-Adjustment test by Kevin Ellis
+
+        Two new tests for hit-testing child frame content. One for testing it as an option to
+        nodesFromRect, and one testing its improvement on touch adjustment on iframe boundaries.
+
+        * fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt: Added.
+        * fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html: Added.
+        * fast/dom/nodesFromRect/resources/child-frame.html: Added.
+        * fast/dom/nodesFromRect/resources/nodesFromRect.js:
+        (check):
+        (checkShadowContent):
+        (checkRect):
+        (nodesFromRectAsString):
+        * touchadjustment/iframe-boundary-expected.txt: Added.
+        * touchadjustment/iframe-boundary.html: Added.
+        * touchadjustment/resources/inner-content-page.html: Added.
+        * touchadjustment/resources/inner-navigation-frame.html: Added.
+
 2012-09-04  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Unreviewed tests fix.
diff --git a/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt b/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt
new file mode 100644 (file)
index 0000000..9c1c970
--- /dev/null
@@ -0,0 +1,18 @@
+
+Document::nodesFromRect : Allow child-frame content - bug 95204
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html b/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html
new file mode 100644 (file)
index 0000000..adb4167
--- /dev/null
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Document::nodesFromRect : Allow child-frame content - bug 95204</title>
+    <script src="../../js/resources/js-test-pre.js"></script>
+    <script src="resources/nodesFromRect.js"></script>
+    <style>
+        body { margin: 0px; }
+        #sandbox {
+            width: 400px;
+            height: 200px;
+        }
+        #sandbox #layer {
+            float: right;
+        }
+        #sandbox iframe {
+            display: block;
+            box-sizing: border-box;
+            width: 200px;
+            height: 200px;
+            border: none;
+        }
+        .rotate180 { -webkit-transform: rotate(180deg); }
+        .rotate90 { -webkit-transform: rotate(90deg); }
+        #sandbox .box {
+            box-sizing: border-box;
+            height: 100px;
+            width: 200px;
+            border: 1px solid black;
+        }
+    </style>
+</head>
+<body id="body">
+    <div id=sandbox>
+        <div id=layer>
+            <iframe id="iframe1" src="resources/child-frame.html"></iframe>
+        </div>
+        <div id=div1 class=box></div>
+        <div id=div2 class=box></div>
+    </div>
+
+    <p id='description'></p>
+    <div id="console"></div>
+    <script type="application/javascript">
+        function runTest()
+        {
+            description(document.title);
+
+            // Set up shortcut access to elements
+            var e = {};
+            ['sandbox', 'layer'].forEach(function(a) {
+                e[a] = document.getElementById(a);
+            });
+
+            checkRect(25, 25, 100, 100, "DIV#div2, DIV#div1, DIV#sandbox");
+            checkRect(220, 20, 70, 70, "DIV#left");
+            checkRect(250, 20, 100, 70, "DIV#right, DIV#left, HTML");
+
+            checkRect(150, 50, 100, 100, "DIV#left, HTML, #document, IFRAME#iframe1, DIV#layer, DIV#div2, DIV#div1, DIV#sandbox");
+
+            e.layer.setAttribute('class', 'rotate180');
+            checkRect(220, 20, 70, 70, "DIV#right");
+            checkRect(150, 50, 100, 100, "DIV#right, HTML, #document, IFRAME#iframe1, DIV#layer, DIV#div2, DIV#div1, DIV#sandbox");
+
+            e.layer.setAttribute('class', 'rotate90');
+            checkRect(250, 20, 100, 70, "DIV#left");
+            checkRect(150, 20, 200, 60, "DIV#left, HTML, #document, IFRAME#iframe1, DIV#layer, DIV#div1, DIV#sandbox");
+
+            e.sandbox.display = 'none';
+            finishJSTest();
+        }
+        jsTestIsAsync = true;
+        window.onload = runTest;
+    </script>
+    <script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/nodesFromRect/resources/child-frame.html b/LayoutTests/fast/dom/nodesFromRect/resources/child-frame.html
new file mode 100644 (file)
index 0000000..204d7fa
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+    body { margin: 0px; }
+    div { 
+        box-sizing: border-box;
+        border: 1px solid black;
+    }
+    #left {
+        float:left;
+        width: 90px;
+        height: 190px;
+    }
+    #right {
+        float:right;
+        width: 90px;
+        height: 190px;
+    }
+</style>
+</head>
+<body>
+    <div id=left></div>
+    <div id=right></div>
+</body>
+</html>
+
index 2e83a75..14ccf62 100644 (file)
@@ -1,7 +1,8 @@
 /*
  * Contributors:
  *     * Antonio Gomes <tonikitoo@webkit.org>
- **/
+ *     * Allan Sandfeld Jensen <allan.jensen@nokia.com>
+**/
 
 function check(x, y, topPadding, rightPadding, bottomPadding, leftPadding, list, doc)
 {
@@ -11,7 +12,7 @@ function check(x, y, topPadding, rightPadding, bottomPadding, leftPadding, list,
   if (!doc)
     doc = document;
 
-  var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, false /* allow shadow content */);
+  var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, false /* allow shadow content */, false /* allow child-frame content */);
   if (!nodes)
     return;
 
@@ -45,7 +46,7 @@ function checkShadowContent(x, y, topPadding, rightPadding, bottomPadding, leftP
   if (!doc)
     doc = document;
 
-  var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allowShadowContent */);
+  var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allowShadowContent */, false /* allow child-frame content */);
   if (!nodes)
     return;
 
@@ -67,6 +68,61 @@ function checkShadowContent(x, y, topPadding, rightPadding, bottomPadding, leftP
   testPassed("All correct nodes found for rect");
 }
 
+function checkRect(left, top, width, height, expectedNodeString, doc)
+{
+    if (!window.internals)
+        return;
+
+    if (height <=0 || width <= 0)
+        return;
+
+    if (!doc)
+        doc = document;
+
+    var topPadding = height / 2;
+    var leftPadding =  width / 2;
+    // FIXME: When nodesFromRect is changed to not add 1 to width and height, remove the correction here.
+    var bottomPadding = (height - 1) - topPadding;
+    var rightPadding = (width - 1) - leftPadding;
+
+    var nodeString = nodesFromRectAsString(doc, left + leftPadding, top + topPadding, topPadding, rightPadding, bottomPadding, leftPadding);
+
+    if (nodeString == expectedNodeString) {
+        testPassed("All correct nodes found for rect");
+    } else {
+        testFailed("NodesFromRect should be [" + expectedNodeString + "] was [" + nodeString + "]");
+    }
+}
+
+function nodesFromRectAsString(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding)
+{
+    var nodeString = "";
+    var nodes = internals.nodesFromRect(doc, x, y, topPadding, rightPadding, bottomPadding, leftPadding, true /* ignoreClipping */, true /* allow shadow content */, true /* allow child-frame content */);
+    if (!nodes)
+        return nodeString;
+
+    for (var i = 0; i < nodes.length; i++) {
+        if (nodes[i].nodeType == 1) {
+            nodeString += nodes[i].nodeName;
+            if (nodes[i].id)
+                nodeString += '#' + nodes[i].id;
+            else if (nodes[i].class) {
+                nodeString += '.' + nodes[i].class;
+            }
+        } else if (nodes[i].nodeType == 3) {
+            nodeString += "'" + nodes[i].data + "'";
+        } else if (nodes[i].nodeType == 9) {
+            nodeString += "#document";
+        } else {
+            continue;
+        }
+        if (i + 1 < nodes.length) {
+            nodeString += ", ";
+        }
+    }
+    return nodeString;
+}
+
 function getCenterFor(element)
 {
   var rect = element.getBoundingClientRect();
diff --git a/LayoutTests/touchadjustment/iframe-boundary-expected.txt b/LayoutTests/touchadjustment/iframe-boundary-expected.txt
new file mode 100644 (file)
index 0000000..761d369
--- /dev/null
@@ -0,0 +1,26 @@
+Test touch-adjustment at the boundary of an 
+
+
+Test direct touches.
+PASS adjustedNode.id is "checkbox-1"
+PASS adjustedNode.id is "button-1"
+PASS adjustedNode.id is "checkbox-2"
+PASS adjustedNode.id is "button-2"
+PASS adjustedNode.id is "checkbox-3"
+PASS adjustedNode.id is "button-3"
+PASS adjustedNode.id is "checkbox-4"
+PASS adjustedNode.id is "button-4"
+Test indirect touches.
+PASS adjustedNode.id is "checkbox-1"
+PASS adjustedNode.id is "button-1"
+PASS adjustedNode.id is "checkbox-2"
+PASS adjustedNode.id is "button-2"
+PASS adjustedNode.id is "checkbox-3"
+PASS adjustedNode.id is "button-3"
+PASS adjustedNode.id is "checkbox-4"
+PASS adjustedNode.id is "button-4"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/touchadjustment/iframe-boundary.html b/LayoutTests/touchadjustment/iframe-boundary.html
new file mode 100644 (file)
index 0000000..8787f99
--- /dev/null
@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title>Touch Adjustment : Test touch adjustment at an iframe boundary - bug 94936</title>
+    <script src="../fast/js/resources/js-test-pre.js"></script>
+    <script src="resources/touchadjustment.js"></script>
+    <style>
+        #navbar {
+            background: #eee;
+            height: 100%;
+            left: 0;
+            padding: 0;
+            position: absolute;
+            margin: 0;
+            top: 0;
+            width: 100px;
+        }
+
+        #content-page {
+            height: 100%;
+            left: 100px;
+            position: absolute;
+            right: 0;
+            top: 0;
+        }
+
+        iframe {
+            border: none;
+            width: 100%;
+            height: 100%;
+            margin: 0;
+            padding: 0;
+        }
+    </style>
+</head>
+<body id="main" onload="runTests()">
+<div id="navbar"  style="-webkit-transform: translateX(0px);">
+    <iframe id="nav-frame" src="resources/inner-navigation-frame.html"></iframe>
+</div>
+<div id="content-page">
+    <iframe id="content-frame" src="resources/inner-content-page.html"></iframe>
+</div>
+
+<p id='description'></p>
+<div id='console'></div>
+
+<script> 
+    var itemHeight = 32;
+    var borderOffset = 95;
+    var checkboxOffset = 15;
+    var linkOffset = -15;
+    var checkboxOffsetIndirect = 5;
+    var linkOffsetIndirect = -5;
+    var touchRadius = 30;
+
+    function testRoundTouch(x, y, radius)
+    {
+        var x = x - radius;
+        var y = y - radius;
+        var width = radius * 2;
+        var height = radius * 2;
+        var adjustedNode = internals.touchNodeAdjustedToBestClickableNode(x, y, width, height, document);
+        if (adjustedNode.nodeType == 3) // TEXT node
+            adjustedNode = adjustedNode.parentNode;
+        return adjustedNode;
+    }
+    function testDirectTouches()
+    {
+        debug('Test direct touches.');
+        for (var i = 0; i < 4; i++) {
+            adjustedNode = testRoundTouch(borderOffset + checkboxOffset, (i + 0.5) * itemHeight, touchRadius);
+            shouldBeEqualToString('adjustedNode.id', 'checkbox-' + (i + 1));
+            adjustedNode = testRoundTouch(borderOffset + linkOffset, (i + 0.5) * itemHeight, touchRadius);
+            shouldBeEqualToString('adjustedNode.id', 'button-' + (i + 1));
+        }
+    }
+    function testIndirectTouches() {
+         debug('Test indirect touches.');
+         for (var i = 0; i < 4; i++) {
+            adjustedNode = testRoundTouch(borderOffset + checkboxOffsetIndirect, (i + 0.5) * itemHeight, touchRadius);
+            shouldBeEqualToString('adjustedNode.id', 'checkbox-' + (i + 1));
+            adjustedNode = testRoundTouch(borderOffset + linkOffsetIndirect, (i + 0.5) * itemHeight, touchRadius);
+            shouldBeEqualToString('adjustedNode.id', 'button-' + (i + 1));
+        }
+    }
+
+    function runTests()
+    {
+        if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestClickableNode) {
+            description('Test touch-adjustment at the boundary of an <iframe>.  Ensure that touch adjustment propagates into children of an <iframe>.  Test expected to contain failures until bug 95204 is fixed.');
+            testDirectTouches();
+            testIndirectTouches();
+            finishJSTest();
+        }
+    }
+    jsTestIsAsync = true;
+</script>
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/touchadjustment/resources/inner-content-page.html b/LayoutTests/touchadjustment/resources/inner-content-page.html
new file mode 100644 (file)
index 0000000..5ac32ba
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE="html">
+<html>
+<head>
+    <style>
+        body {
+            background: white;
+            padding: 0;
+            margin: 0;
+        }
+
+        label {
+            display: block;
+            line-height: 22px;
+            margin: 5px;
+        }
+    </style>
+</head>
+<body>
+<label><input id="checkbox-1" type="checkbox">Checkbox 1</label>
+<label><input id="checkbox-2" type="checkbox">Checkbox 2</label>
+<label><input id="checkbox-3" type="checkbox">Checkbox 3</label>
+<label><input id="checkbox-4" type="checkbox">Checkbox 4</label>
+</body>
+</html>
diff --git a/LayoutTests/touchadjustment/resources/inner-navigation-frame.html b/LayoutTests/touchadjustment/resources/inner-navigation-frame.html
new file mode 100644 (file)
index 0000000..33dc13a
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE="html">
+<html>
+<head>
+    <style>
+        body {
+            padding: 0;
+            margin: 0;
+        }
+
+        div.button {
+            display: block;
+            text-align: center;
+            line-height: 18px;
+            margin: 5px;
+            width: 85px;
+            padding: 4px;
+            border: 1px solid black;
+            border-radius: 5px;
+        }
+    </style>
+</head>
+<body>
+<script>
+    function onClick() {
+    }
+</script>
+<div class="button" id="button-1" onclick=onClick>Button 1</div>
+<div class="button" id="button-2" onclick=onClick>Button 2</div>
+<div class="button" id="button-3" onclick=onClick>Button 3</div>
+<div class="button" id="button-4" onclick=onClick>Button 4</div>
+</body>
+</html>
index df91d63..c547483 100644 (file)
@@ -1,3 +1,42 @@
+2012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Allow child-frame content in hit-tests.
+        https://bugs.webkit.org/show_bug.cgi?id=95204
+
+        Reviewed by Antonio Gomes.
+
+        Refactors how EventHandler::hitTestResultAtPoint handles child-frame content,
+        it is now handled by the hit test itself controlled by the AllowChildFrameContent
+        flag in HitTestRequest.
+
+        Tests: fast/dom/nodesFromRect/nodesFromRect-child-frame-content.html
+               touchadjustment/iframe-boundary.html
+
+        * WebCore.exp.in:
+        * WebCore.order:
+        * dom/Document.cpp:
+        (WebCore::Document::nodesFromRect):
+        * dom/Document.h:
+        (Document):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::hitTestResultAtPoint):
+        * rendering/HitTestRequest.h:
+        (WebCore::HitTestRequest::allowChildFrameContent):
+        (WebCore::HitTestRequest::childFrameHitTest):
+        (WebCore::HitTestRequest::testChildFrameScrollBars):
+        * rendering/RenderFrameBase.cpp:
+        (WebCore::RenderFrameBase::nodeAtPoint):
+        (WebCore):
+        * rendering/RenderFrameBase.h:
+        (RenderFrameBase):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::hitTest):
+        * testing/Internals.cpp:
+        (WebCore::Internals::nodesFromRect):
+        * testing/Internals.h:
+        (Internals):
+        * testing/Internals.idl:
+
 2012-09-04  Christophe Dumez  <christophe.dumez@intel.com>
 
         [EFL] Fix build error in NetworkStateNotifierEfl.cpp
index b577e6f..bae33f7 100644 (file)
@@ -1353,7 +1353,7 @@ __ZNK7WebCore7RunLoop9TimerBase8isActiveEv
 __ZNK7WebCore8Document10renderViewEv
 __ZNK7WebCore8Document11completeURLERKN3WTF6StringE
 __ZNK7WebCore8Document13axObjectCacheEv
-__ZNK7WebCore8Document13nodesFromRectEiijjjjbb
+__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
 __ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
 __ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
 __ZNK7WebCore8Document4bodyEv
index 0b2b175..35abfe6 100644 (file)
@@ -22785,7 +22785,7 @@ __ZNK7WebCore12NodeIterator20updateForNodeRemovalEPNS_4NodeERNS0_11NodePointerE
 __ZN7WebCore27jsNodeIteratorReferenceNodeEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
 __ZNK7WebCore4Node20traversePreviousNodeEPKS0_
 __ZN7WebCore37jsNodeIteratorPrototypeFunctionDetachEPN3JSC9ExecStateE
-__ZNK7WebCore8Document13nodesFromRectEiijjjjb
+__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
 __ZNK7WebCore8Document17handleZeroPaddingERKNS_14HitTestRequestERNS_13HitTestResultE
 __ZN3WTF21ListHashSetTranslatorINS_6RefPtrIN7WebCore4NodeEEELm256ENS_7PtrHashIS4_EEE9translateERPNS_15ListHashSetNodeIS4_Lm256EEERKS4_PNS_24ListHashSetNodeAllocatorIS4_Lm256EEE
 __ZN7WebCore21StaticHashSetNodeListC1ERN3WTF11ListHashSetINS1_6RefPtrINS_4NodeEEELm256ENS1_7PtrHashIS5_EEEE
index b6a83a4..4465751 100644 (file)
@@ -1384,7 +1384,7 @@ String Document::suggestedMIMEType() const
 // * making it receive a rect as parameter, i.e. nodesFromRect(x, y, w, h);
 // * making it receive the expading size of each direction separately,
 //   i.e. nodesFromRect(x, y, topSize, rightSize, bottomSize, leftSize);
-PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent) const
+PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const
 {
     // FIXME: Share code between this, elementFromPoint and caretRangeFromPoint.
     if (!renderer())
@@ -1408,6 +1408,8 @@ PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned
         return 0;
     if (allowShadowContent)
         type |= HitTestRequest::AllowShadowContent;
+    if (allowChildFrameContent)
+        type |= HitTestRequest::AllowChildFrameContent;
 
     HitTestRequest request(type);
 
index 46cb931..2872e5c 100644 (file)
@@ -379,8 +379,9 @@ public:
      * @param ignoreClipping whether or not to ignore the root scroll frame when retrieving the element.
      *        If false, this method returns null for coordinates outside of the viewport.
      */
-    PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding,
-                                       unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent) const;
+    PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY,
+                                       unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
+                                       bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent = false) const;
     Element* elementFromPoint(int x, int y) const;
     PassRefPtr<Range> caretRangeFromPoint(int x, int y);
 
index dddb1e0..001fd6d 100644 (file)
@@ -1049,33 +1049,13 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool
         hitType |= HitTestRequest::IgnoreClipping;
     if (allowShadowContent)
         hitType |= HitTestRequest::AllowShadowContent;
+    if (testScrollbars == ShouldHitTestScrollbars)
+        hitType |= HitTestRequest::TestChildFrameScrollBars;
+    // We always need to handle child frame content.
+    hitType |= HitTestRequest::AllowChildFrameContent;
+
     m_frame->contentRenderer()->hitTest(HitTestRequest(hitType), result);
 
-    while (true) {
-        Node* n = result.innerNode();
-        if (!result.isOverWidget() || !n || !n->renderer() || !n->renderer()->isWidget())
-            break;
-        RenderWidget* renderWidget = toRenderWidget(n->renderer());
-        Widget* widget = renderWidget->widget();
-        if (!widget || !widget->isFrameView())
-            break;
-        Frame* frame = static_cast<HTMLFrameElementBase*>(n)->contentFrame();
-        if (!frame || !frame->contentRenderer())
-            break;
-        FrameView* view = static_cast<FrameView*>(widget);
-        LayoutPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(), 
-            result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop());
-        HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width());
-        frame->contentRenderer()->hitTest(HitTestRequest(hitType), widgetHitTestResult);
-        result = widgetHitTestResult;
-
-        if (testScrollbars == ShouldHitTestScrollbars) {
-            Scrollbar* eventScrollbar = view->scrollbarAtPoint(roundedIntPoint(point));
-            if (eventScrollbar)
-                result.setScrollbar(eventScrollbar);
-        }
-    }
-    
     // If our HitTestResult is not visible, then we started hit testing too far down the frame chain. 
     // Another hit test at the main frame level should get us the correct visible result.
     Frame* resultFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : 0;
index d937c25..3faf88a 100644 (file)
@@ -35,7 +35,10 @@ public:
         IgnoreClipping = 1 << 5,
         SVGClipContent = 1 << 6,
         TouchEvent = 1 << 7,
-        AllowShadowContent = 1 << 8
+        AllowShadowContent = 1 << 8,
+        AllowChildFrameContent = 1 << 9,
+        ChildFrameHitTest = 1 << 10,
+        TestChildFrameScrollBars = 1 << 11
     };
 
     typedef unsigned HitTestRequestType;
@@ -54,6 +57,9 @@ public:
     bool touchEvent() const { return m_requestType & TouchEvent; }
     bool mouseEvent() const { return !touchEvent(); }
     bool allowsShadowContent() const { return m_requestType & AllowShadowContent; }
+    bool allowsChildFrameContent() const { return m_requestType & AllowChildFrameContent; }
+    bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; }
+    bool shouldTestChildFrameScrollBars() const { return m_requestType & TestChildFrameScrollBars; }
 
     // Convenience functions
     bool touchMove() const { return move() && touchEvent(); }
index cc39056..8063c81 100644 (file)
@@ -104,7 +104,7 @@ HitTestLocation::HitTestLocation(const HitTestLocation& other, const LayoutSize&
     , m_boundingBox(other.m_boundingBox)
     , m_transformedPoint(other.m_transformedPoint)
     , m_transformedRect(other.m_transformedRect)
-    , m_region(region)
+    , m_region(region ? region : other.m_region)
     , m_isRectBased(other.m_isRectBased)
     , m_isRectilinear(other.m_isRectilinear)
 {
index 9129eed..bac96a2 100644 (file)
@@ -55,7 +55,7 @@ public:
     // Pass non-zero padding values to perform a rect-based hit test.
     HitTestLocation(const LayoutPoint& centerPoint, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding);
     // Make a copy the HitTestLocation in a new region by applying given offset to internal point and area.
-    HitTestLocation(const HitTestLocation&, const LayoutSize& offset, RenderRegion*);
+    HitTestLocation(const HitTestLocation&, const LayoutSize& offset, RenderRegion* = 0);
     HitTestLocation(const HitTestLocation&);
     ~HitTestLocation();
     HitTestLocation& operator=(const HitTestLocation&);
index aa82870..be92c0f 100644 (file)
@@ -29,6 +29,8 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLFrameElementBase.h"
+#include "HitTestResult.h"
+#include "RenderLayer.h"
 #include "RenderView.h"
 
 namespace WebCore {
@@ -104,4 +106,33 @@ void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeig
     setNeedsLayout(false);
 }
 
+bool RenderFrameBase::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction action)
+{
+    if (request.allowsChildFrameContent()) {
+        FrameView* childFrameView = static_cast<FrameView*>(widget());
+        RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0;
+
+        if (childRoot) {
+            LayoutPoint adjustedLocation = accumulatedOffset + location();
+            HitTestLocation newHitTestLocation(locationInContainer, -toLayoutSize(adjustedLocation));
+            HitTestRequest newHitTestRequest(request.type() | HitTestRequest::ChildFrameHitTest);
+
+            bool isInsideChildFrame = childRoot->layer()->hitTest(newHitTestRequest, newHitTestLocation, result);
+            if (isInsideChildFrame)
+                return true;
+
+            if (request.shouldTestChildFrameScrollBars()) {
+                // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,
+                // so we need to test ScrollView scrollbars separately here.
+                // FIXME: Consider if this test could be done unconditionally.
+                Scrollbar* frameScrollbar = childFrameView->scrollbarAtPoint(newHitTestLocation.roundedPoint());
+                if (frameScrollbar)
+                    result.setScrollbar(frameScrollbar);
+            }
+        }
+    }
+
+    return RenderPart::nodeAtPoint(request, result, locationInContainer, accumulatedOffset, action);
+}
+
 }
index 4fad560..a7deeda 100644 (file)
@@ -36,6 +36,7 @@ protected:
     explicit RenderFrameBase(Element*);
 
 public:
+    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
     void layoutWithFlattening(bool fixedWidth, bool fixedHeight);
 };
 
index 417d795..bdbc3f5 100644 (file)
@@ -3461,7 +3461,7 @@ bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
         // We didn't hit any layer. If we are the root layer and the mouse is -- or just was -- down, 
         // return ourselves. We do this so mouse events continue getting delivered after a drag has 
         // exited the WebView, and so hit testing over a scrollbar hits the content document.
-        if ((request.active() || request.release()) && isRootLayer()) {
+        if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isRootLayer()) {
             renderer()->updateHitTestResult(result, toRenderView(renderer())->flipForWritingMode(result.point()));
             insideLayer = this;
         }
index c014adc..d03f03c 100644 (file)
@@ -966,14 +966,14 @@ unsigned Internals::touchEventHandlerCount(Document* document, ExceptionCode& ec
 }
 
 PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y, unsigned topPadding, unsigned rightPadding,
-    unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode& ec) const
+    unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode& ec) const
 {
     if (!document || !document->frame() || !document->frame()->view()) {
         ec = INVALID_ACCESS_ERR;
         return 0;
     }
 
-    return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent);
+    return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent, allowChildFrameContent);
 }
 
 void Internals::emitInspectorDidBeginFrame()
index b73b7a8..2c7c860 100644 (file)
@@ -160,7 +160,7 @@ public:
     unsigned touchEventHandlerCount(Document*, ExceptionCode&);
 
     PassRefPtr<NodeList> nodesFromRect(Document*, int x, int y, unsigned topPadding, unsigned rightPadding,
-        unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, ExceptionCode&) const;
+        unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionCode&) const;
 
     void emitInspectorDidBeginFrame();
     void emitInspectorDidCancelFrame();
index afdc4a2..7049ec8 100644 (file)
@@ -138,7 +138,7 @@ module window {
 
         NodeList nodesFromRect(in Document document, in long x, in long y,
             in unsigned long topPadding, in unsigned long rightPadding, in unsigned long bottomPadding, in unsigned long leftPadding,
-            in boolean ignoreClipping, in boolean allowShadowContent) raises (DOMException);
+            in boolean ignoreClipping, in boolean allowShadowContent, in boolean allowChildFrameContent) raises (DOMException);
 
         void emitInspectorDidBeginFrame();
         void emitInspectorDidCancelFrame();
index 2e33cb8..82914df 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-04  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Allow child-frame content in hit-tests.
+        https://bugs.webkit.org/show_bug.cgi?id=95204
+
+        Reviewed by Antonio Gomes.
+
+        Update symbols for the Windows build-system.
+
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
 2012-09-04  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Drop default theme concept
index f5102e6..651c98f 100644 (file)
@@ -259,7 +259,7 @@ EXPORTS
         ??1ContextDestructionObserver@WebCore@@MAE@XZ
         ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
         ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
-        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
+        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
         ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
index bb1a0d2..d3bef46 100644 (file)
@@ -253,7 +253,7 @@ EXPORTS
         ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
         ?utf8@String@WTF@@QBE?AVCString@2@_N@Z
         ?view@Document@WebCore@@QBEPAVFrameView@2@XZ
-        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N0@Z
+        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?restrictScaleFactorToInitialScaleIfNotUserScalable@WebCore@@YAXAAUViewportAttributes@1@@Z
         ?restrictMinimumScaleFactorToViewportSize@WebCore@@YAXAAUViewportAttributes@1@VIntSize@1@@Z
index 6a8d1ec..b63b7c1 100644 (file)
@@ -162,7 +162,7 @@ _ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures22isCSSExclusionsEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures22isDialogElementEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures37isAuthorShadowDOMForAnyElementEnabledE;
-_ZNK7WebCore8Document13nodesFromRectEiijjjjbb;
+_ZNK7WebCore8Document13nodesFromRectEiijjjjbbb;
 _ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE;
 _ZNK7WebCore6Editor26selectionStartHasMarkerForENS_14DocumentMarker10MarkerTypeEii;
 _ZN7WebCore8Document33webkitDidExitFullScreenForElementEPNS_7ElementE;