Bug 104977 -- landing tabbing rewrite. Fixes bugs 78256, 83575, 85602, 96273, 103980, and 105224. r=saari, sr=hyatt.

This commit is contained in:
bryner%netscape.com 2001-10-22 22:43:52 +00:00
parent 4b1bd0e336
commit 03cd3c194e
28 changed files with 709 additions and 1556 deletions

View File

@ -49,7 +49,6 @@ class nsIDOMEvent;
class nsIFrame;
class nsIView;
class nsIWidget;
class nsIDocument;
/*
* Event listener manager interface.
@ -91,19 +90,10 @@ public:
NS_IMETHOD GetFocusedContent(nsIContent **aContent) = 0;
NS_IMETHOD SetFocusedContent(nsIContent* aContent) = 0;
virtual PRBool ChangeFocus(nsIContent* aFocus, nsIFrame* aFocusFrame, PRBool aSetFocus) = 0;
NS_IMETHOD GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* aFrame,
PRBool forward, nsIContent** aResult) = 0;
NS_IMETHOD GetNextTabbableIndexContent(nsIContent* aRootContent,
PRBool forward,
PRBool aStartOver,
nsIContent** aResult) = 0;
NS_IMETHOD HasPositiveTabIndex(nsIContent* aContent,
PRBool* aResult) = 0;
// This is an experiement and may be temporary
// This is an experiment and may be temporary
NS_IMETHOD ConsumeFocusEvents(PRBool aDoConsume) = 0;
// Access Key Registration
@ -116,11 +106,7 @@ public:
NS_IMETHOD DispatchNewEvent(nsISupports* aTarget, nsIDOMEvent* aEvent, PRBool* aPreventDefault) = 0;
// Method for moving the focus forward/back.
NS_IMETHOD MoveFocus(PRBool aDirection, nsIContent* aRoot)=0;
//-- Special Enums needed for DocShell Identification
enum eDocType {eChrome = 0, eGenericContent, eFrameSet, eFrame, eIFrame};
NS_IMETHOD FigureOutKindOfDoc(nsIDocument* aDoc, eDocType* aDocType) = 0;
NS_IMETHOD ShiftFocus(PRBool aDirection, nsIContent* aStart)=0;
};

File diff suppressed because it is too large Load Diff

View File

@ -54,6 +54,8 @@ class nsIPresShell;
class nsITreeFrame;
class nsIFrameSelection;
class nsIDocShell;
class nsIDocShellTreeNode;
class nsIDocShellTreeItem;
// mac uses click-hold context menus, a holdover from 4.x
#ifdef XP_MAC
@ -128,9 +130,7 @@ public:
//Method for centralized distribution of new DOM events
NS_IMETHOD DispatchNewEvent(nsISupports* aTarget, nsIDOMEvent* aEvent, PRBool *aPreventDefault);
NS_IMETHOD MoveFocus(PRBool aDirection, nsIContent* aRoot);
NS_IMETHOD FigureOutKindOfDoc(nsIDocument* aDoc, eDocType* aDocType);
NS_IMETHOD ShiftFocus(PRBool forward, nsIContent* aStart=nsnull);
protected:
void UpdateCursor(nsIPresContext* aPresContext, nsEvent* aEvent, nsIFrame* aTargetFrame, nsEventStatus* aStatus);
@ -138,15 +138,8 @@ protected:
void GenerateDragDropEnterExit(nsIPresContext* aPresContext, nsGUIEvent* aEvent);
NS_IMETHOD SetClickCount(nsIPresContext* aPresContext, nsMouseEvent *aEvent, nsEventStatus* aStatus);
NS_IMETHOD CheckForAndDispatchClick(nsIPresContext* aPresContext, nsMouseEvent *aEvent, nsEventStatus* aStatus);
PRBool ChangeFocus(nsIContent* aFocus, nsIFrame* aFocusFrame, PRBool aSetFocus);
void ShiftFocus(PRBool forward, nsIContent* aRoot=nsnull);
PRBool ChangeFocus(nsIContent* aFocus);
NS_IMETHOD GetNextTabbableContent(nsIContent* aRootContent, nsIFrame* aFrame, PRBool forward, nsIContent** aResult);
NS_IMETHOD GetNextTabbableIndexContent(nsIContent* aRootContent,
PRBool forward,
PRBool aStartOver,
nsIContent** aResult);
NS_IMETHOD HasPositiveTabIndex(nsIContent* aContent,
PRBool* aResult);
PRInt32 GetNextTabIndex(nsIContent* aParent, PRBool foward);
NS_IMETHOD SendFocusBlur(nsIPresContext* aPresContext, nsIContent *aContent);
@ -159,21 +152,17 @@ protected:
// DocShell Focus Traversal Methods
//---------------------------------------------
void ShiftFocusByDoc(PRBool forward, nsIContent* aRoot=nsnull);
PRBool FocusAfterHTMLFrameDoc(nsIDocShell* aDocShell, nsIDocShell* aParentDocShell, PRBool aForward);
PRBool FocusAfterHTMLIFrameDoc(nsIDocShell* aDocShell, nsIDocShell* aParentDocShell, PRBool aForward, PRBool& aFocusDoc);
PRBool FocusWithinHTMLFrameDoc(nsIContent* aRootContent, nsIPresShell* aPresShell, PRBool aForward, PRBool& aDoFocusAvailDocShells);
PRBool FocusWithinHTMLIFrameDoc(nsIContent* aNextContent, PRBool aForward);
nsIContent* GetLastContent(nsIDocShell* aDocShell);
nsIContent* GetLastContent(nsIContent* aRootContent);
nsIDocShell* GetDocShellFromContent(nsIDocShell* aParentDocShell, nsIContent* aContent);
nsIDocShell* GetNextDocShell(nsIDocShell* aParentDS, nsIDocShell* aCurrentDS, PRBool aForward);
void ForceUpdate(nsIDocShell* aDocShell);
nsresult GetDocShellsFromDoc(nsIDocument* aDocument, nsIDocShell** aDocShell, nsIDocShell** aParentDS);
PRBool IsLastFrameInFrameSet(nsIContent* aLastFrameContent);
nsIContent* FindContentForDocShell(nsIPresShell* aPresShell, nsIContent* aContent, nsIDocShell* aDocShell);
PRBool IsFrameSetDoc(nsIContent* aContent);
void TabIntoDocument(nsIDocShell* aDocShell, PRBool aForward);
void ShiftFocusByDoc(PRBool forward);
PRBool IsFrameSetDoc(nsIDocShell* aDocShell);
PRBool IsIFrameDoc(nsIDocShell* aDocShell);
PRBool IsShellVisible(nsIDocShell* aShell);
void GetLastChildDocShell(nsIDocShellTreeItem* aItem,
nsIDocShellTreeItem** aResult);
void GetNextDocShell(nsIDocShellTreeNode* aNode,
nsIDocShellTreeItem** aResult);
void GetPrevDocShell(nsIDocShellTreeNode* aNode,
nsIDocShellTreeItem** aResult);
// These functions are for mousewheel scrolling
nsIScrollableView* GetNearestScrollingView(nsIView* aView);
@ -255,7 +244,7 @@ protected:
static PRUint32 mInstanceCount;
// For mousewheel preferences handling
// For preferences handling
nsCOMPtr<nsIPref> mPrefService;
PRBool m_haveShutdown;

View File

@ -123,7 +123,7 @@ static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_CID(kDOMScriptObjectFactoryCID,
NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
#ifdef DEBUG_rods
#if defined(DEBUG_rods) || defined(DEBUG_bryner)
//#define DEBUG_DOCSHELL_FOCUS
#endif
//
@ -1265,22 +1265,6 @@ NS_IMETHODIMP nsDocShell::SetAllowImages(PRBool aAllowImages)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetFocusDocBeforeContent(PRBool* aDocFirst)
{
NS_ENSURE_ARG_POINTER(aDocFirst);
*aDocFirst = mFocusDocFirst;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetFocusDocBeforeContent(PRBool aDocFirst)
{
mFocusDocFirst = aDocFirst;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetDocShellEnumerator(PRInt32 aItemType, PRInt32 aDirection, nsISimpleEnumerator **outEnum)
{
@ -1409,6 +1393,25 @@ nsDocShell::GetBusyFlags(PRUint32 * aBusyFlags)
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::TabToTreeOwner(PRBool aForward, PRBool* aTookFocus)
{
NS_ENSURE_ARG_POINTER(aTookFocus);
nsCOMPtr<nsIWebBrowserChromeFocus> chromeFocus = do_GetInterface(mTreeOwner);
if (chromeFocus) {
*aTookFocus = PR_TRUE;
if (aForward)
chromeFocus->FocusNextElement();
else
chromeFocus->FocusPrevElement();
} else
*aTookFocus = PR_FALSE;
return NS_OK;
}
//*****************************************************************************
// nsDocShell::nsIDocShellTreeItem
//*****************************************************************************
@ -2692,7 +2695,7 @@ nsDocShell::GetVisibility(PRBool * aVisibility)
// convert the view's visibility attribute to a bool
nsViewVisibility vis;
NS_ENSURE_TRUE(rootView->GetVisibility(vis), NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(rootView->GetVisibility(vis), NS_ERROR_FAILURE);
*aVisibility = nsViewVisibility_kHide == vis ? PR_FALSE : PR_TRUE;
return NS_OK;
@ -2720,28 +2723,6 @@ nsDocShell::GetMainWidget(nsIWidget ** aMainWidget)
return GetParentWidget(aMainWidget);
}
void
nsDocShell::ForceUpdate(nsIDocShell* aDocShell)
{
NS_ASSERTION(aDocShell, "DocShell is null!");
nsCOMPtr<nsIPresShell> presShell;
aDocShell->GetPresShell(getter_AddRefs(presShell));
// we might not have a presshell yet
if (!presShell)
return;
nsCOMPtr<nsIViewManager> vm;
presShell->GetViewManager(getter_AddRefs(vm));
if (vm) {
vm->UpdateAllViews(NS_VMREFRESH_NO_SYNC);
#ifdef DEBUG_DOCSHELL_FOCUS
printf("nsDocShell::ForceUpdate - DS: %p **********\n", aDocShell);
#endif
}
}
NS_IMETHODIMP
nsDocShell::SetFocus()
{
@ -2749,353 +2730,14 @@ nsDocShell::SetFocus()
printf("nsDocShell::SetFocus %p\n", (nsIDocShell*)this);
#endif
nsCOMPtr<nsIPresShell> presShell;
GetPresShell(getter_AddRefs(presShell));
if (!presShell)
return NS_ERROR_FAILURE;
/* Check to make sure the root frame for this document
is not collapsed. */
nsIFrame* rootFrame;
presShell->GetRootFrame(&rootFrame);
if (rootFrame) {
nsRect frameRect;
rootFrame->GetRect(frameRect);
if (frameRect.IsEmpty()) {
#ifdef DEBUG_bryner
printf("SetFocus: empty frame rect, not accepting focus\n");
#endif
return NS_ERROR_FAILURE;
}
}
nsCOMPtr<nsIDocument> document;
presShell->GetDocument(getter_AddRefs(document));
// Figure out what type of document this is
// if parent doc is content then set focus to document itself
// and set the "special" flag so it knows we are at the beginning
// of the document
PRBool doFocusDoc = PR_FALSE;
nsIDocShellTreeItem* treeItem = NS_STATIC_CAST(nsIDocShellTreeItem *, this);
nsCOMPtr<nsIDocShellTreeItem> parentItem;
treeItem->GetParent(getter_AddRefs(parentItem));
if (parentItem) {
PRInt32 type;
parentItem->GetItemType(&type);
doFocusDoc = type == nsIDocShellTreeItem::typeContent;
}
if (mFocusDocFirst)
doFocusDoc = PR_TRUE;
// Tell itself (and the DocShellFocusController) who has focus
// this way focus gets removed from the currently focused DocShell
SetHasFocus(PR_TRUE);
nsCOMPtr<nsIContent> focusContent;
nsCOMPtr<nsIEventStateManager> esm;
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
if (presContext) {
presContext->GetEventStateManager(getter_AddRefs(esm));
nsCOMPtr<nsIContent> rootContent;
document->GetRootContent(getter_AddRefs(rootContent));
if (esm && rootContent) {
// Either focus the document or the "first" piece of content
if (doFocusDoc) {
esm->SetContentState(nsnull, NS_EVENT_STATE_FOCUS);
} else {
nsCOMPtr<nsIContent> content;
esm->GetNextTabbableIndexContent(rootContent, PR_TRUE, PR_TRUE, getter_AddRefs(content));
if (!content) {
esm->GetNextTabbableContent(rootContent, nsnull, PR_TRUE,
getter_AddRefs(focusContent));
} else {
focusContent = content;
}
}
}
}
if (focusContent) {
nsIFrame *focusFrame = nsnull;
presShell->GetPrimaryFrameFor(focusContent, &focusFrame);
esm->ChangeFocus(focusContent, focusFrame, PR_TRUE);
SetCanvasHasFocus(PR_FALSE);
} else {
nsCOMPtr<nsIScriptGlobalObject> sgo;
document->GetScriptGlobalObject(getter_AddRefs(sgo));
if (sgo) {
nsCOMPtr<nsIDOMWindowInternal> domwin(do_QueryInterface(sgo));
if (domwin)
domwin->Focus();
}
}
return NS_OK;
}
//-------------------------------------------------
// Finds the very next DocShell after the arg aNode
nsresult
nsDocShell::FindNextChildDoc(nsIDocShellTreeNode* aNode, PRBool aForward, nsIDocShell** aDocShell)
{
NS_ENSURE_ARG_POINTER(aNode);
*aDocShell = nsnull;
PRInt32 count;
aNode->GetChildCount(&count);
if (count > 0) {
nsCOMPtr<nsIDocShellTreeItem> child;
aNode->GetChildAt(aForward?0:count-1, getter_AddRefs(child));
NS_ASSERTION(child, "Child can't be null!");
nsCOMPtr<nsIDocShell>ds = do_QueryInterface(child);
*aDocShell = ds.get();
NS_ADDREF(*aDocShell);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
//-------------------------------------------------
// Finds the very next DocShell after the arg aNode
PRBool
nsDocShell::FocusNextChild(nsIBaseWindow * aCurrentFocus, PRBool aForward)
{
// Make sure the current focused item is content
// and if so find the next content DS and give it focus
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(aCurrentFocus));
if (treeItem) {
PRInt32 type;
treeItem->GetItemType(&type);
if (type == nsIDocShellTreeItem::typeContent) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(aCurrentFocus));
if (!docShell) return PR_FALSE;
nsCOMPtr<nsIDocShellTreeNode> treeNode(do_QueryInterface(aCurrentFocus));
if (!treeNode) return PR_FALSE;
PRInt32 childCount;
treeNode->GetChildCount(&childCount);
nsCOMPtr<nsIPresContext> presContext;
docShell->GetPresContext(getter_AddRefs(presContext));
if (!presContext) return PR_FALSE;
nsCOMPtr<nsIEventStateManager> esm;
presContext->GetEventStateManager(getter_AddRefs(esm));
if (!esm) return PR_FALSE;
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
if (!presShell) return PR_FALSE;
nsCOMPtr<nsIDocument> document;
presShell->GetDocument(getter_AddRefs(document));
if (!document) return PR_FALSE;
nsIEventStateManager::eDocType docType;
if (NS_FAILED(esm->FigureOutKindOfDoc(document, &docType))) return PR_FALSE;
nsCOMPtr<nsIContent> rootContent;
document->GetRootContent(getter_AddRefs(rootContent));
if (!rootContent) return PR_FALSE;
PRBool hasTabIndexes;
esm->HasPositiveTabIndex(rootContent, &hasTabIndexes); // ignoring return code
nsIDocShell* thisDS = NS_STATIC_CAST(nsIDocShell *, this);
// leave printf for debugging
//printf("DS: %p TBI: %s chld: %s DSE: %s\n", docShell.get(), hasTabIndexes?"Y":"N", childCount > 0?"Y":"N", docShell.get() != thisDS?"Y":"N");
if (docType == nsIEventStateManager::eFrameSet ||
(docShell.get() != thisDS && !hasTabIndexes && childCount > 0)) {
nsCOMPtr<nsIDocShell> childDS;
if (NS_SUCCEEDED(FindNextChildDoc(treeNode, aForward, getter_AddRefs(childDS)))) {
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(childDS));
if (NS_SUCCEEDED(baseWin->SetFocus())) {
MakeSureOfSetFocus(baseWin);
return PR_TRUE;
}
}
} else if (docShell.get() != thisDS) {
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(docShell));
if (NS_SUCCEEDED(baseWin->SetFocus())) {
MakeSureOfSetFocus(baseWin);
return PR_TRUE;
}
}
}
}
return PR_FALSE;
}
//------------------------------------------------------------
// This is just in case we run into a window that
// isn't implemented nsDocShell, because if it is implemented
// by this class then all this will have already been done.
void
nsDocShell::MakeSureOfSetFocus(nsIBaseWindow * aCurrentFocus, nsIDocShell* aDocShell)
{
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(aCurrentFocus);
if (!docShell) {
if (aDocShell != nsnull) {
docShell = aDocShell;
} else {
return;
}
}
PRBool hasFocus;
docShell->GetHasFocus(&hasFocus);
// leave printf for debugging purposes
//printf(">>>>>>>>>> nsDocShell::SetHasFocus: %p %s\n", docShell.get(), hasFocus?"Yes":"No");
if (!hasFocus) {
docShell->SetHasFocus(PR_TRUE);
nsDocShellFocusController* dsfc = nsDocShellFocusController::GetInstance();
if (dsfc) {
dsfc->Focus(docShell);
}
ForceUpdate(docShell);// Force Paint Here
}
}
NS_IMETHODIMP
nsDocShell::FocusAvailable(nsIBaseWindow * aCurrentFocus,
PRBool aForward, PRBool * aTookFocus)
{
NS_ENSURE_ARG_POINTER(aTookFocus);
nsresult ret;
// Are we embedded?
nsCOMPtr<nsIWebBrowserChromeFocus>
chromeFocus(do_GetInterface(mTreeOwner, &ret));
if (chromeFocus) {
#ifdef DEBUG_dr
printf("dr :: nsDocShell::FocusAvailable, embedded\n");
#endif
if (aForward)
ret = chromeFocus->FocusNextElement();
else
ret = chromeFocus->FocusPrevElement();
if (NS_SUCCEEDED(ret)) {
// For DocShell's not implemented by this class
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(chromeFocus));
MakeSureOfSetFocus(nsnull, docShell);
*aTookFocus = PR_TRUE;
return ret;
} else {
// If the embeddor does not implement FocusNext/PrevElement,
// or some other error occurred, just focus ourselves again.
SetFocus();
return NS_OK;
}
}
#ifdef DEBUG_DOCSHELL_FOCUS
nsIDocShellTreeNode* node = NS_STATIC_CAST(nsIDocShellTreeNode *, this);
if (node) {
PrintDocTree(node);
}
#endif
// Otherwise, first person we should call is the parent, or the
// docshell tree owner.
nsCOMPtr<nsIBaseWindow> nextCallWin(do_QueryInterface(mParent));
if (!nextCallWin)
nextCallWin = do_QueryInterface(mTreeOwner);
//If the current focus is us, offer it to the next owner.
if (aCurrentFocus == NS_STATIC_CAST(nsIBaseWindow *, this)) {
if (nextCallWin) {
// Make sure the current focused item is content
// and if so find the next content DS and give it focus
if (FocusNextChild(aCurrentFocus, aForward)) {
*aTookFocus = PR_TRUE;
return NS_OK;
}
ret = nextCallWin->FocusAvailable(aCurrentFocus,
aForward, aTookFocus);
if (NS_SUCCEEDED(ret) && *aTookFocus)
return NS_OK;
}
if (!mChildren.Count()) {
//If we don't have children and our parent didn't want
//the focus then we should just take focus again.
SetFocus();
return NS_OK;
}
}
//Otherwise, check the children and offer it to the next sibling.
PRInt32 i;
PRInt32 n = mChildren.Count();
for (i = 0; i < n; i++) {
nsCOMPtr<nsIBaseWindow>
child(do_QueryInterface((nsISupports *) mChildren.ElementAt(i)));
//If we have focus we offer it to our first child.
if (aCurrentFocus == NS_STATIC_CAST(nsIBaseWindow *, this)) {
// Make sure the current focused item is content
// and if so find the next content DS and give it focus
if (FocusNextChild(child, aForward)) {
*aTookFocus = PR_TRUE;
return NS_OK;
}
if (NS_SUCCEEDED(child->SetFocus())) {
*aTookFocus = PR_TRUE;
// For DocShell's not implemented by this class
MakeSureOfSetFocus(child);
return NS_OK;
}
}
//If we don't have focus, find the child that does then
//offer focus to the next one.
else if (child.get() == aCurrentFocus) {
while (++i < n) {
child =
do_QueryInterface((nsISupports *) mChildren.ElementAt(i));
if (NS_SUCCEEDED(child->SetFocus())) {
*aTookFocus = PR_TRUE;
// For DocShell's not implemented by this class
MakeSureOfSetFocus(child);
return NS_OK;
}
}
break;
}
}
//Reached the end of our child list. If we aren't currently focused, try
// to accept focus.
if ((aCurrentFocus != NS_STATIC_CAST(nsIBaseWindow *, this)) &&
NS_SUCCEEDED(SetFocus())) {
*aTookFocus = PR_TRUE;
return NS_OK;
}
// Call again to offer focus upwards and to start at the beginning of our
// child list if no one above us wants focus.
if (NS_STATIC_CAST(nsIBaseWindow*, this) != aCurrentFocus)
return FocusAvailable(this, aForward, aTookFocus);
*aTookFocus = PR_FALSE;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetTitle(PRUnichar ** aTitle)
{
@ -6064,16 +5706,9 @@ nsDocShell::GetHasFocus(PRBool *aHasFocus)
NS_IMETHODIMP
nsDocShell::SetHasFocus(PRBool aHasFocus)
{
if (mParent != nsnull) {
PRInt32 type;
mParent->GetItemType(&type);
if (type != nsIDocShellTreeItem::typeContent) {
return NS_OK;
}
}
// leave printf for debgging purposes
//printf(">>>>>>>>>> nsDocShell::SetHasFocus: %p %s\n", this, aHasFocus?"Yes":"No");
#ifdef DEBUG_DOCSHELL_FOCUS
printf(">>>>>>>>>> nsDocShell::SetHasFocus: %p %s\n", this, aHasFocus?"Yes":"No");
#endif
mHasFocus = aHasFocus;
@ -6082,10 +5717,14 @@ nsDocShell::SetHasFocus(PRBool aHasFocus)
dsfc->Focus(this);
}
SetCanvasHasFocus(aHasFocus);
if (!aHasFocus) {
// We may be in a situation where the focus outline was shown
// on this document because the user tabbed into it, but the focus
// is now switching to another document via a click. In this case,
// we need to make sure the focus outline is removed from this document.
SetCanvasHasFocus(PR_FALSE);
}
// Force Paint Here
ForceUpdate(this);
return NS_OK;
}
@ -6114,6 +5753,17 @@ nsDocShell::SetCanvasHasFocus(PRBool aCanvasHasFocus)
nsICanvasFrame* canvasFrame;
if (NS_SUCCEEDED(frame->QueryInterface(NS_GET_IID(nsICanvasFrame), (void**)&canvasFrame))) {
canvasFrame->SetHasFocus(aCanvasHasFocus);
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
nsIView* canvasView = nsnull;
frame->GetView(presContext, &canvasView);
nsCOMPtr<nsIViewManager> viewManager;
canvasView->GetViewManager(*getter_AddRefs(viewManager));
viewManager->UpdateView(canvasView, NS_VMREFRESH_NO_SYNC);
return NS_OK;
}
}

