зеркало из https://github.com/mozilla/pjs.git
Bug 397219. Tab not moving focus relative to caret when caret inside label. r=mats, sr=neil, a=roc
This commit is contained in:
Родитель
2bfede55a5
Коммит
f110633aab
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче