mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1250878 - add acceptable child check for HTML select, r=marcoz
This commit is contained in:
parent
0654192ddc
commit
286451f90a
@ -114,35 +114,12 @@ HTMLSelectListAccessible::SetCurrentItem(Accessible* aItem)
|
||||
true);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// HTMLSelectListAccessible: Accessible protected
|
||||
|
||||
void
|
||||
HTMLSelectListAccessible::CacheChildren()
|
||||
bool
|
||||
HTMLSelectListAccessible::IsAcceptableChild(nsIContent* aEl) const
|
||||
{
|
||||
// Cache accessibles for <optgroup> and <option> DOM decendents as children,
|
||||
// as well as the accessibles for them. Avoid whitespace text nodes. We want
|
||||
// to count all the <optgroup>s and <option>s as children because we want
|
||||
// a flat tree under the Select List.
|
||||
for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
|
||||
childContent = childContent->GetNextSibling()) {
|
||||
if (!childContent->IsHTMLElement()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (childContent->IsAnyOfHTMLElements(nsGkAtoms::option,
|
||||
nsGkAtoms::optgroup)) {
|
||||
|
||||
// Get an accessible for option or optgroup and cache it.
|
||||
RefPtr<Accessible> accessible =
|
||||
GetAccService()->GetOrCreateAccessible(childContent, this);
|
||||
if (accessible)
|
||||
AppendChild(accessible);
|
||||
}
|
||||
}
|
||||
return aEl->IsAnyOfHTMLElements(nsGkAtoms::option, nsGkAtoms::optgroup);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// HTMLSelectOptionAccessible
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -51,10 +51,7 @@ public:
|
||||
virtual Accessible* CurrentItem() override;
|
||||
virtual void SetCurrentItem(Accessible* aItem) override;
|
||||
|
||||
protected:
|
||||
|
||||
// Accessible
|
||||
virtual void CacheChildren() override;
|
||||
virtual bool IsAcceptableChild(nsIContent* aEl) const override;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user