View File

@ -278,12 +278,6 @@ protected:
PRBool IsFrame();
// DocShell Focus helpers
void ForceUpdate(nsIDocShell* aDocShell);
nsresult FindNextChildDoc(nsIDocShellTreeNode* aNode, PRBool aForward, nsIDocShell** aDocShell);
PRBool FocusNextChild(nsIBaseWindow * aCurrentFocus, PRBool aForward);
void MakeSureOfSetFocus(nsIBaseWindow * aCurrentFocus, nsIDocShell* aDocShell = nsnull);
//
// Helper method that is called when a new document (including any
// sub-documents - ie. frames) has been completely loaded.

View File

@ -198,13 +198,6 @@ interface nsIDocShell : nsISupports
*/
attribute boolean allowSubframes;
/**
* Attribute stating whether the document itself should come before
* its focusable content in tab traversal (the default is for the document
* to be focused last).
*/
attribute boolean focusDocBeforeContent;
/**
* Attribute stating whether or not images should be loaded.
*/
@ -263,6 +256,13 @@ interface nsIDocShell : nsISupports
*/
attribute boolean canvasHasFocus;
/*
* Tells the docshell to offer focus to its tree owner.
* This is currently only necessary for embedding chrome.
*/
void tabToTreeOwner(in boolean forward,
out boolean tookFocus);
/**
* Current busy state for DocShell
*/

