| Differences between
and this patch
- Source/WebCore/ChangeLog +17 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2013-09-12  Abhijeet Kandalkar  <abhijeet.k@samsung.com>
2
3
        Spatial navigation is not working for anchor with inline div with inline img.
4
        https://bugs.webkit.org/show_bug.cgi?id=97229
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        While calculating better candidate node, Spatial Navigation algorithm considered clipped-rectangle and bounding box rectangle of a given node.
9
        But for inline element having blocks as children this approach fails. Algorithm should consider the absoluteBoundingBox and absoluteFocusRingQuads
10
        of elements for calculations.
11
12
        Test: fast/spatial-navigation/snav-inline-with-blocks.html
13
14
        * page/SpatialNavigation.cpp:
15
        (WebCore::hasOffscreenRect):
16
        (WebCore::nodeRectInAbsoluteCoordinates):
17
1
2013-09-12  Zoltan Horvath  <zoltan@webkit.org>
18
2013-09-12  Zoltan Horvath  <zoltan@webkit.org>
2
19
3
        Move LineInfo class into LineInfo.h
20
        Move LineInfo class into LineInfo.h
- Source/WebCore/page/SpatialNavigation.cpp -2 / +23 lines
Lines 29-34 Source/WebCore/page/SpatialNavigation.cpp_sec1
29
#include "config.h"
29
#include "config.h"
30
#include "SpatialNavigation.h"
30
#include "SpatialNavigation.h"
31
31
32
#include "FloatQuad.h"
32
#include "Frame.h"
33
#include "Frame.h"
33
#include "FrameTree.h"
34
#include "FrameTree.h"
34
#include "FrameView.h"
35
#include "FrameView.h"
Lines 326-332 Source/WebCore/page/SpatialNavigation.cpp_sec2
326
    if (!render)
327
    if (!render)
327
        return true;
328
        return true;
328
329
329
    LayoutRect rect(render->absoluteClippedOverflowRect());
330
    LayoutRect rect(render->absoluteBoundingBoxRect());
330
    if (rect.isEmpty())
331
    if (rect.isEmpty())
331
        return true;
332
        return true;
332
333
Lines 523-530 Source/WebCore/page/SpatialNavigation.cpp_sec3
523
524
524
    if (node->isDocumentNode())
525
    if (node->isDocumentNode())
525
        return frameRectInAbsoluteCoordinates(toDocument(node)->frame());
526
        return frameRectInAbsoluteCoordinates(toDocument(node)->frame());
526
    LayoutRect rect = rectToAbsoluteCoordinates(node->document().frame(), node->boundingBox());
527
527
528
    Vector<FloatQuad> quads;
529
    RenderObject* obj = node->renderer();
530
    if (!obj)
531
        return LayoutRect();
532
533
    obj->absoluteFocusRingQuads(quads);
534
535
    size_t count = quads.size();
536
    if (!count)
537
        return LayoutRect();
538
539
    LayoutRect result;
540
    for (size_t i = 0; i < count; ++i) {
541
        IntRect r = quads[i].enclosingBoundingBox();
542
543
        if (!r.isEmpty())
544
            result.unite(r);
545
    }
546
547
    LayoutRect rect = rectToAbsoluteCoordinates(node->document().frame(), result);
548
528
    // For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
549
    // For authors that use border instead of outline in their CSS, we compensate by ignoring the border when calculating
529
    // the rect of the focused element.
550
    // the rect of the focused element.
530
    if (ignoreBorder) {
551
    if (ignoreBorder) {
- LayoutTests/fast/spatial-navigation/snav-inline-with-blocks-expected.txt +17 lines
Line 0 LayoutTests/fast/spatial-navigation/snav-inline-with-blocks-expected.txt_sec1
1
Start
2
Link 1
3
Link 2
4
Link 3
5
Link 4
6
End
7
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
9
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "end"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
15
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
16
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
17
- LayoutTests/fast/spatial-navigation/snav-inline-with-blocks.html +83 lines
Line 0 LayoutTests/fast/spatial-navigation/snav-inline-with-blocks.html_sec1
1
<html>
2
  <!--
3
    This test ensures the inline element whose children are block elememts can be focused using Spatial Navigation
4
5
    * Pre-conditions:
6
    1) TestRunner support for SNav enable/disable.
7
8
    * Navigation steps:
9
    1) Loads this page, focus goes to "start" automatically.
