| Differences between
and this patch
- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp -1 / +5 lines
Lines 2344-2351 String AccessibilityNodeObject::textUnderElement(AccessibilityTextUnderElementMo a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp_sec1
2344
2344
2345
        if (node) {
2345
        if (node) {
2346
            auto* childParentElement = child->node() ? child->node()->parentElement() : nullptr;
2346
            auto* childParentElement = child->node() ? child->node()->parentElement() : nullptr;
2347
            auto isInShadowTree = [] (Node& node) {
2348
                return node.isInShadowTree() || node.isInUserAgentShadowTree();
2349
            };
2347
            // Do not take the textUnderElement for a different element (determined by child's element parent not being us). Otherwise we may doubly-expose the same text.
2350
            // Do not take the textUnderElement for a different element (determined by child's element parent not being us). Otherwise we may doubly-expose the same text.
2348
            if (childParentElement && childParentElement != node && childParentElement->shadowHost() != node && node->isInShadowTree() == childParentElement->isInShadowTree())
2351
            // But for now, don't do this if either node is in the shadow DOM, as determining descendancy is suprisingly tricky. We may want to change this in the future.
2352
            if (childParentElement && childParentElement != node && !isInShadowTree(*node) && !isInShadowTree(*child->node()))
2349
                continue;
2353
                continue;
2350
        }
2354
        }
2351
2355
- a/LayoutTests/accessibility/display-flex-shadow-dom-accname-expected.txt +14 lines
Line 0 a/LayoutTests/accessibility/display-flex-shadow-dom-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for shadow DOM elements with display:flex.
2
3
	AXTitle: block test
4
	AXDescription:
5
	AXHelp:
6
7
	AXTitle: flex test
8
	AXDescription:
9
	AXHelp:
10
11
PASS successfullyParsed is true
12
13
TEST COMPLETE
14
- a/LayoutTests/accessibility/display-flex-shadow-dom-accname.html +46 lines
Line 0 a/LayoutTests/accessibility/display-flex-shadow-dom-accname.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../resources/accessibility-helper.js"></script>
5
<script src="../resources/js-test.js"></script>
6
</head>
7
<body>
8
<my-simple></my-simple>
9
10
<script>
11
class MySimple extends HTMLElement {
12
    constructor() {
13
        super();
14
        const root = this.attachShadow({ mode: "open" });
15
        root.innerHTML = `
16
            <my-buttons>
17
                <span slot="flex">flex test</span>
18
                <span slot="block">block test</span>
19
            </my-buttons>
20
        `;
21
    }
22
}
23
customElements.define("my-simple", MySimple);
24
25
class MyButtons extends HTMLElement {
26
    constructor() {
27
        super();
28
        const root = this.attachShadow({ mode: "open" });
29
        root.innerHTML = `
30
            <button id="flex-button" style="display: flex;"><slot name="flex"></slot></button>
31
            <button id="block-button" style="display: block;"><slot name="block"></slot></button>
32
        `;
33
    }
34
}
35
customElements.define("my-buttons", MyButtons);
36
37
let output = "This test ensures that we compute the correct accessible name for shadow DOM elements with display:flex.\n\n";
38
if (window.accessibilityController) {
39
    output += `${platformTextAlternatives(accessibilityController.accessibleElementById("block-button"))}\n\n`;
40
    output += `${platformTextAlternatives(accessibilityController.accessibleElementById("flex-button"))}\n`;
41
    debug(output);
42
}
43
</script>
44
</body>
45
</html>
46
- a/LayoutTests/accessibility/nested-custom-element-accname-expected.txt +11 lines
Line 0 a/LayoutTests/accessibility/nested-custom-element-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for nested custom elements.
2
3
	AXTitle: test
4
	AXDescription:
5
	AXHelp:
6
7
8
PASS successfullyParsed is true
9
10
TEST COMPLETE
11
- a/LayoutTests/accessibility/nested-custom-element-accname.html +37 lines
Line 0 a/LayoutTests/accessibility/nested-custom-element-accname.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../resources/accessibility-helper.js"></script>
5
<script src="../resources/js-test.js"></script>
6
</head>
7
<body>
8
<my-simple></my-simple>
9
10
<script>
11
class MySimple extends HTMLElement {
12
    constructor() {
13
        super();
14
        const root = this.attachShadow({ mode: "open" });
15
        root.innerHTML = `<button id="button"><my-span>test</my-span></button>`;
16
    }
17
}
18
customElements.define("my-simple", MySimple);
19
20
class MySpan extends HTMLElement {
21
    constructor() {
22
        super();
23
        const root = this.attachShadow({ mode: "open" });
24
        root.innerHTML = `<span><slot></slot></span>`;
25
    }
26
}
27
customElements.define("my-span", MySpan);
28
29
let output = "This test ensures that we compute the correct accessible name for nested custom elements.\n\n";
30
if (window.accessibilityController) {
31
    output += `${platformTextAlternatives(accessibilityController.accessibleElementById("button"))}\n\n`;
32
    debug(output);
33
}
34
</script>
35
</body>
36
</html>
37
- a/LayoutTests/accessibility/slot-default-contents-accname-expected.txt +14 lines
Line 0 a/LayoutTests/accessibility/slot-default-contents-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name when the default contents of a slot are used.
2
3
	AXTitle: slotted label
4
	AXDescription:
5
	AXHelp:
6
7
	AXTitle: default label
8
	AXDescription:
9
	AXHelp:
10
11
PASS successfullyParsed is true
12
13
TEST COMPLETE
14
slotted label
- a/LayoutTests/accessibility/slot-default-contents-accname.html +30 lines
Line 0 a/LayoutTests/accessibility/slot-default-contents-accname.html_sec1
1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2
<html>
3
<head>
4
<script src="../resources/accessibility-helper.js"></script>
5
<script src="../resources/js-test.js"></script>
6
</head>
7
<body>
8
<button id="explicit-contents-button"><child-slot>slotted label</child-slot></button>
9
<button id="default-contents-button"><child-slot></child-slot></button>
10
11
<script>
12
class ChildSlot extends HTMLElement {
13
    constructor() {
14
        super();
15
        const root = this.attachShadow({ mode: "open" });
16
        root.innerHTML = `<div><slot>default label</slot></div>`;
17
    }
18
}
19
customElements.define("child-slot", ChildSlot);
20
21
let output = "This test ensures that we compute the correct accessible name when the default contents of a slot are used.\n\n";
22
if (window.accessibilityController) {
23
    output += `${platformTextAlternatives(accessibilityController.accessibleElementById("explicit-contents-button"))}\n\n`;
24
    output += `${platformTextAlternatives(accessibilityController.accessibleElementById("default-contents-button"))}\n`;
25
    debug(output);
26
}
27
</script>
28
</body>
29
</html>
30
- a/LayoutTests/platform/glib/accessibility/display-flex-shadow-dom-accname-expected.txt +12 lines
Line 0 a/LayoutTests/platform/glib/accessibility/display-flex-shadow-dom-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for shadow DOM elements with display:flex.
2
3
	AXTitle: block test
4
	AXDescription:
5
6
	AXTitle: flex test
7
	AXDescription:
8
9
PASS successfullyParsed is true
10
11
TEST COMPLETE
12
- a/LayoutTests/platform/glib/accessibility/nested-custom-element-accname-expected.txt +10 lines
Line 0 a/LayoutTests/platform/glib/accessibility/nested-custom-element-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for nested custom elements.
2
3
	AXTitle: test
4
	AXDescription:
5
6
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- a/LayoutTests/platform/glib/accessibility/slot-default-contents-accname-expected.txt +12 lines
Line 0 a/LayoutTests/platform/glib/accessibility/slot-default-contents-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name when the default contents of a slot are used.
2
3
	AXTitle: slotted label
4
	AXDescription:
5
6
	AXTitle: default label
7
	AXDescription:
8
9
PASS successfullyParsed is true
10
11
TEST COMPLETE
12
slotted label
- a/LayoutTests/platform/ios/TestExpectations +3 lines
Lines 2195-2200 accessibility/display-contents/dynamically-added-children.html [ Pass ] a/LayoutTests/platform/ios/TestExpectations_sec1
2195
accessibility/display-contents/element-roles.html [ Pass ]
2195
accessibility/display-contents/element-roles.html [ Pass ]
2196
accessibility/display-contents/object-ordering.html [ Pass ]
2196
accessibility/display-contents/object-ordering.html [ Pass ]
2197
accessibility/display-contents/table.html [ Pass ]
2197
accessibility/display-contents/table.html [ Pass ]
2198
accessibility/display-flex-shadow-dom-accname.html [ Pass ]
2198
accessibility/dynamically-ignored-canvas.html [ Pass ]
2199
accessibility/dynamically-ignored-canvas.html [ Pass ]
2199
accessibility/editable-webpage-focused-ui-element.html [ Pass ]
2200
accessibility/editable-webpage-focused-ui-element.html [ Pass ]
2200
accessibility/element-haspopup.html [ Pass ]
2201
accessibility/element-haspopup.html [ Pass ]
Lines 2209-2214 accessibility/list-with-dynamically-changing-content.html [ Pass ] a/LayoutTests/platform/ios/TestExpectations_sec2
2209
accessibility/live-region-attributes-update-after-dynamic-change.html [ Pass ]
2210
accessibility/live-region-attributes-update-after-dynamic-change.html [ Pass ]
2210
accessibility/menu-list-crash2.html [ Pass ]
2211
accessibility/menu-list-crash2.html [ Pass ]
2211
accessibility/multiple-attribute-change-crash.html [ Pass ]
2212
accessibility/multiple-attribute-change-crash.html [ Pass ]
2213
accessibility/nested-custom-element-accname.html [ Pass ]
2212
accessibility/node-only-inert-object.html [ Pass ]
2214
accessibility/node-only-inert-object.html [ Pass ]
2213
accessibility/node-only-object-element-rect.html [ Pass ]
2215
accessibility/node-only-object-element-rect.html [ Pass ]
2214
accessibility/checkbox-radio-element-rect.html [ Pass ]
2216
accessibility/checkbox-radio-element-rect.html [ Pass ]
Lines 2221-2226 accessibility/page-reload-deadlock.html [ Pass ] a/LayoutTests/platform/ios/TestExpectations_sec3
2221
accessibility/placeholder.html [ Pass ]
2223
accessibility/placeholder.html [ Pass ]
2222
accessibility/progress-indeterminate-value.html [ Pass ]
2224
accessibility/progress-indeterminate-value.html [ Pass ]
2223
accessibility/slider-with-lost-renderer.html [ Pass ]
2225
accessibility/slider-with-lost-renderer.html [ Pass ]
2226
accessibility/slot-default-contents-accname.html [ Pass ]
2224
accessibility/spinbutton-increment-decrement.html [ Pass ]
2227
accessibility/spinbutton-increment-decrement.html [ Pass ]
2225
accessibility/display-contents/text-under-element.html [ Pass ]
2228
accessibility/display-contents/text-under-element.html [ Pass ]
2226
accessibility/text-aria-role-disabled.html [ Pass ]
2229
accessibility/text-aria-role-disabled.html [ Pass ]
- a/LayoutTests/platform/ios/accessibility/display-flex-shadow-dom-accname-expected.txt +10 lines
Line 0 a/LayoutTests/platform/ios/accessibility/display-flex-shadow-dom-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for shadow DOM elements with display:flex.
2
3
	AXLabel: block test
4
5
	AXLabel: flex test
6
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
- a/LayoutTests/platform/ios/accessibility/nested-custom-element-accname-expected.txt +9 lines
Line 0 a/LayoutTests/platform/ios/accessibility/nested-custom-element-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name for nested custom elements.
2
3
	AXLabel: test
4
5
6
PASS successfullyParsed is true
7
8
TEST COMPLETE
9
- a/LayoutTests/platform/ios/accessibility/slot-default-contents-accname-expected.txt +10 lines
Line 0 a/LayoutTests/platform/ios/accessibility/slot-default-contents-accname-expected.txt_sec1
1
This test ensures that we compute the correct accessible name when the default contents of a slot are used.
2
3
	AXLabel: slotted label
4
5
	AXLabel: default label
6
7
PASS successfullyParsed is true
8
9
TEST COMPLETE
10
slotted label

Return to Bug 266916