Bug 455482 - In a select nested within a label, the accname contains each option's text, should only contain label's text, patch=Eitan, r=me, marcoz

This commit is contained in:
Alexander Surkov 2008-10-29 16:53:43 +08:00
Родитель c50ba753cd
Коммит 6765f8fcc6
2 изменённых файлов: 24 добавлений и 2 удалений

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

@ -1624,11 +1624,16 @@ nsAccessible::AppendFlatStringFromSubtreeRecurse(nsIContent *aContent,
// Append all the text into one flat string
PRUint32 numChildren = 0;
nsCOMPtr<nsIDOMXULSelectControlElement> selectControlEl(do_QueryInterface(aContent));
if (!selectControlEl && aContent->Tag() != nsAccessibilityAtoms::textarea) {
nsCOMPtr<nsIAtom> tag = aContent->Tag();
if (!selectControlEl &&
tag != nsAccessibilityAtoms::textarea &&
tag != nsAccessibilityAtoms::select) {
// Don't walk children of elements with options, just get label directly.
// Don't traverse the children of a textarea, we want the value, not the
// static text node.
// Don't traverse the children of a select element, we only want the
// current value.
numChildren = aContent->GetChildCount();
}

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

@ -128,6 +128,11 @@
testName("textareawithchild", "Story: Bar");
/////////////////////////////////////////////////////////////////////////
// label with nested combobox
testName("comboinmiddle", "Subscribe to ATOM feed.");
SimpleTest.finish();
}
@ -281,5 +286,17 @@
</label>
</form>
<!-- A label with a nested control in the middle -->
<form>
<label id="comboinmiddle">
Subscribe to
<select id="combo3" name="occupation">
<option>ATOM</option>
<option>RSS</option>
</select>
feed.
</label>
</form>
</body>
</html>