10
    2) Try to traverse the links on page in down direction and then back in up direction.
11
  -->
12
<head>
13
    <script src="../../resources/js-test-pre.js"></script>
14
    <script src="resources/spatial-navigation-utils.js"></script>
15
    <script type="application/javascript">
16
17
    var resultMap = [
18
        ["Down", "1"],
19
        ["Down", "2"],
20
        ["Down", "3"],
21
        ["Down", "4"],
22
        ["Down", "end"],
23
        ["Up", "4"],
24
        ["Up", "3"],
25
        ["Up", "2"],
26
        ["Up", "1"],
27
        ["Up", "start"],
28
        ["DONE", "DONE"]
29
    ];
30
31
    if (window.testRunner) {
32
        testRunner.dumpAsText();
33
        testRunner.setSpatialNavigationEnabled(true);
34
        testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
35
        testRunner.waitUntilDone();
36
    }
37
38
    function runTest()
39
    {
40
        document.getElementById("start").focus();
41
        initTest(resultMap, testCompleted);
42
    }
43
44
    function testCompleted()
45
    {
46
        if (window.testRunner)
47
            testRunner.notifyDone();
48
    }
49
50
    window.onload = runTest;
51
52
    </script>
53
    <script src="../resources/js-test-post.js"></script>
54
</head>
55
<body id="some-content" xmlns="http://www.w3.org/1999/xhtml">
56
    <table style="text-align: left; margin-left: auto; margin-right: auto;" cellpadding="2" cellspacing="1">
57
    <tbody>
58
        <tr>
59
            <td style="vertical-align: top; text-align: center;"></td>
60
            <td style="vertical-align: top; text-align: center;"><a id="start" href="a"><div>Start</div></a></td>
61
            <td style="vertical-align: top; text-align: center; width: 7px;"></td>
62
        </tr>
63
        <tr>
64
            <td style="text-align: center;"></td>
65
            <td style="text-align: center;">
66
            <a id = "1" href="#"><div> Link 1 </div></a>
67
            <a id = "2" href="#"><div> Link 2 </div></a>
68
            <a id = "3" href="#"><div> Link 3 </div></a>
69
            <a id = "4" href="#"><div> Link 4 </div></a>
70
            </td>
71
            <td style="text-align: center; width: 7px;"></td>
72
        </tr>
73
        <tr>
74
            <td style="vertical-align: top; text-align: center;"></td>
75
            <td style="vertical-align: top; text-align: center;"><a id="end" href="a"><div>End</div></a></td>
76
            <td style="vertical-align: top; text-align: center; width: 7px;"></td>
77
        </tr>
78
    </tbody>
79
    </table>
80
    <div id="console"></div>
81
</body>
82
</html>
83
- LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt -1 / +1 lines
Lines 4-14 LayoutTests/fast/spatial-navigation/snav-container-white-space-expected.txt_sec1
4
This is an element
4
This is an element
5
  
5
  
6
This is an element
6
This is an element
7
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
7
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
9
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
9
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "5"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "4"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
- LayoutTests/fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt -3 / +3 lines
Lines 9-18 LayoutTests/fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt_sec1
9
9
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "f2"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "f2"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "f3"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "f3"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "f3"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "f4"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "f4"
14
FAIL gFocusedDocument.activeElement.getAttribute("id") should be f4. Was f5.
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "f5"
15
FAIL gFocusedDocument.activeElement.getAttribute("id") should be f5. Was f6.
16
PASS gFocusedDocument.activeElement.getAttribute("id") is "f6"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "f6"
15
PASS gFocusedDocument.activeElement.getAttribute("id") is "f7"
16
PASS gFocusedDocument.activeElement.getAttribute("id") is "f8"
17
PASS gFocusedDocument.activeElement.getAttribute("id") is "f9"
17
PASS gFocusedDocument.activeElement.getAttribute("id") is "f9"
18
This test is testing that div with overflow:auto would scroll, by div with overflow:hidden would not.
18
This test is testing that div with overflow:auto would scroll, by div with overflow:hidden would not.
- LayoutTests/fast/spatial-navigation/snav-simple-content-overflow-expected.txt -1 / +1 lines
Lines 20-24 LayoutTests/fast/spatial-navigation/snav-simple-content-overflow-expected.txt_sec1
20
20
21
This link should NOT get focused.
21
This link should NOT get focused.
22
22
23
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
23
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
24
24
- LayoutTests/fast/spatial-navigation/snav-container-white-space.html -1 / +1 lines
Lines 25-35 LayoutTests/fast/spatial-navigation/snav-container-white-space.html_sec1
25
    <script type="application/javascript">
