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

yael.aharon at nokia.com yael.aharon at nokia.com
Wed Dec 22 15:49:16 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 75b8974a06166001922577002d313f6a2d23be05
Author: yael.aharon at nokia.com <yael.aharon at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 13 00:47:52 2010 +0000

    2010-11-12  Yael Aharon  <yael.aharon at nokia.com>
    
            Reviewed by David Hyatt.
    
            Spatial Navigation: Cannot focus on some ContainerNode
            https://bugs.webkit.org/show_bug.cgi?id=48393
    
            * fast/events/spatial-navigation/snav-container-only-white-space-expected.txt: Added.
            * fast/events/spatial-navigation/snav-container-only-white-space.html: Added.
            * fast/events/spatial-navigation/snav-container-white-space-expected.txt: Added.
            * fast/events/spatial-navigation/snav-container-white-space.html: Added.
    2010-11-12  Yael Aharon  <yael.aharon at nokia.com>
    
            Reviewed by David Hyatt.
    
            Spatial Navigation: Cannot focus on some ContainerNode
            https://bugs.webkit.org/show_bug.cgi?id=48393
    
            ContainerNode::getLowerRightCorner() assumes that the lowest right corner of its last child
            is its own lowest right corner. If that child is an empty text node after an image, it does
            not have size and position information, so we should go to the previous child.
    
            Tests: fast/events/spatial-navigation/snav-container-only-white-space.html
                   fast/events/spatial-navigation/snav-container-white-space.html
    
            * dom/ContainerNode.cpp:
            (WebCore::ContainerNode::getLowerRightCorner):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 720d861..eedb603 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-12  Yael Aharon  <yael.aharon at nokia.com>
+
+        Reviewed by David Hyatt.
+
+        Spatial Navigation: Cannot focus on some ContainerNode
+        https://bugs.webkit.org/show_bug.cgi?id=48393
+
+        * fast/events/spatial-navigation/snav-container-only-white-space-expected.txt: Added.
+        * fast/events/spatial-navigation/snav-container-only-white-space.html: Added.
+        * fast/events/spatial-navigation/snav-container-white-space-expected.txt: Added.
+        * fast/events/spatial-navigation/snav-container-white-space.html: Added.
+
 2010-11-12  Tony Chang  <tony at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space-expected.txt
