<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>84678</bug_id>
          
          <creation_ts>2012-04-24 00:59:44 -0700</creation_ts>
          <short_desc>[GTK] spatial navigation failures</short_desc>
          <delta_ts>2013-04-23 10:52:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk, LayoutTestFailure</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Normand">pnormand</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mrobinson</cc>
    
    <cc>zan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>608429</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-04-24 00:59:44 -0700</bug_when>
    <thetext>--- /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-container-white-space-expected.txt 
+++ /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-container-white-space-actual.txt 
@@ -5,9 +5,9 @@
   
 This is an element
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;1&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;2&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;3&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;4&quot;
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 2. Was 3.
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 3. Was 4.
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 4. Was 5.
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;5&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;4&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;3&quot;

--- /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-fully-aligned-horizontally-expected.txt 
+++ /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-fully-aligned-horizontally-actual.txt 
@@ -41,6 +41,6 @@
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;23&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;25&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;26&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;27&quot;
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 27. Was end.
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;end&quot;
 
--- /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-iframe-no-scrollable-content-expected.txt 
+++ /home/slave/webkitgtk/gtk-linux-64-release/build/layout-test-results/fast/spatial-navigation/snav-iframe-no-scrollable-content-actual.txt 
@@ -5,15 +5,15 @@
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;1&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;2&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;3&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;7&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;6&quot;
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 7. Was 4.
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 6. Was end.
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;end&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;4&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;5&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;6&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;3&quot;
 PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;7&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;3&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;2&quot;
-PASS gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) is &quot;1&quot;
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 3. Was 2.
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 2. Was 1.
+FAIL gFocusedDocument.activeElement.getAttribute(&quot;id&quot;) should be 1. Was start.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>608772</commentid>
    <comment_count>1</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2012-04-24 09:45:46 -0700</bug_when>
    <thetext>Zan did a bisect and commented on IRC the culprit commit is r114796.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>608842</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-04-24 10:57:09 -0700</bug_when>
    <thetext>This suggests that these tests depend on font metrics.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>656608</commentid>
    <comment_count>3</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2012-06-25 09:06:51 -0700</bug_when>
    <thetext>I debugged this a bit, specifically on the fast/spatial-navigation/snav-container-white-space.html test case.

As evident from the output, the problem is that when the test wants to move focus down from the element with id 1 to element with id 2, this element is skipped and the focus shifts to element with id 3.

It turns out that because the &lt;a&gt; element with id 2 is inside a &lt;div&gt; element[1], this, combined with enabled Cairo metrics hinting, makes the &lt;a&gt; elements with ids 2 and 3 intersect by a tiny rect of size (114|1) at position (8|86). With the &lt;a&gt; element with id 3 being on top, this makes the focus-controlling algorithm[2] mark that node as the closest node to which the focus is shifted.

The test for example passes if the parent &lt;div&gt; element of the &lt;a&gt; element with id 2 is added a padding: 2px; style or is just removed.
The test also passes in GtkLauncher.


[1] - http://trac.webkit.org/browser/trunk/LayoutTests/fast/spatial-navigation/snav-container-white-space.html#L76
[2] - http://trac.webkit.org/browser/trunk/Source/WebCore/page/FocusController.cpp#L739</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>879973</commentid>
    <comment_count>4</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2013-04-23 10:52:16 -0700</bug_when>
    <thetext>Fixed by enabling the subpixel layout. Closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>