blob: d517afe6127fcf942efce0686cb98b3680da3b3c [file] [log] [blame]
<!DOCTYPE html>
<title>Image link in the presence of inline continuations</title>
if (window.testRunner)
<h2>Image link in the presence of inline continuations</h2>
<p>This test checks that a block inside a link does not unduly disturb
the render tree via inline continuations. In particular, it checks
that adding &lt;div role=presentation> between a link and its
contained image does not alter the accessibility tree at all, other
than with respect to size.</p>
<div id="plain">
<a href=""><img alt="Delicious cake" src="resources/cake.png"></a>
<div id="with-div">
<a href=""><div role="presentation"><img alt="Delicious cake" src="resources/cake.png"></div></a>
<pre id="result"></div>
function axTree(elt)
var result = elt.allAttributes() + "\n\n";
var count = elt.childrenCount;
for (var i = 0; i < count; ++i) {
result += "Child " + i + ":\n" + axTree(elt.childAtIndex(i));
return result;
if (window.accessibilityController) {
var result = document.getElementById("result");
var plainResult = axTree(accessibilityController.focusedElement);
plainResult.replace(/AXSize.*\n/g, "");
var withDivResult = axTree(accessibilityController.focusedElement);
withDivResult.replace(/AXSize.*\n/g, "");
if (plainResult == withDivResult) {
result.innerHTML = "PASS: accessibility trees were identical other than size."
} else {
result.innerHTML = "FAIL: accessibility trees differ.\nPlain image link: \n" + plainResult + "\nWith presentation div:\n" + withDivResult;