View File

@ -39,6 +39,8 @@
#include "prlog.h"
#include "nsIDOMEventTarget.h"
#include "nsIEventStateManager.h"
#include "nsIDocShell.h"
#include "nsIBaseWindow.h"
#ifdef INCLUDE_XUL
#include "nsIDOMXULDocument.h"
@ -111,6 +113,16 @@ nsFocusController::SetFocusedElement(nsIDOMElement* aElement)
NS_IMETHODIMP
nsFocusController::SetFocusedWindow(nsIDOMWindowInternal* aWindow)
{
if (aWindow && (mCurrentWindow != aWindow)) {
nsCOMPtr<nsIScriptGlobalObject> sgo = do_QueryInterface(aWindow);
if (sgo) {
nsCOMPtr<nsIDocShell> docShell;
sgo->GetDocShell(getter_AddRefs(docShell));
nsCOMPtr<nsIBaseWindow> basewin = do_QueryInterface(docShell);
if (basewin)
basewin->SetFocus();
}
}
mCurrentWindow = aWindow;
return NS_OK;
}
@ -217,7 +229,7 @@ nsFocusController::MoveFocus(PRBool aForward, nsIDOMElement* aElt)
presContext->GetEventStateManager(getter_AddRefs(esm));
if (esm)
// Make this ESM shift the focus per our instructions.
esm->MoveFocus(aForward, content);
esm->ShiftFocus(aForward, content);
return NS_OK;
}

