Bug 397219. Tab not moving focus relative to caret when caret inside label. r=mats, sr=neil, a=roc

This commit is contained in:
aaronleventhal%moonset.net 2007-11-09 19:06:51 +00:00
Родитель 2bfede55a5
Коммит f110633aab
1 изменённых файлов: 1 добавлений и 11 удалений

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

@ -4982,17 +4982,7 @@ nsEventStateManager::GetDocSelectionLocation(nsIContent **aStartContent,
if (startContent) {
startFrame = shell->GetPrimaryFrameFor(startContent);
if (isCollapsed) {
// First check to see if we're in a <label>
// We don't want to return the selection in a label, because
// we we should be tabbing relative to what the label
// points to (the current focus), not relative to the label itself.
nsIContent *parentContent = startContent;
while ((parentContent = parentContent->GetParent()) != nsnull) {
if (parentContent->Tag() == nsGkAtoms::label) {
return NS_OK; // Don't return selection location, we're on a label
}
}
// Next check to see if our caret is at the very end of a node
// Check to see if our caret is at the very end of a node
// If so, the caret is actually sitting in front of the next
// logical frame's primary node - so for this case we need to
// change caretContent to that node.