| Differences between
and this patch
- Source/WebCore/ChangeLog +17 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2015-05-17  Andres Gonzalez  <agonzalez334@nc.rr.com>
2
3
        AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
4
        https://bugs.webkit.org/show_bug.cgi?id=141303
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Test: accessibility/ruby-hierarchy-roles.html
9
10
        * accessibility/AccessibilityObject.h:
11
        * accessibility/AccessibilityRenderObject.cpp:
12
        (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
13
        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
14
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
15
        (createAccessibilityRoleMap):
16
        (-[WebAccessibilityObjectWrapper subrole]):
17
1
2015-05-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
18
2015-05-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2
19
3
        [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
20
        [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
- Source/WebCore/accessibility/AccessibilityObject.h +5 lines
Lines 176-181 enum AccessibilityRole { Source/WebCore/accessibility/AccessibilityObject.h_sec1
176
    RadioGroupRole,
176
    RadioGroupRole,
177
    RowHeaderRole,
177
    RowHeaderRole,
178
    RowRole,
178
    RowRole,
179
    RubyBaseRole,
180
    RubyBlockRole,
181
    RubyInlineRole,
182
    RubyRunRole,
183
    RubyTextRole,
179
    RulerRole,
184
    RulerRole,
180
    RulerMarkerRole,
185
    RulerMarkerRole,
181
    ScrollAreaRole,
186
    ScrollAreaRole,
- Source/WebCore/accessibility/AccessibilityRenderObject.cpp -4 / +19 lines
Lines 1377-1383 bool AccessibilityRenderObject::computeA Source/WebCore/accessibility/AccessibilityRenderObject.cpp_sec1
1377
    if (node && node->hasTagName(dfnTag))
1377
    if (node && node->hasTagName(dfnTag))
1378
        return false;
1378
        return false;
1379
    
1379
    
1380
    // By default, objects should be ignored so that the AX hierarchy is not 
1380
    // Make sure that ruby containers are not ignored.
1381
    if (m_renderer->isRubyRun()
1382
        || m_renderer->isRubyBlock()
1383
        || m_renderer->isRubyInline())
1384
        return false;
1385
1386
    // By default, objects should be ignored so that the AX hierarchy is not
1381
    // filled with unnecessary items.
1387
    // filled with unnecessary items.
1382
    return true;
1388
    return true;
1383
}
1389
}
Lines 2570-2578 AccessibilityRole AccessibilityRenderObj Source/WebCore/accessibility/AccessibilityRenderObject.cpp_sec2
2570
    if (node && node->hasTagName(dlTag))
2576
    if (node && node->hasTagName(dlTag))
2571
        return DescriptionListRole;
2577
        return DescriptionListRole;
2572
2578
2573
    if (node && (node->hasTagName(rpTag) || node->hasTagName(rtTag)))
2579
    // Check for Ruby elements
2574
        return AnnotationRole;
2580
    if (m_renderer->isRubyText())
2575
2581
        return RubyTextRole;
2582
    if (m_renderer->isRubyBase())
2583
        return RubyBaseRole;
2584
    if (m_renderer->isRubyRun())
2585
        return RubyRunRole;
2586
    if (m_renderer->isRubyBlock())
2587
        return RubyBlockRole;
2588
    if (m_renderer->isRubyInline())
2589
        return RubyInlineRole;
2590
    
2576
    // This return value is what will be used if AccessibilityTableCell determines
2591
    // This return value is what will be used if AccessibilityTableCell determines
2577
    // the cell should not be treated as a cell (e.g. because it is a layout table.
2592
    // the cell should not be treated as a cell (e.g. because it is a layout table.
2578
    // In ATK, there is a distinction between generic text block elements and other
2593
    // In ATK, there is a distinction between generic text block elements and other
- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm +43 lines
Lines 120-125 using namespace HTMLNames; Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm_sec1
120
#define NSAccessibilityContentSeparatorSubrole @"AXContentSeparator"
120
#define NSAccessibilityContentSeparatorSubrole @"AXContentSeparator"
121
#endif
121
#endif
122
122
123
// Define the Ruby subroles if are not defined in NSAccessibility.h
124
125
#ifndef NSAccessibilityRubyBaseSubRole
126
#define NSAccessibilityRubyBaseSubrole @"AXRubyBase"
127
#endif
128
129
#ifndef NSAccessibilityRubyBlockSubrole
130
#define NSAccessibilityRubyBlockSubrole @"AXRubyBlock"
131
#endif
132
133
#ifndef NSAccessibilityRubyInlineSubrole
134
#define NSAccessibilityRubyInlineSubrole @"AXRubyInline"
135
#endif
136
137
#ifndef NSAccessibilityRubyRunSubrole
138
#define NSAccessibilityRubyRunSubrole @"AXRubyRun"
139
#endif
140
141
#ifndef NSAccessibilityRubyTextSubrole
142
#define NSAccessibilityRubyTextSubrole @"AXRubyText"
143
#endif
144
123
// Miscellaneous
145
// Miscellaneous
124
#ifndef NSAccessibilityBlockQuoteLevelAttribute
146
#ifndef NSAccessibilityBlockQuoteLevelAttribute
125
#define NSAccessibilityBlockQuoteLevelAttribute @"AXBlockQuoteLevel"
147
#define NSAccessibilityBlockQuoteLevelAttribute @"AXBlockQuoteLevel"
Lines 1959-1964 static const AccessibilityRoleMap& creat Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm_sec2
1959
        { BlockquoteRole, NSAccessibilityGroupRole },
1981
        { BlockquoteRole, NSAccessibilityGroupRole },
1960
        { SwitchRole, NSAccessibilityCheckBoxRole },
1982
        { SwitchRole, NSAccessibilityCheckBoxRole },
1961
        { SearchFieldRole, NSAccessibilityTextFieldRole },
1983
        { SearchFieldRole, NSAccessibilityTextFieldRole },
1984
        { RubyBaseRole, NSAccessibilityGroupRole },
1985
        { RubyBlockRole, NSAccessibilityGroupRole },
1986
        { RubyInlineRole, NSAccessibilityGroupRole },
1987
        { RubyRunRole, NSAccessibilityGroupRole },
1988
        { RubyTextRole, NSAccessibilityGroupRole },
1962
    };
1989
    };