View File

@ -626,13 +626,6 @@ NS_IMETHODIMP nsDocShellTreeOwner::SetFocus()
return NS_ERROR_NULL_POINTER;
}
NS_IMETHODIMP nsDocShellTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
return NS_ERROR_NULL_POINTER;
}
NS_IMETHODIMP nsDocShellTreeOwner::GetTitle(PRUnichar** aTitle)
{
if (mOwnerWin)

View File

@ -80,6 +80,8 @@ interface nsIWebBrowserSetup : nsISupports
* Enables/disables whether the document as a whole gets focus before
* traversing the document's content, or after traversing its content.
*
* NOTE: this property is obsolete and now has no effect
*
* @see setProperty
*/
const unsigned long SETUP_FOCUS_DOC_BEFORE_CONTENT = 6;

View File

@ -702,9 +702,7 @@ NS_IMETHODIMP nsWebBrowser::SetProperty(PRUint32 aId, PRUint32 aValue)
break;
case nsIWebBrowserSetup::SETUP_FOCUS_DOC_BEFORE_CONTENT:
{
NS_ENSURE_STATE(mDocShell);
NS_ENSURE_TRUE((aValue == PR_TRUE || aValue == PR_FALSE), NS_ERROR_INVALID_ARG);
mDocShell->SetFocusDocBeforeContent(aValue);
// obsolete
}
break;
default:
@ -1295,38 +1293,6 @@ NS_IMETHODIMP nsWebBrowser::SetFocus()
return NS_OK;
}
NS_IMETHODIMP nsWebBrowser::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
NS_ENSURE_ARG_POINTER(aTookFocus);
// Next person we should call is first the parent otherwise the
// docshell tree owner.
nsCOMPtr<nsIBaseWindow> nextCallWin(do_QueryInterface(mParent));
if(!nextCallWin)
nextCallWin = do_QueryInterface(nsnull /*mTreeOwner*/);
//If the current focus is us, offer it to the next owner.
if(aCurrentFocus == NS_STATIC_CAST(nsIBaseWindow*, this))
{
if(nextCallWin)
return nextCallWin->FocusAvailable(aCurrentFocus,
aForward, aTookFocus);
return NS_OK;
}
//Otherwise, check the chilren and offer it to the next sibling.
if((mDocShellAsWin.get() != aCurrentFocus) &&
NS_SUCCEEDED(mDocShellAsWin->SetFocus()))
{
*aTookFocus = PR_TRUE;
return NS_OK;
}
return NS_OK;
}
NS_IMETHODIMP nsWebBrowser::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);

