blob: f907c0de3a7e9967462472df2fd42eaae9996fcb [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="content">
<p id="p1">Test figure with aria-label.</p>
<figure id="figure1" aria-label="aria-label attribute">
<img src="" alt="image alt" width="20" height="20"/>
</figure>
<p id="p2">Test figure with title attribute.</p>
<figure id="figure2" title="title attribute">
<img src="" alt="image alt" width="20" height="20"/>
</figure>
<p id="p3">Test figure with aria-describedby.</p>
<figure id="figure3" aria-describedby="fg-describedby">
<img src="" alt="image alt" width="20" height="20"/>
<p id="fg-describedby">p referenced by aria-describedby</p>
</figure>
<p id="p4">Test figure with figcaption element.</p>
<figure id="figure4">
<img src="" alt="image alt" width="20" height="20"/>
<figcaption id="figCaption4">Figcaption element</figcaption>
</figure>
<p id="p5">Test figure with figcaption element and title attribute.</p>
<figure id="figure5" title="title attribute">
<img src="" alt="image alt" width="20" height="20"/>
<figcaption id="figCaption5">Figcaption element</figcaption>
</figure>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that the 'figure' element is accessible on the Mac.");
if (window.accessibilityController) {
for (var k = 1; k <= 5; k++) {
var figure = accessibilityController.accessibleElementById("figure" + k);
var p = document.getElementById("p" + k);
debug(p.innerText);
debug("figure" + k + " role: " + figure.role);
debug("figure" + k + " roleDescription: " + figure.roleDescription);
debug("figure" + k + " description: " + figure.description);
debug("figure" + k + " helpText: " + figure.helpText);
var titleUIElement = figure.titleUIElement();
if (k >= 4) {
var figureCaption = accessibilityController.accessibleElementById("figCaption" + k);
shouldBeTrue("titleUIElement.isEqual(figureCaption)");
} else
shouldBeTrue("!titleUIElement");
debug("");
}
document.getElementById("content").innerText = "";
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>