mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
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:
parent
d9a06e8869
commit
9138981c0f
@ -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));
|
||||
nsCOMPtr<nsIAtom> tag = aContent->Tag();
|
||||
|
||||
if (!selectControlEl && aContent->Tag() != nsAccessibilityAtoms::textarea) {
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user