mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 544600 - Accessibility should check for the bogus br node used by the editor directly; r=davidb
This commit is contained in:
parent
00e5ae8a6f
commit
96a1565ef9
@ -262,6 +262,8 @@ ACCESSIBILITY_ATOM(aria_valuetext, "aria-valuetext")
|
||||
// a form property used to obtain the default label
|
||||
// of an HTML button from the button frame
|
||||
ACCESSIBILITY_ATOM(defaultLabel, "defaultLabel")
|
||||
// the attribute specifying the editor's bogus br node
|
||||
ACCESSIBILITY_ATOM(mozeditorbogusnode, "_moz_editor_bogus_node")
|
||||
|
||||
// Object attributes
|
||||
ACCESSIBILITY_ATOM(tableCellIndex, "table-cell-index")
|
||||
|
@ -586,16 +586,14 @@ nsresult nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode* aNode, PRI
|
||||
if (findNode) {
|
||||
nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
|
||||
if (findContent->IsHTML() &&
|
||||
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
|
||||
nsIContent *parent = findContent->GetParent();
|
||||
if (parent &&
|
||||
parent->IsRootOfNativeAnonymousSubtree() &&
|
||||
parent->GetChildCount() == 1) {
|
||||
// This <br> is the only node in a text control, therefore it is the hacky
|
||||
// "bogus node" used when there is no text in a control
|
||||
*aHyperTextOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br) &&
|
||||
findContent->AttrValueIs(kNameSpaceID_None,
|
||||
nsAccessibilityAtoms::mozeditorbogusnode,
|
||||
nsAccessibilityAtoms::_true,
|
||||
eIgnoreCase)) {
|
||||
// This <br> is the hacky "bogus node" used when there is no text in a control
|
||||
*aHyperTextOffset = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
descendantAccessible = GetFirstAvailableAccessible(findNode);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user