Bug 394501 - rendering of prompts with access keys broken in JAWAS virtual buffer as of August 29, patch=aaronlev, r=me, a=dsicore

This commit is contained in:
surkov.alexander@gmail.com 2007-09-18 20:36:20 -07:00
Родитель 1d66df8e6a
Коммит c4db1c1fba
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -405,9 +405,12 @@ nsAccessible::GetKeyboardShortcut(nsAString& aAccessKey)
return NS_ERROR_FAILURE;
PRUint32 key = nsAccUtils::GetAccessKeyFor(content);
if (!key) {
if (!key && content->IsNodeOfType(nsIContent::eELEMENT)) {
// Copy access key from label node unless it is labeled
// via an ancestor <label>, in which case that would be redundant
nsCOMPtr<nsIContent> labelContent(GetLabelContent(content));
if (labelContent)
nsCOMPtr<nsIDOMNode> labelNode = do_QueryInterface(labelContent);
if (labelNode && !nsAccUtils::IsAncestorOf(labelNode, mDOMNode))
key = nsAccUtils::GetAccessKeyFor(labelContent);
}