new file mode 100644
index 0000000..9076a46
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space-expected.txt
@@ -0,0 +1,5 @@
+This is an element
+This is an element
+PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+This test tests that a anchor element with only white spaces gives the correct size in ContainerNode::getRect().
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space.html b/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space.html
new file mode 100644
index 0000000..f598e89
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-container-only-white-space.html
@@ -0,0 +1,74 @@
+<html>
+  <!--
+    This test ensures the correctness of a basic aspect of spatial navigation traversal
+    routines: focusable elements in scrollable containers (e.g. <div>) should be
+    accessible, including offscreen content.
+
+    * Pre-conditions:
+    1) DRT support for spatial navivation enable/disable.
+
+    * Navigation steps:
+    1) Loads this page, focus goes to "start" automatically.
+    2) Move focus down to the visible focusable element in
+       scrollable div.
+    3) Traverse the page through other focusable elements down the page.
+       and then back up.
+
+    * Expected results: All focusable element in scrollable content, including
+    offscreen ones, should be accessible via spatial navigation. -->
+  <head>
+    <style>
+    :focus {outline: 1px solid black;}
+    </style>
+    <script src="../../js/resources/js-test-pre.js"></script>
+    <script src="resources/spatial-navigation-utils.js"></script>
+    <script type="application/javascript">
+
+    var resultMap = [
+      ["Down", "2"],
+      ["Up", "start"],
+      ["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>
+    <a href="#" id="start">This is an element</a><br>
+
+    <div>
+      <a href="#" id="1">
+      </a>
+    </div>
+
+    <div>
+      <a href="#" id="2">This is an element</a><br>
+    </div>
+    <div id="console"></div>
+    <div>This test tests that a anchor element with only white spaces gives the correct size in ContainerNode::getRect().</div>
+  </body>
+</html>
+
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-container-white-space-expected.txt b/LayoutTests/fast/events/spatial-navigation/snav-container-white-space-expected.txt
new file mode 100644
index 0000000..4e29a01
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-container-white-space-expected.txt
@@ -0,0 +1,17 @@
+This is an element
+ 
+This is an element
+This is an element
+  
+This is an element
+PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
+PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
+This test tests that a anchor element with in image in it and a space after the image, can still give the correct size in ContainerNode::getRect().
diff --git a/LayoutTests/fast/events/spatial-navigation/snav-container-white-space.html b/LayoutTests/fast/events/spatial-navigation/snav-container-white-space.html
new file mode 100644
index 0000000..1f7d291
--- /dev/null
+++ b/LayoutTests/fast/events/spatial-navigation/snav-container-white-space.html
@@ -0,0 +1,91 @@
+<html>
+  <!--
+    This test ensures the correctness of a basic aspect of spatial navigation traversal
+    routines: focusable elements in scrollable containers (e.g. <div>) should be
+    accessible, including offscreen content.
+
+    * Pre-conditions:
+    1) DRT support for spatial navivation enable/disable.
+
+    * Navigation steps:
+    1) Loads this page, focus goes to "start" automatically.
+    2) Move focus down to the visible focusable element in
+       scrollable div.
+    3) Traverse the page through other focusable elements down the page.
+       and then back up.
+
+    * Expected results: All focusable element in scrollable content, including
+    offscreen ones, should be accessible via spatial navigation. -->
+  <head>
+    <style>
+    :focus {outline: 1px solid black;}
+    </style>
+    <script src="../../js/resources/js-test-pre.js"></script>
+    <script src="resources/spatial-navigation-utils.js"></script>
+    <script type="application/javascript">
+
+    var resultMap = [
+      ["Down", "1"],
+      ["Down", "2"],
+      ["Down", "3"],
+      ["Down", "4"],
+      ["Down", "5"],
+      ["Up", "4"],
+      ["Up", "3"],
+      ["Up", "2"],
+      ["Up", "1"],
+      ["Up", "start"],
+      ["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>
+    <a href="#" id="start">This is an element</a><br>
+
+    <div>
+      <a href="#" id="1">
+        <img src="resources/green.png" height="42" width="76"  border="0"/>
+      </a>
+    </div>
+
+    <div>
+      <a href="#" id="2">This is an element</a><br>
+    </div>
+
+    <a href="#" id="3">This is an element</a><br>
+
+    <a href="#" id="4">
+      <img src="resources/green.png" height="42" width="76" alt="llinker1" border="0"/>
+    </a><br>
+
+    <a href="#" id="5">This is an element</a><br>
+    <div id="console"></div>
+    <div>This test tests that a anchor element with in image in it and a space after the image, can still give the correct size in ContainerNode::getRect().</div>
+  </body>
+</html>
+
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3d709f0..a94c71a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-12  Yael Aharon  <yael.aharon at nokia.com>
+
+        Reviewed by David Hyatt.
+
+        Spatial Navigation: Cannot focus on some ContainerNode
+        https://bugs.webkit.org/show_bug.cgi?id=48393
+
+        ContainerNode::getLowerRightCorner() assumes that the lowest right corner of its last child 
+        is its own lowest right corner. If that child is an empty text node after an image, it does 
+        not have size and position information, so we should go to the previous child.
+
+        Tests: fast/events/spatial-navigation/snav-container-only-white-space.html
+               fast/events/spatial-navigation/snav-container-white-space.html
+
+        * dom/ContainerNode.cpp:
+        (WebCore::ContainerNode::getLowerRightCorner):
+
 2010-11-12  James Simonsen  <simonjam at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/dom/ContainerNode.cpp b/WebCore/dom/ContainerNode.cpp
index 075a78b..2120e38 100644
--- a/WebCore/dom/ContainerNode.cpp
+++ b/WebCore/dom/ContainerNode.cpp
@@ -876,6 +876,8 @@ bool ContainerNode::getLowerRightCorner(FloatPoint& point) const
             if (o->isText()) {
                 RenderText* text = toRenderText(o);
                 IntRect linesBox = text->linesBoundingBox();
+                if (!linesBox.x() && !linesBox.width() && !linesBox.y() && !linesBox.height())
+                    continue;
                 point.move(linesBox.x() + linesBox.width(), linesBox.y() + linesBox.height());
             } else {
                 RenderBox* box = toRenderBox(o);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list