Bug 631160 - embedded accessible may expose wrong text, r=marcoz, davidb, a=betaN

This commit is contained in:
Alexander Surkov 2011-02-03 22:29:05 +08:00
Родитель 43d35a3dbb
Коммит 1621463125
2 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -2656,9 +2656,10 @@ nsAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
if (frame->GetType() == nsAccessibilityAtoms::brFrame) {
aText += kForcedNewLineChar;
} else if (nsAccUtils::MustPrune(this)) {
// Expose imaginary embedded object character if the accessible hans't
// children.
} else if (nsAccUtils::MustPrune(GetParent())) {
// Expose the embedded object accessible as imaginary embedded object
// character if its parent hypertext accessible doesn't expose children to
// AT.
aText += kImaginaryEmbeddedObjectChar;
} else {
aText += kEmbeddedObjectChar;

Просмотреть файл

@ -22,11 +22,10 @@
//////////////////////////////////////////////////////////////////////////
// ! - embedded object char
// @ - imaginary object char, space is used
// __h__e__l__l__o__ __!__ __s__e__e__ __@__
// __h__e__l__l__o__ __!__ __s__e__e__ __!__
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
var IDs = [ "hypertext" ];
var IDs = [ "hypertext", "hypertext2" ];
////////////////////////////////////////////////////////////////////////
// characterCount
@ -38,8 +37,8 @@
testText(IDs, 0, 1, "h");
testText(IDs, 5, 7, " " + kEmbedChar);
testText(IDs, 10, 13, "e ");
testText(IDs, 0, 13, "hello " + kEmbedChar + " see ");
testText(IDs, 10, 13, "e " + kEmbedChar);
testText(IDs, 0, 13, "hello " + kEmbedChar + " see " + kEmbedChar);
//////////////////////////////////////////////////////////////////////////
// list
@ -71,6 +70,7 @@
</pre>
<div id="hypertext">hello <a>friend</a> see <img></div>
<div id="hypertext2">hello <a>friend</a> see <input></div>
<ol id="list"><li id="listitem">foo</li></ol>
</body>