2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
6 .hideAllContainers .container {
11 <div class=
"container">
12 <details id=
"details1">
13 <p>details1-content
</p>
19 var axDetails1
= accessibilityController
.accessibleElementById("details1");
20 var axSummary1
= axDetails1
.childAtIndex(0);
21 assert_equals(axSummary1
.role
, "AXRole: AXDisclosureTriangle");
22 assert_equals(axSummary1
.name
, "Details");
23 assert_equals(axSummary1
.nameFrom
, "contents");
24 }, "Details element with no summary");
27 <div class=
"container">
28 <details id=
"details2">
29 <summary id=
"summary2" title=
"summary2-title"></summary>
30 <p>details2-content
</p>
36 var axSummary2
= accessibilityController
.accessibleElementById("summary2");
37 assert_equals(axSummary2
.name
, "summary2-title");
38 assert_equals(axSummary2
.nameFrom
, "attribute");
39 }, "Summary with title and no contents");
42 <div class=
"container">
43 <details id=
"details3">
44 <summary id=
"summary3" title=
"summary3-title">summary3-contents
</summary>
45 <p>details3-content
</p>
51 var axSummary3
= accessibilityController
.accessibleElementById("summary3");
52 assert_equals(axSummary3
.name
, "summary3-contents");
53 assert_equals(axSummary3
.nameFrom
, "contents");
54 }, "Summary with title and no contents");
57 <div class=
"container">
58 <details id=
"details4">
59 <summary id=
"summary4" title=
"summary4-title" aria-label=
"summary4-aria-label">summary4-contents
</summary>
60 <p>details4-content
</p>
66 var axSummary4
= accessibilityController
.accessibleElementById("summary4");
67 assert_equals(axSummary4
.name
, "summary4-aria-label");
68 assert_equals(axSummary4
.nameFrom
, "attribute");
69 }, "Summary with title and no contents");
72 <div class=
"container">
73 <details id=
"details5">
74 <summary id=
"summary5" title=
"summary5-title" aria-label=
"summary5-aria-label" aria-labelledby=
"labelledby5">summary5-contents
</summary>
75 <p>details5-content
</p>
77 <span hidden=
"true" id=
"labelledby5">summary5-aria-labelledby
</span>
82 var axSummary5
= accessibilityController
.accessibleElementById("summary5");
83 assert_equals(axSummary5
.name
, "summary5-aria-labelledby");
84 assert_equals(axSummary5
.nameFrom
, "relatedElement");
85 }, "Summary with title and no contents");
89 if (window
.testRunner
)
90 document
.body
.className
= "hideAllContainers";