[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

tonikitoo at webkit.org tonikitoo at webkit.org
Wed Dec 22 11:17:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bfbed95c40a1fccb8049a6b0b8448a1377dd24fc
Author: tonikitoo at webkit.org <tonikitoo at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 19:45:50 2010 +0000

    Spatial navigation: do not consider outline for focusable element boundaries
    https://bugs.webkit.org/show_bug.cgi?id=42474
    
    Reviewed by Simon Fraser.
    Patch by Antonio Gomes <tonikitoo at webkit.org>
    
    WebCore:
    
    Test: fast/events/spatial-navigation/snav-zero-margin-content.html
    
    Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
    RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
    renderer/element. This method deals with outline, which is out of elements boundary.
    It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
    are inaccessible.
    
    Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
    which returns only the absolute bounding box rect of the Element.
    
    * page/SpatialNavigation.cpp:
    (WebCore::renderRectRelativeToRootDocument):
    (WebCore::checkNegativeCoordsForNode):
    
    LayoutTests:
    
    * fast/events/spatial-navigation/snav-zero-margin-content-expected.txt: Added.
    * fast/events/spatial-navigation/snav-zero-margin-content.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63572 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3d14140..99d21be 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-16  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial navigation: do not consider outline for focusable element boundaries
+        https://bugs.webkit.org/show_bug.cgi?id=42474
+
+        * fast/events/spatial-navigation/snav-zero-margin-content-expected.txt: Added.
+        * fast/events/spatial-navigation/snav-zero-margin-content.html: Added.
+
 2010-07-16  Ojan Vafai  <ojan at chromium.org>
 
         Unreviewed. Add another expected chromium failure and the missing the text expectation in r63567.
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content-expected.txt
new file mode 100644
index 0000000..dabf70b
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content-expected.txt
@@ -0,0 +1,3 @@
+test1 test2
+PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
+
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content.html b/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content.html
new file mode 100644
index 0000000..a629890
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-zero-margin-content.html
@@ -0,0 +1,70 @@
+<html>
+  <!--
+    This test ensures the traversal correctness of spatial navigation:
+    focusable elements accessible, including zero-margin content, should be
+    accessible.
+  -->
+  <head>
+    <style type="text/css">
+      body {
+        background:none repeat scroll 0 0 #FFFFFF;
+        color:black;
+        margin:0;
+      }
+
+      body, a, {
+        font-family:arial,sans-serif;
+        margin-right:2.5em;
+        font-size:13px;
+        text-decoration:underline;
+        color:#0000CC !important;
+      }
+    </style>
+
+    <script src="../../js/resources/js-test-pre.js"></script>
+    <script src="resources/spatial-navigation-utils.js"></script>
+    <script type="application/javascript">
+
+    var resultMap = [
+      ["Right", "end"],
+      ["DONE", "DONE"]
+    ];
+
+    if (window.layoutTestController) {
+      layoutTestController.dumpAsText();
+      layoutTestController.setSpatialNavigationEnabled(true);
+      layoutTestController.overridePreference("WebKitTabToLinksPreferenceKey", 1);
+      layoutTestController.waitUntilDone();
+    }
+
+    function runTest()
+    {
+      // starting the test itself: get to a known place.
+      document.getElementById("start").focus();
+
+      initTest(resultMap, testCompleted);
+    }
+
+    function testCompleted()
+    {
+      if (window.layoutTestController)
+        layoutTestController.notifyDone();
+    }
+
+    window.onload = runTest;
+
+    </script>
+    <script src="../js/resources/js-test-post.js"></script>
+  </head>
+  <body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
+    <span>
+      <div>
+        <nobr>
+          <a href="#" id="start"> test1 </a>
+          <a href="#" id="end"> test2 </a>
+        </nobr>
+      </div>
+    </span>
+    <div id="console"></div>
+  </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 11321f0..9c3a57d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-07-16  Antonio Gomes  <tonikitoo at webkit.org>
+
+        Reviewed by Simon Fraser.
+
+        Spatial navigation: do not consider outline for focusable element boundaries
+        https://bugs.webkit.org/show_bug.cgi?id=42474
+
+        Test: fast/events/spatial-navigation/snav-zero-margin-content.html
+
+        Currently in WebCore::renderRectRelativeToRootDocument function, we are calling
+        RenderObject::absoluteClippedOverflowRect to obtain the rect boundary of a given
+        renderer/element. This method deals with outline, which is out of elements boundary.
+        It makes spatial navigation to fail on common sites like google.gom: "Web, Images, Map, etc"
+        are inaccessible.
+
+        Patch replaces RenderObject::absoluteClippedOverflowRect by Node::getRect,
+        which returns only the absolute bounding box rect of the Element.
+
+        * page/SpatialNavigation.cpp:
+        (WebCore::renderRectRelativeToRootDocument):
+        (WebCore::checkNegativeCoordsForNode):
+
 2010-07-15  Antonio Gomes  <tonikitoo at webkit.org>
 
         Reviewed by Gustavo Noronha.
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index e748d12..40aa52b 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -103,14 +103,9 @@ void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate&
 // FIXME: This function does not behave correctly with transformed frames.
 static IntRect renderRectRelativeToRootDocument(RenderObject* render)
 {
-    ASSERT(render);
+    ASSERT(render && render->node());
 
-    IntRect rect(render->absoluteClippedOverflowRect());
-
-    if (rect.isEmpty()) {
-        Element* e = static_cast<Element*>(render->node());
-        rect = e->getRect();
-    }
+    IntRect rect = render->node()->getRect();
 
     // In cases when the |render|'s associated node is in a scrollable inner
     // document, we only consider its scrollOffset if it is not offscreen.
@@ -517,7 +512,7 @@ static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
 {
     ASSERT(node || node->renderer());
 
-    if (curRect.x() > 0 && curRect.y() > 0)
+    if (curRect.x() >= 0 && curRect.y() >= 0)
         return true;
 
     bool canBeScrolled = false;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list