View File

@ -270,6 +270,14 @@ public:
NS_IMETHOD SetSubShellFor(nsIContent* aContent,
nsISupports* aSubShell) = 0;
/**
* Find the content in the map that has aSubShell set
* as its subshell. If there is more than one mapping for
* aSubShell, the result is undefined.
*/
NS_IMETHOD FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const = 0;
/**
* Gets the placeholder frame associated with the specified frame. This is
* a helper frame that forwards the request to the frame manager.

View File

@ -791,6 +791,29 @@ DummyLayoutRequest::Cancel(nsresult status)
return rv;
}
// ----------------------------------------------------------------------------
// A generic nsDSTNodeFunctor to look for a specific value in the map
class nsSearchEnumerator : public nsDSTNodeFunctor
{
public:
nsSearchEnumerator(void* aTargetValue)
: mTargetValue(aTargetValue) {
mResultKey = nsnull;
}
void operator() (void* aKey, void* aValue) {
if (aValue == mTargetValue)
mResultKey = aKey;
}
void* GetResult() { return mResultKey; }
private:
void* mResultKey;
void* mTargetValue;
};
// ----------------------------------------------------------------------------
class PresShell : public nsIPresShell, public nsIViewObserver,
@ -856,6 +879,8 @@ public:
nsISupports** aResult) const;
NS_IMETHOD SetSubShellFor(nsIContent* aContent,
nsISupports* aSubShell);
NS_IMETHOD FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const;
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
nsIFrame** aPlaceholderFrame) const;
NS_IMETHOD AppendReflowCommand(nsIReflowCommand* aReflowCommand);
@ -5334,6 +5359,24 @@ PresShell::SetSubShellFor(nsIContent* aContent,
return NS_OK;
}
NS_IMETHODIMP
PresShell::FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const
{
NS_ENSURE_ARG_POINTER(aSubShell);
NS_ENSURE_ARG_POINTER(aContent);
*aContent = nsnull;
if (!mSubShellMap)
return NS_OK;
nsSearchEnumerator enumerator(NS_STATIC_CAST(void*, aSubShell));
mSubShellMap->Enumerate(enumerator);
*aContent = NS_STATIC_CAST(nsIContent*, enumerator.GetResult());
NS_IF_ADDREF(*aContent);
return NS_OK;
}
NS_IMETHODIMP
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,

View File

@ -270,6 +270,14 @@ public:
NS_IMETHOD SetSubShellFor(nsIContent* aContent,
nsISupports* aSubShell) = 0;
/**
* Find the content in the map that has aSubShell set
* as its subshell. If there is more than one mapping for
* aSubShell, the result is undefined.
*/
NS_IMETHOD FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const = 0;
/**
* Gets the placeholder frame associated with the specified frame. This is
* a helper frame that forwards the request to the frame manager.

View File

@ -166,7 +166,6 @@ public:
protected:
virtual PRIntn GetSkipSides() const;
void DrawDottedRect(nsIRenderingContext& aRenderingContext, nsRect& aRect);
// Data members
PRPackedBool mDoPaintFocus;
@ -381,26 +380,6 @@ CanvasFrame::RemoveFrame(nsIPresContext* aPresContext,
return rv;
}
void
CanvasFrame::DrawDottedRect(nsIRenderingContext& aRenderingContext, nsRect& aRect)
{
#ifdef DEBUG_CANVAS_FOCUS
printf("** DrawDottedRect: %d,%d,%d,%d\n",aRect.x, aRect.y, aRect.width, aRect.height);
#endif
aRenderingContext.DrawLine(aRect.x, aRect.y,
aRect.x+aRect.width, aRect.y);
aRenderingContext.DrawLine(aRect.x+aRect.width, aRect.y,
aRect.x+aRect.width, aRect.y+aRect.height);
aRenderingContext.DrawLine(aRect.x+aRect.width, aRect.y+aRect.height,
aRect.x, aRect.y+aRect.height);
aRenderingContext.DrawLine(aRect.x, aRect.y+aRect.height,
aRect.x, aRect.y);
aRenderingContext.DrawLine(aRect.x, aRect.y+aRect.height,
aRect.x, aRect.y);
}
NS_IMETHODIMP
CanvasFrame::Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
@ -438,7 +417,6 @@ CanvasFrame::Paint(nsIPresContext* aPresContext,
#endif
if (mDoPaintFocus) {
aRenderingContext.PushState();
PRBool clipEmpty;
nsRect focusRect;
GetRect(focusRect);
@ -469,29 +447,37 @@ CanvasFrame::Paint(nsIPresContext* aPresContext,
scrollableView->GetClipView(&clippedView);
nsRect vcr;
clippedView->GetBounds(vcr);
focusRect.width = vcr.width;
focusRect.height = vcr.height;
nscoord x,y;
scrollableView->GetScrollPosition(x, y);
focusRect.x += x;
focusRect.y += y;
}
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
aRenderingContext.SetColor(NS_RGB(0,0,0));
nsStyleOutline outlineStyle(aPresContext);
outlineStyle.SetOutlineStyle(NS_STYLE_BORDER_STYLE_DOTTED);
outlineStyle.SetOutlineInvert();
float p2t;
aPresContext->GetPixelsToTwips(&p2t);
// XXX the CSS border for links is specified as 2px, but it
// is only drawn as 1px. Match this here.
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
focusRect.width -= onePixel;
focusRect.height -= onePixel;
nsRect borderInside(focusRect.x + onePixel,
focusRect.y + onePixel,
focusRect.width - 2 * onePixel,
focusRect.height - 2 * onePixel);
DrawDottedRect(aRenderingContext, focusRect);
focusRect.Deflate(onePixel, onePixel);
DrawDottedRect(aRenderingContext, focusRect);
nsCSSRendering::DrawDashedSides(0, aRenderingContext,
focusRect, nsnull,
nsnull, &outlineStyle,
PR_TRUE, focusRect,
borderInside, 0,
nsnull);
}
}
aRenderingContext.PopState(clipEmpty);
}
}
return rv;

View File

@ -166,7 +166,6 @@ public:
protected:
virtual PRIntn GetSkipSides() const;
void DrawDottedRect(nsIRenderingContext& aRenderingContext, nsRect& aRect);
// Data members
PRPackedBool mDoPaintFocus;
@ -381,26 +380,6 @@ CanvasFrame::RemoveFrame(nsIPresContext* aPresContext,
return rv;
}
void
CanvasFrame::DrawDottedRect(nsIRenderingContext& aRenderingContext, nsRect& aRect)
{
#ifdef DEBUG_CANVAS_FOCUS
printf("** DrawDottedRect: %d,%d,%d,%d\n",aRect.x, aRect.y, aRect.width, aRect.height);
#endif
aRenderingContext.DrawLine(aRect.x, aRect.y,
aRect.x+aRect.width, aRect.y);
aRenderingContext.DrawLine(aRect.x+aRect.width, aRect.y,
aRect.x+aRect.width, aRect.y+aRect.height);
aRenderingContext.DrawLine(aRect.x+aRect.width, aRect.y+aRect.height,
aRect.x, aRect.y+aRect.height);
aRenderingContext.DrawLine(aRect.x, aRect.y+aRect.height,
aRect.x, aRect.y);
aRenderingContext.DrawLine(aRect.x, aRect.y+aRect.height,
aRect.x, aRect.y);
}
NS_IMETHODIMP
CanvasFrame::Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
@ -438,7 +417,6 @@ CanvasFrame::Paint(nsIPresContext* aPresContext,
#endif
if (mDoPaintFocus) {
aRenderingContext.PushState();
PRBool clipEmpty;
nsRect focusRect;
GetRect(focusRect);
@ -469,29 +447,37 @@ CanvasFrame::Paint(nsIPresContext* aPresContext,
scrollableView->GetClipView(&clippedView);
nsRect vcr;
clippedView->GetBounds(vcr);
focusRect.width = vcr.width;
focusRect.height = vcr.height;
nscoord x,y;
scrollableView->GetScrollPosition(x, y);
focusRect.x += x;
focusRect.y += y;
}
aRenderingContext.SetLineStyle(nsLineStyle_kDotted);
aRenderingContext.SetColor(NS_RGB(0,0,0));
nsStyleOutline outlineStyle(aPresContext);
outlineStyle.SetOutlineStyle(NS_STYLE_BORDER_STYLE_DOTTED);
outlineStyle.SetOutlineInvert();
float p2t;
aPresContext->GetPixelsToTwips(&p2t);
// XXX the CSS border for links is specified as 2px, but it
// is only drawn as 1px. Match this here.
nscoord onePixel = NSIntPixelsToTwips(1, p2t);
focusRect.width -= onePixel;
focusRect.height -= onePixel;
nsRect borderInside(focusRect.x + onePixel,
focusRect.y + onePixel,
focusRect.width - 2 * onePixel,
focusRect.height - 2 * onePixel);
DrawDottedRect(aRenderingContext, focusRect);
focusRect.Deflate(onePixel, onePixel);
DrawDottedRect(aRenderingContext, focusRect);
nsCSSRendering::DrawDashedSides(0, aRenderingContext,
focusRect, nsnull,
nsnull, &outlineStyle,
PR_TRUE, focusRect,
borderInside, 0,
nsnull);
}
}
aRenderingContext.PopState(clipEmpty);
}
}
return rv;

View File

@ -791,6 +791,29 @@ DummyLayoutRequest::Cancel(nsresult status)
return rv;
}
// ----------------------------------------------------------------------------
// A generic nsDSTNodeFunctor to look for a specific value in the map
class nsSearchEnumerator : public nsDSTNodeFunctor
{
public:
nsSearchEnumerator(void* aTargetValue)
: mTargetValue(aTargetValue) {
mResultKey = nsnull;
}
void operator() (void* aKey, void* aValue) {
if (aValue == mTargetValue)
mResultKey = aKey;
}
void* GetResult() { return mResultKey; }
private:
void* mResultKey;
void* mTargetValue;
};
// ----------------------------------------------------------------------------
class PresShell : public nsIPresShell, public nsIViewObserver,
@ -856,6 +879,8 @@ public:
nsISupports** aResult) const;
NS_IMETHOD SetSubShellFor(nsIContent* aContent,
nsISupports* aSubShell);
NS_IMETHOD FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const;
NS_IMETHOD GetPlaceholderFrameFor(nsIFrame* aFrame,
nsIFrame** aPlaceholderFrame) const;
NS_IMETHOD AppendReflowCommand(nsIReflowCommand* aReflowCommand);
@ -5334,6 +5359,24 @@ PresShell::SetSubShellFor(nsIContent* aContent,
return NS_OK;
}
NS_IMETHODIMP
PresShell::FindContentForShell(nsISupports* aSubShell,
nsIContent** aContent) const
{
NS_ENSURE_ARG_POINTER(aSubShell);
NS_ENSURE_ARG_POINTER(aContent);
*aContent = nsnull;
if (!mSubShellMap)
return NS_OK;
nsSearchEnumerator enumerator(NS_STATIC_CAST(void*, aSubShell));
mSubShellMap->Enumerate(enumerator);
*aContent = NS_STATIC_CAST(nsIContent*, enumerator.GetResult());
NS_IF_ADDREF(*aContent);
return NS_OK;
}
NS_IMETHODIMP
PresShell::GetPlaceholderFrameFor(nsIFrame* aFrame,

View File

@ -400,6 +400,7 @@ frameset {
frame {
background-color: transparent ! important; /* (b=49779) */
-moz-user-focus: normal;
}
iframe {

View File

@ -400,6 +400,7 @@ frameset {
frame {
background-color: transparent ! important; /* (b=49779) */
-moz-user-focus: normal;
}
iframe {

View File

@ -401,15 +401,6 @@ NS_IMETHODIMP nsBrowserWindow::SetFocus()
return NS_OK;
}
NS_IMETHODIMP nsBrowserWindow::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
//XXX First Check In
NS_ASSERTION(PR_FALSE, "Not Yet Implemented");
return NS_OK;
}
NS_IMETHODIMP nsBrowserWindow::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);
@ -2091,12 +2082,6 @@ nsBrowserWindow::FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aRes
return NS_OK;
}
NS_IMETHODIMP
nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken)
{
return NS_OK;
}
//----------------------------------------

