Bug 1369185 - Don't allow <select> to aria-own, or <option> to be owned. r=surkov

This commit is contained in:
Eitan Isaacson
2017-09-13 14:04:00 -04:00
parent f8f1f45851
commit 9f4e450fd5
5 changed files with 88 additions and 20 deletions

View File

@@ -310,6 +310,13 @@ HTMLSelectOptGroupAccessible::NativeInteractiveState() const
return NativelyUnavailable() ? states::UNAVAILABLE : 0;
}
bool
HTMLSelectOptGroupAccessible::IsAcceptableChild(nsIContent* aEl) const
{
return aEl->IsNodeOfType(nsINode::eDATA_NODE) ||
aEl->IsHTMLElement(nsGkAtoms::option);
}
uint8_t
HTMLSelectOptGroupAccessible::ActionCount()
{
@@ -458,6 +465,12 @@ HTMLComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName)
aName.AssignLiteral("open");
}
bool
HTMLComboboxAccessible::IsAcceptableChild(nsIContent* aEl) const
{
return false;
}
////////////////////////////////////////////////////////////////////////////////
// HTMLComboboxAccessible: Widgets
@@ -593,6 +606,12 @@ HTMLComboboxListAccessible::RelativeBounds(nsIFrame** aBoundingFrame) const
return (*aBoundingFrame)->GetRect();
}
bool
HTMLComboboxListAccessible::IsAcceptableChild(nsIContent* aEl) const
{
return aEl->IsAnyOfHTMLElements(nsGkAtoms::option, nsGkAtoms::optgroup);
}
////////////////////////////////////////////////////////////////////////////////
// HTMLComboboxListAccessible: Widgets
@@ -607,4 +626,3 @@ HTMLComboboxListAccessible::AreItemsOperable() const
{
return mParent && mParent->AreItemsOperable();
}