1963
    AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
1990
    AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
1964
    
1991
    
Lines 2138-2143 - (NSString*)subrole Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm_sec3
2138
2165
2139
    if (m_object->isSwitch())
2166
    if (m_object->isSwitch())
2140
        return NSAccessibilitySwitchSubrole;
2167
        return NSAccessibilitySwitchSubrole;
2168
2169
    // Ruby subroles
2170
    switch (role) {
2171
    case RubyBaseRole:
2172
        return NSAccessibilityRubyBaseSubrole;
2173
    case RubyBlockRole:
2174
        return NSAccessibilityRubyBlockSubrole;
2175
    case RubyInlineRole:
2176
        return NSAccessibilityRubyInlineSubrole;
2177
    case RubyRunRole:
2178
        return NSAccessibilityRubyRunSubrole;
2179
    case RubyTextRole:
2180
        return NSAccessibilityRubyTextSubrole;
2181
    default:
2182
        break;
2183
    }
2141
    
2184
    
2142
    return nil;
2185
    return nil;
2143
}
2186
}
- LayoutTests/ChangeLog +12 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2015-05-17  Andres Gonzalez  <agonzalez334@nc.rr.com>
2
3
        AX: WebKit exposes all Ruby Text as Unknown (Japanese EPUB accessibility blocker)
4
        https://bugs.webkit.org/show_bug.cgi?id=141303
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * accessibility/ruby-hierarchy-roles-expected.txt: Added.
9
        * accessibility/ruby-hierarchy-roles.html: Added.
