Bug 84678
| Summary: | [GTK] spatial navigation failures | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Philippe Normand <pnormand> |
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | mrobinson, zan |
| Priority: | P2 | Keywords: | Gtk, LayoutTestFailure |
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Philippe Normand
--- /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("id") is "1"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 2. Was 3.
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 3. Was 4.
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 4. Was 5.
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
--- /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("id") is "23"
PASS gFocusedDocument.activeElement.getAttribute("id") is "25"
PASS gFocusedDocument.activeElement.getAttribute("id") is "26"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "27"
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 27. Was end.
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
--- /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("id") is "1"
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "7"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 7. Was 4.
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 6. Was end.
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
PASS gFocusedDocument.activeElement.getAttribute("id") is "6"
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
PASS gFocusedDocument.activeElement.getAttribute("id") is "7"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
-PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 3. Was 2.
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 2. Was 1.
+FAIL gFocusedDocument.activeElement.getAttribute("id") should be 1. Was start.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Philippe Normand
Zan did a bisect and commented on IRC the culprit commit is r114796.
Martin Robinson
This suggests that these tests depend on font metrics.
Zan Dobersek
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 <a> element with id 2 is inside a <div> element[1], this, combined with enabled Cairo metrics hinting, makes the <a> elements with ids 2 and 3 intersect by a tiny rect of size (114|1) at position (8|86). With the <a> 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 <div> element of the <a> 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
Zan Dobersek
Fixed by enabling the subpixel layout. Closing.