bug 430758 - GetAccessible() could be fooled by additional table ancestor
patch by evan.yan@sun.com (Evan Yan) r=surkov a1.9=beltzner git-svn-id: svn://10.0.0.236/trunk@251161 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f4094189c6
commit
80b5750b44
@ -1526,7 +1526,7 @@ NS_IMETHODIMP nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (tableFrame->GetType() == nsAccessibilityAtoms::tableCellFrame) {
|
||||
else if (tableContent->Tag() == nsAccessibilityAtoms::table) {
|
||||
// Stop before we are fooled by any additional table ancestors
|
||||
// This table cell frameis part of a separate ancestor table.
|
||||
tryTagNameOrFrame = PR_FALSE;
|
||||
|
||||
@ -100,6 +100,26 @@ function doTest()
|
||||
is(accTable4.cellRefAt(1,1).firstChild.name, "cell3", "wrong cell");
|
||||
}
|
||||
|
||||
// Test table with display:inline and an outside table. We shouldn't be fooled
|
||||
// by the outside table and shouldn't create table accessible and table cell
|
||||
// accessible in this case
|
||||
var table5 = document.getElementById("table5");
|
||||
accNotCreated = false;
|
||||
try {
|
||||
var accTable1 = accService.getAccessibleFor(table1);
|
||||
} catch (e) {
|
||||
accNotCreated = true;
|
||||
}
|
||||
ok(accNotCreated, "wrongly created table accessible");
|
||||
var t5Cell = document.getElementById("t5_cell");
|
||||
accNotCreated = false;
|
||||
try {
|
||||
var accCell = accService.getAccessibleFor(t5Cell);
|
||||
} catch (e) {
|
||||
accNotCreated = true;
|
||||
}
|
||||
ok(accNotCreated, "wrongly created table cell accessible");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
@ -150,6 +170,18 @@ addLoadEvent(doTest);
|
||||
<td>cell3</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td style="display:block">
|
||||
<table style="display:inline" id="table5">
|
||||
<tr><td id="t5_cell">cell0</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>cell1</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user