diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index e79440fba511..aed7f8eb186a 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -52,7 +52,6 @@ #include "nsIDocument.h" #include "nsIEventListenerManager.h" #include "nsIEventStateManager.h" -#include "nsIFocusableContent.h" #include "nsIHTMLContentContainer.h" #include "nsIHTMLStyleSheet.h" #include "nsIJSScriptObject.h" @@ -618,11 +617,6 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result) else if (iid.Equals(kIJSScriptObjectIID)) { *result = NS_STATIC_CAST(nsIJSScriptObject*, this); } - else if (iid.Equals(NS_GET_IID(nsIFocusableContent)) && - (NameSpaceID() == kNameSpaceID_XUL) && - IsFocusableContent()) { - *result = NS_STATIC_CAST(nsIFocusableContent*, this); - } else if (iid.Equals(NS_GET_IID(nsIBindableContent))) { *result = NS_STATIC_CAST(nsIBindableContent*, this); } @@ -4083,11 +4077,6 @@ nsXULElement::IsAncestor(nsIDOMNode* aParentNode, nsIDOMNode* aChildNode) NS_IMETHODIMP nsXULElement::Focus() { - // Make sure we're focusable. - nsCOMPtr focusable = do_QueryInterface((nsIStyledContent*)this); - if (!focusable) - return NS_OK; - // Obtain a presentation context and then call SetFocus. PRInt32 count = mDocument->GetNumberOfShells(); if (count == 0) @@ -4106,11 +4095,6 @@ nsXULElement::Focus() NS_IMETHODIMP nsXULElement::Blur() { - // Make sure we're focusable. - nsCOMPtr focusable = do_QueryInterface((nsIStyledContent*)this); - if (!focusable) - return NS_OK; - // Obtain a presentation context and then call SetFocus. PRInt32 count = mDocument->GetNumberOfShells(); if (count == 0) diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index 6980eb40b184..94ab173c02d9 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -42,7 +42,6 @@ #include "nsIDOMXULElement.h" #include "nsIDOMXULTreeElement.h" #include "nsIEventListenerManager.h" -#include "nsIFocusableContent.h" #include "nsIJSScriptObject.h" #include "nsINameSpace.h" #include "nsINameSpaceManager.h" @@ -312,7 +311,6 @@ public: class nsXULElement : public nsIStyledContent, public nsIXMLContent, public nsIXULContent, - public nsIFocusableContent, public nsIBindableContent, public nsIDOMXULElement, public nsIDOMEventReceiver, @@ -414,6 +412,8 @@ public: NS_IMETHOD RangeAdd(nsIDOMRange& aRange); NS_IMETHOD RangeRemove(nsIDOMRange& aRange); NS_IMETHOD GetRangeList(nsVoidArray*& aResult) const; + NS_IMETHOD SetFocus(nsIPresContext* aPresContext); + NS_IMETHOD RemoveFocus(nsIPresContext* aPresContext); // nsIStyledContent NS_IMETHOD GetID(nsIAtom*& aResult) const; @@ -442,10 +442,6 @@ public: NS_IMETHOD AddScriptEventListener(nsIAtom* aName, const nsString& aValue, REFNSIID aIID); NS_IMETHOD ForceElementToOwnResource(PRBool aForce); - // nsIFocusableContent interface - NS_IMETHOD SetFocus(nsIPresContext* aPresContext); - NS_IMETHOD RemoveFocus(nsIPresContext* aPresContext); - // nsIBindableContent interface NS_IMETHOD SetBinding(nsIXBLBinding* aBinding); NS_IMETHOD GetBinding(nsIXBLBinding** aResult); diff --git a/rdf/content/src/nsXULElement.cpp b/rdf/content/src/nsXULElement.cpp index e79440fba511..aed7f8eb186a 100644 --- a/rdf/content/src/nsXULElement.cpp +++ b/rdf/content/src/nsXULElement.cpp @@ -52,7 +52,6 @@ #include "nsIDocument.h" #include "nsIEventListenerManager.h" #include "nsIEventStateManager.h" -#include "nsIFocusableContent.h" #include "nsIHTMLContentContainer.h" #include "nsIHTMLStyleSheet.h" #include "nsIJSScriptObject.h" @@ -618,11 +617,6 @@ nsXULElement::QueryInterface(REFNSIID iid, void** result) else if (iid.Equals(kIJSScriptObjectIID)) { *result = NS_STATIC_CAST(nsIJSScriptObject*, this); } - else if (iid.Equals(NS_GET_IID(nsIFocusableContent)) && - (NameSpaceID() == kNameSpaceID_XUL) && - IsFocusableContent()) { - *result = NS_STATIC_CAST(nsIFocusableContent*, this); - } else if (iid.Equals(NS_GET_IID(nsIBindableContent))) { *result = NS_STATIC_CAST(nsIBindableContent*, this); } @@ -4083,11 +4077,6 @@ nsXULElement::IsAncestor(nsIDOMNode* aParentNode, nsIDOMNode* aChildNode) NS_IMETHODIMP nsXULElement::Focus() { - // Make sure we're focusable. - nsCOMPtr focusable = do_QueryInterface((nsIStyledContent*)this); - if (!focusable) - return NS_OK; - // Obtain a presentation context and then call SetFocus. PRInt32 count = mDocument->GetNumberOfShells(); if (count == 0) @@ -4106,11 +4095,6 @@ nsXULElement::Focus() NS_IMETHODIMP nsXULElement::Blur() { - // Make sure we're focusable. - nsCOMPtr focusable = do_QueryInterface((nsIStyledContent*)this); - if (!focusable) - return NS_OK; - // Obtain a presentation context and then call SetFocus. PRInt32 count = mDocument->GetNumberOfShells(); if (count == 0) diff --git a/rdf/content/src/nsXULElement.h b/rdf/content/src/nsXULElement.h index 6980eb40b184..94ab173c02d9 100644 --- a/rdf/content/src/nsXULElement.h +++ b/rdf/content/src/nsXULElement.h @@ -42,7 +42,6 @@ #include "nsIDOMXULElement.h" #include "nsIDOMXULTreeElement.h" #include "nsIEventListenerManager.h" -#include "nsIFocusableContent.h" #include "nsIJSScriptObject.h" #include "nsINameSpace.h" #include "nsINameSpaceManager.h" @@ -312,7 +311,6 @@ public: class nsXULElement : public nsIStyledContent, public nsIXMLContent, public nsIXULContent, - public nsIFocusableContent, public nsIBindableContent, public nsIDOMXULElement, public nsIDOMEventReceiver, @@ -414,6 +412,8 @@ public: NS_IMETHOD RangeAdd(nsIDOMRange& aRange); NS_IMETHOD RangeRemove(nsIDOMRange& aRange); NS_IMETHOD GetRangeList(nsVoidArray*& aResult) const; + NS_IMETHOD SetFocus(nsIPresContext* aPresContext); + NS_IMETHOD RemoveFocus(nsIPresContext* aPresContext); // nsIStyledContent NS_IMETHOD GetID(nsIAtom*& aResult) const; @@ -442,10 +442,6 @@ public: NS_IMETHOD AddScriptEventListener(nsIAtom* aName, const nsString& aValue, REFNSIID aIID); NS_IMETHOD ForceElementToOwnResource(PRBool aForce); - // nsIFocusableContent interface - NS_IMETHOD SetFocus(nsIPresContext* aPresContext); - NS_IMETHOD RemoveFocus(nsIPresContext* aPresContext); - // nsIBindableContent interface NS_IMETHOD SetBinding(nsIXBLBinding* aBinding); NS_IMETHOD GetBinding(nsIXBLBinding** aResult); diff --git a/xpfe/global/resources/skin/xul.css b/xpfe/global/resources/skin/xul.css index 7d52fb217692..4e2c7ddc25e5 100644 --- a/xpfe/global/resources/skin/xul.css +++ b/xpfe/global/resources/skin/xul.css @@ -19,6 +19,10 @@ display: none; } +checkbox,radio,tree,menulist { + user-focus: normal; +} + /** * All elements that have no visual representation */ diff --git a/xpfe/global/resources/skin/xulBindings.xml b/xpfe/global/resources/skin/xulBindings.xml index c6686855cfca..12707fdfc4fc 100644 --- a/xpfe/global/resources/skin/xulBindings.xml +++ b/xpfe/global/resources/skin/xulBindings.xml @@ -147,8 +147,11 @@ - + @@ -269,8 +272,8 @@ onget="return this.anonymousContent[0].firstChild.readonly;"/> - - + +