10
        * platform/mac-mavericks/accessibility/ruby-hierarchy-roles-expected.txt: Added.
11
        * platform/mac/accessibility/ruby-hierarchy-roles-expected.txt: Added.
12
1
2015-05-16  Zalan Bujtas  <zalan@apple.com>
13
2015-05-16  Zalan Bujtas  <zalan@apple.com>
2
14
3
        REGRESSION (Subpixel): Dashed underline is missing when box is positioned at subpixels.
15
        REGRESSION (Subpixel): Dashed underline is missing when box is positioned at subpixels.
- LayoutTests/accessibility/ruby-hierarchy-roles-expected.txt +9 lines
Line 0 LayoutTests/accessibility/ruby-hierarchy-roles-expected.txt_sec1
1
This tests that the ruby containers are exposed with the appropriate hierarchy and roles.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS successfullyParsed is true
7
8
TEST COMPLETE
9
basetext rubytext
- LayoutTests/accessibility/ruby-hierarchy-roles.html +79 lines
Line 0 LayoutTests/accessibility/ruby-hierarchy-roles.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
    <head>
4
        <script src="../resources/js-test-pre.js"></script>
5
    </head>
6
    <body>
7
        <ruby id="rubyElemId">
8
            <rb>basetext</rb>
9
            <rp>(</rp>
10
            <rt>rubytext</rt>
11
            <rp>)</rp>
12
        </ruby>
13
        
14
        <script>
15
            if (window.accessibilityController) {
16
                description("This tests that the ruby containers are exposed with the appropriate hierarchy and roles.")
17
                // At the moment, this is implemented only for OSX.
18
                var platform = accessibilityController.platformName;
19
                if ("mac" == platform) {
20
                    // Expected values for roles and subroles.
21
                    var expectedRubyRole = "AXRole: AXGroup"; // all ruby containers have AXGroup role
22
                    var expectedRubyInlineSubrole = "AXSubrole: AXRubyInline";
23
                    var expectedRubyBlockSubrole = "AXSubrole: AXRubyBlock";
24
                    var expectedRubyRunSubrole = "AXSubrole: AXRubyRun";
25
                    var expectedRubyTextSubrole = "AXSubrole: AXRubyText";
26
                    var expectedRubyBaseSubrole = "AXSubrole: AXRubyBase";
27
                    
28
                    // Try inline style first, block style second
29
                    var rubyElem = document.getElementById("rubyElemId");
30
                    shouldBeTrue("rubyElem != null");
31
                    rubyElem.style.display = "inline";
32
                    checkHierarchyAndRoles(rubyElem);
33
                    
34
                    rubyElem.style.display = "block";
35
                    checkHierarchyAndRoles(rubyElem);
36
                    
37
                    function checkHierarchyAndRoles(rubyElem) {
38
                        axRuby = window.accessibilityController.accessibleElementById("rubyElemId");
39
                        shouldBeTrue("axRuby != null");
40
                        role = axRuby.role;
41
                        subrole = axRuby.subrole;
42
                        shouldBe("role", "expectedRubyRole");
43
                        if (rubyElem.style.display == "inline") {
44
                            shouldBe("subrole", "expectedRubyInlineSubrole");
45
                        }
46
                        else {
47
                            shouldBe("subrole", "expectedRubyBlockSubrole");
48
                        }
49
                        
50
                        // RubyRun
51
                        axRubyRun = axRuby.childAtIndex(0);
52
                        shouldBeTrue("axRubyRun != null");
53
                        role = axRubyRun.role;
54
                        subrole = axRubyRun.subrole;
55
                        shouldBe("role", "expectedRubyRole");
56
                        shouldBe("subrole", "expectedRubyRunSubrole");
57
                        
58
                        // RubyText
59
                        axRubyText = axRubyRun.childAtIndex(0);
60
                        shouldBeTrue("axRubyText != null");
61
                        role = axRubyText.role;
62
                        subrole = axRubyText.subrole;
63
                        shouldBe("role", "expectedRubyRole");
64
                        shouldBe("subrole", "expectedRubyTextSubrole");
65
                        
66
                        // RubyBase
67
                        axRubyBase = axRubyRun.childAtIndex(1);
68
                        shouldBeTrue("axRubyBase != null");
69
                        role = axRubyBase.role;
70
                        subrole = axRubyBase.subrole;
71
                        shouldBe("role", "expectedRubyRole");
72
                        shouldBe("subrole", "expectedRubyBaseSubrole");
73
                    }
74
                }
75
            }
