From d264b4bcae29d79950034987a60f63e95bc55e7d Mon Sep 17 00:00:00 2001 From: "dougt%meer.net" Date: Wed, 1 Jun 2005 15:59:59 +0000 Subject: [PATCH] Focus frame traversal has been broken since a frame reorder (scrollbars are now first followed by the canvas frame). patch by roc, r=bzbarsky, a=shaver git-svn-id: svn://10.0.0.236/trunk@173926 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsFrameTraversal.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mozilla/layout/base/nsFrameTraversal.cpp b/mozilla/layout/base/nsFrameTraversal.cpp index 0456076b078..d480c47339d 100644 --- a/mozilla/layout/base/nsFrameTraversal.cpp +++ b/mozilla/layout/base/nsFrameTraversal.cpp @@ -359,7 +359,7 @@ nsLeafIterator::Next() result = parent; } else { - while(parent && !IsRootFrame(parent)) { + while(parent) { result = parent->GetNextSibling(); if (result) { parent = result; @@ -585,18 +585,21 @@ nsFocusIterator::Next() result = parent; if (result == getCurrent()) { - while (result && !IsRootFrame(result)) { + while (result) { if ((parent = GetNextSibling(result))) { result = parent; break; } else { parent = result; result = GetParentFrame(parent); + if (IsRootFrame(result)) { + result = 0; + break; + } } } - if (!result || IsRootFrame(result)) { - result = 0; + if (!result) { setLast(parent); } } @@ -684,7 +687,7 @@ NS_IMETHODIMP result = parent; } else { - while(parent && !IsRootFrame(parent)) { + while(parent) { nsIFrame *grandParent = parent->GetParent(); if (grandParent) { nsFrameList list(grandParent->GetFirstChild(nsnull));