View File

@ -139,7 +139,6 @@ public:
nsIWebShell *&aNewWebShell);
NS_IMETHOD ContentShellAdded(nsIWebShell* aChildShell, nsIContent* frameNode);
NS_IMETHOD FindWebShellWithName(const PRUnichar* aName, nsIWebShell*& aResult);
NS_IMETHOD FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTaken);
// nsBrowserWindow
void SetWebCrawler(nsWebCrawler* aWebCrawler);

View File

@ -186,21 +186,6 @@ interface nsIBaseWindow : nsISupports
*/
void setFocus();
/* This is called when focus is available for the taking because of
tabbing through an object. In any case this is called on an object to
allow it to take focus if it desires. If the aCurrentFocus object is
the object being called, then the object being called should offer focus to
it's parent. If the aCurrentFocus is a child of the object being called,
the object being called should set the focus to the next sibling to the
aCurrentFocus object. Otherwise it should take focus for itself. If the
object being called can not take focus for itself it should offer focus to
it's parent. Note an object should not take focus for itself by giving it
to a child. In most cases this function is being called because the child
is trying to give up focus. */
void focusAvailable(in nsIBaseWindow aCurrentFocus,
in boolean aForward,
out boolean aTookFocus);
/*
Title of the window.
*/

View File

@ -2463,6 +2463,9 @@ BOOL nsWindow::OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode)
{
DispatchKeyEvent(NS_KEY_PRESS, 0, aVirtualKeyCode);
}
else if (mIsControlDown && aVirtualKeyCode == NS_VK_TAB) {
DispatchKeyEvent(NS_KEY_PRESS, 0, NS_VK_TAB);
}
else if (mIsControlDown && aVirtualKeyCode == NS_VK_SUBTRACT) {
DispatchKeyEvent(NS_KEY_PRESS, aVirtualKeyCode-64, 0);
}