76
        </script>
77
        <script src="../resources/js-test-post.js"></script>
78
    </body>
79
</html>
- LayoutTests/platform/mac-mavericks/accessibility/ruby-hierarchy-roles-expected.txt +34 lines
Line 0 LayoutTests/platform/mac-mavericks/accessibility/ruby-hierarchy-roles-expected.txt_sec1
1
This tests that the ruby containers are exposed with the appropriate hierarchy and roles.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS rubyElem != null is true
7
PASS axRuby != null is true
8
PASS role is expectedRubyRole
9
PASS subrole is expectedRubyInlineSubrole
10
PASS axRubyRun != null is true
11
PASS role is expectedRubyRole
12
PASS subrole is expectedRubyRunSubrole
13
PASS axRubyText != null is true
14
PASS role is expectedRubyRole
15
PASS subrole is expectedRubyTextSubrole
16
PASS axRubyBase != null is true
17
PASS role is expectedRubyRole
18
PASS subrole is expectedRubyBaseSubrole
19
PASS axRuby != null is true
20
PASS role is expectedRubyRole
21
PASS subrole is expectedRubyBlockSubrole
22
PASS axRubyRun != null is true
23
PASS role is expectedRubyRole
24
PASS subrole is expectedRubyRunSubrole
25
PASS axRubyText != null is true
26
PASS role is expectedRubyRole
27
PASS subrole is expectedRubyTextSubrole
28
PASS axRubyBase != null is true
29
PASS role is expectedRubyRole
30
PASS subrole is expectedRubyBaseSubrole
31
PASS successfullyParsed is true
32
33
TEST COMPLETE
34
basetext rubytext
- LayoutTests/platform/mac/accessibility/ruby-hierarchy-roles-expected.txt +34 lines
Line 0 LayoutTests/platform/mac/accessibility/ruby-hierarchy-roles-expected.txt_sec1
1
This tests that the ruby containers are exposed with the appropriate hierarchy and roles.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS rubyElem != null is true
7
PASS axRuby != null is true
8
PASS role is expectedRubyRole
9
PASS subrole is expectedRubyInlineSubrole
10
PASS axRubyRun != null is true
11
PASS role is expectedRubyRole
12
PASS subrole is expectedRubyRunSubrole
13
PASS axRubyText != null is true
14
PASS role is expectedRubyRole
15
PASS subrole is expectedRubyTextSubrole
16
PASS axRubyBase != null is true
17
PASS role is expectedRubyRole
18
PASS subrole is expectedRubyBaseSubrole
19
PASS axRuby != null is true
20
PASS role is expectedRubyRole
21
PASS subrole is expectedRubyBlockSubrole
22
PASS axRubyRun != null is true
23
PASS role is expectedRubyRole
24
PASS subrole is expectedRubyRunSubrole
25
PASS axRubyText != null is true
26
PASS role is expectedRubyRole
27
PASS subrole is expectedRubyTextSubrole
28
PASS axRubyBase != null is true
29
PASS role is expectedRubyRole
30
PASS subrole is expectedRubyBaseSubrole
31
PASS successfullyParsed is true
32
33
TEST COMPLETE
34
basetext rubytext

Return to Bug 141303