25
    <script type="application/javascript">
26
26
27
    var resultMap = [
27
    var resultMap = [
28
      ["Down", "1"],
29
      ["Down", "2"],
28
      ["Down", "2"],
30
      ["Down", "3"],
29
      ["Down", "3"],
31
      ["Down", "4"],
30
      ["Down", "4"],
32
      ["Down", "5"],
31
      ["Down", "5"],
32
      ["Down", "5"],
33
      ["Up", "4"],
33
      ["Up", "4"],
34
      ["Up", "3"],
34
      ["Up", "3"],
35
      ["Up", "2"],
35
      ["Up", "2"],
- LayoutTests/fast/spatial-navigation/snav-div-overflow-scrol-hidden.html -3 / +3 lines
Lines 5-18 LayoutTests/fast/spatial-navigation/snav-div-overflow-scrol-hidden.html_sec1
5
    <script type="application/javascript">
5
    <script type="application/javascript">
6
6
7
    var resultMap = [
7
    var resultMap = [
8
      ["Down", "f2"],
9
      ["Down", "f3"],
8
      ["Down", "f3"],
10
      ["Down", "f3"],
11
      ["Down", "f4"],
9
      ["Down", "f4"],
12
      ["Down", "f4"],
13
      ["Down", "f5"],
10
      ["Down", "f5"],
14
      ["Down", "f6"],
11
      ["Down", "f6"],
12
      ["Down", "f7"],
13
      ["Down", "f8"],
15
      ["Down", "f9"],
14
      ["Down", "f9"],
15
      ["Down", "f9"],
16
      ["DONE", "DONE"]
16
      ["DONE", "DONE"]
17
    ];
17
    ];
18
18
- LayoutTests/fast/spatial-navigation/snav-simple-content-overflow.html -1 / +1 lines
Lines 30-36 LayoutTests/fast/spatial-navigation/snav-simple-content-overflow.html_sec1
30
    <script type="application/javascript">
30
    <script type="application/javascript">
31
31
32
    var resultMap = [
32
    var resultMap = [
33
      ["Down", "start"],
33
      ["Down", "1"],
34
      ["DONE", "DONE"]
34
      ["DONE", "DONE"]
35
    ];
35
    ];
36
36
- LayoutTests/fast/spatial-navigation/snav-clipped-overflowed-content-expected.txt -4 / +4 lines
Lines 4-16 LayoutTests/fast/spatial-navigation/snav-clipped-overflowed-content-expected.txt_sec1
4
.
4
.
5
5
6
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
6
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
7
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
7
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
9
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
8
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
9
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
10
PASS gFocusedDocument.activeElement.getAttribute("id") is "3"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
11
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "2"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
12
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
15
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
13
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
14
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
15
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
16
This test tests that a div with css overflow:auto will scroll to reveal its focusable elements
16
This test tests that a div with css overflow:auto will scroll to reveal its focusable elements
- LayoutTests/fast/spatial-navigation/snav-only-clipped-overflow-content-expected.txt -1 / +1 lines
Lines 14-19 LayoutTests/fast/spatial-navigation/snav-only-clipped-overflow-content-expected.txt_sec1
14
14
15
And this is another normal link_2.
15
And this is another normal link_2.
16
16
17
PASS gFocusedDocument.activeElement.getAttribute("id") is "start"
17
PASS gFocusedDocument.activeElement.getAttribute("id") is "1"
18
PASS true is true
18
PASS true is true
19
19
- LayoutTests/fast/spatial-navigation/snav-clipped-overflowed-content.html -4 / +4 lines
Lines 34-48 LayoutTests/fast/spatial-navigation/snav-clipped-overflowed-content.html_sec1
34
34
35
    var resultMap = [
35
    var resultMap = [
36
      ["Down", "1"],
36
      ["Down", "1"],
37
      ["Down", "1"],
38
      ["Down", "2"],
37
      ["Down", "2"],
39
      ["Down", "2"],
40
      ["Down", "3"],
38
      ["Down", "3"],
39
      ["Down", "3"],
40
      ["Down", "3"],
41
      ["Up", "2"],
41
      ["Up", "2"],
42
      ["Up", "2"],
43
      ["Up", "1"],
42
      ["Up", "1"],
44
      ["Up", "1"],
45
      ["Up", "start"],
43
      ["Up", "start"],
44
      ["Up", "start"],
45
      ["Up", "start"],
46
      ["DONE", "DONE"]
46
      ["DONE", "DONE"]
47
    ];
47
    ];
48
48
- LayoutTests/fast/spatial-navigation/snav-only-clipped-overflow-content.html -1 / +1 lines
Lines 32-38 LayoutTests/fast/spatial-navigation/snav-only-clipped-overflow-content.html_sec1
32
    <script type="application/javascript">
32
    <script type="application/javascript">
33
33
34
    var resultMap = [
34
    var resultMap = [
35
      ["Down", "start"],
35
      ["Down", "1"],
36
      ["DONE", "DONE"]
36
      ["DONE", "DONE"]
37
    ];
37
    ];
38
38
- LayoutTests/ChangeLog +25 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2013-09-12  Abhijeet Kandalkar  <abhijeet.k@samsung.com>
2
3
        Spatial navigation is not working for anchor with inline div with inline img.
4
        https://bugs.webkit.org/show_bug.cgi?id=97229
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        While calculating better candidate node, Spatial Navigation algorithm considered clipped-rectangle and bounding box rectangle of a given node.
9
        But for inline element having blocks as children this approach fails. Algorithm should consider the absoluteBoundingBox and absoluteFocusRingQuads
10
        of elements for calculations.
11
12
        * fast/spatial-navigation/snav-clipped-overflowed-content-expected.txt:
13
        * fast/spatial-navigation/snav-clipped-overflowed-content.html:
14
        * fast/spatial-navigation/snav-container-white-space-expected.txt:
15
        * fast/spatial-navigation/snav-container-white-space.html:
16
        * fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt:
17
        * fast/spatial-navigation/snav-div-overflow-scrol-hidden.html:
18
        * fast/spatial-navigation/snav-inline-with-blocks-expected.txt: Added.
19
        * fast/spatial-navigation/snav-inline-with-blocks.html: Added.
20
        * fast/spatial-navigation/snav-only-clipped-overflow-content-expected.txt:
21
        * fast/spatial-navigation/snav-only-clipped-overflow-content.html:
22
        * fast/spatial-navigation/snav-simple-content-overflow-expected.txt:
23
        * fast/spatial-navigation/snav-simple-content-overflow.html:
24
        * platform/mac-lion/TestExpectations: Failing due to change in logic of calculating rect for candidate node. Need to handle separately.
25
1
2013-09-12  Gurpreet Kaur  <k.gurpreet@samsung.com>
26
2013-09-12  Gurpreet Kaur  <k.gurpreet@samsung.com>
2
27
3
        CSS Unit vw in border-width maps to 0px.
28
        CSS Unit vw in border-width maps to 0px.
- LayoutTests/platform/mac-lion/TestExpectations +5 lines
Lines 156-158 LayoutTests/platform/mac-lion/TestExpectations_sec1
156
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing-position.html [ ImageOnlyFailure ]
156
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing-position.html [ ImageOnlyFailure ]
157
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing-size.html [ ImageOnlyFailure ]   
157
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing-size.html [ ImageOnlyFailure ]   
158
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing.html [ ImageOnlyFailure ]
158
webkit.org/b/118870 [ Debug ] compositing/patterns/direct-pattern-compositing.html [ ImageOnlyFailure ]
159
160
# Failing due to change in logic of calculating rect for candidate node
161
# https://bugs.webkit.org/show_bug.cgi?id=97229
162
fast/spatial-navigation/snav-imagemap-overlapped-areas.html [ Failure ]
163
fast/spatial-navigation/snav-div-overflow-scrol-hidden.html [ Failure ]

Return to Bug 97229