View File

@ -311,13 +311,6 @@ NS_IMETHODIMP nsChromeTreeOwner::SetFocus()
return mXULWindow->SetFocus();
}
NS_IMETHODIMP nsChromeTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
return mXULWindow->FocusAvailable(aCurrentFocus, aForward, aTookFocus);
}
NS_IMETHODIMP nsChromeTreeOwner::GetTitle(PRUnichar** aTitle)
{
return mXULWindow->GetTitle(aTitle);

View File

@ -533,13 +533,6 @@ NS_IMETHODIMP nsContentTreeOwner::SetFocus()
return mXULWindow->SetFocus();
}
NS_IMETHODIMP nsContentTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
return mXULWindow->FocusAvailable(aCurrentFocus, aForward, aTookFocus);
}
NS_IMETHODIMP nsContentTreeOwner::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);

View File

@ -618,13 +618,6 @@ NS_IMETHODIMP nsXULWindow::SetFocus()
return NS_OK;
}
NS_IMETHODIMP nsXULWindow::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool aForward,
PRBool* aTookFocus)
{
return NS_OK;
}
NS_IMETHODIMP nsXULWindow::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);

View File

@ -15,6 +15,19 @@
<content orient="vertical"/>
<implementation>
<property name="handleCtrlTab">
<setter>
<![CDATA[
this.setAttribute("handleCtrlTab", "true");
]]>
</setter>
<getter>
<![CDATA[
return (this.getAttribute("handleCtrlTab") != "false");
]]>
</getter>
</property>
<property name="_tabs">
<getter>
<![CDATA[
@ -78,15 +91,19 @@
<handlers>
<handler event="keypress" keycode="vk_tab" modifiers="control">
<![CDATA[
if (this._tabs)
if (this._tabs && this.handleCtrlTab) {
this._tabs.advanceSelectedTab(1);
event.preventDefault();
}
]]>
</handler>
<handler event="keypress" keycode="vk_tab" modifiers="control,shift">
<![CDATA[
if (this._tabs)
if (this._tabs && this.handleCtrlTab) {
this._tabs.advanceSelectedTab(-1);
event.preventDefault();
}
]]>
</handler>
</handlers>
@ -196,10 +213,20 @@
<parameter name="aDir"/>
<body>
<![CDATA[
var next = this.selectedItem[aDir == -1 ? "previousSibling" : "nextSibling"];
if (next && !next.getAttribute("hidden")) {
var startTab = this.selectedItem;
var next = startTab[aDir == -1 ? "previousSibling" : "nextSibling"];
while (next != startTab && (!next || next.getAttribute("hidden"))) {
if (next && next.getAttribute("hidden"))
next = next[aDir == -1 ? "previousSibling" : "nextSibling"];
if (!next)
next = aDir == 1 ? this.childNodes[0] : this.childNodes[this.childNodes.length - 1];
}
if (next && next != startTab) {
this.selectedItem = next;
next.focus();
document.commandDispatcher.advanceFocusIntoSubtree(next);
}
]]>
</body>

View File

@ -681,6 +681,7 @@
<constructor>
this.mCurrentBrowser = this.mPanelContainer.firstChild;
this.mCurrentTab = this.mTabContainer.firstChild;
this.mTabBox.setAttribute("handleCtrlTab", "false");
</constructor>
<destructor>

View File

@ -45,7 +45,10 @@ bindings, binding, content, member, triple {
checkbox,
colorpicker[type="button"],
menulist,
outliner {
outliner,
browser,
editor,
iframe {
-moz-user-focus: normal;
}