зеркало из https://github.com/mozilla/gecko-dev.git
Eliminating nsIFocusableContent
This commit is contained in:
Родитель
261cd2559d
Коммит
ea2d786aaa
|
@ -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<nsIFocusableContent> 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<nsIFocusableContent> 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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<nsIFocusableContent> 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<nsIFocusableContent> 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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
checkbox,radio,tree,menulist {
|
||||
user-focus: normal;
|
||||
}
|
||||
|
||||
/**
|
||||
* All elements that have no visual representation
|
||||
*/
|
||||
|
|
|
@ -147,8 +147,11 @@
|
|||
</content>
|
||||
<interface>
|
||||
<!-- public interface -->
|
||||
<property name="checked" onset="return this.setAttribute('checked',val);"
|
||||
onget="return this.getAttribute('checked');"/>
|
||||
<property name="checked" onset="if (val) this.setAttribute('checked', 'true');
|
||||
else this.removeAttribute('checked');
|
||||
return val;"
|
||||
onget="var v = this.getAttribute('checked');
|
||||
if (v == 'true') return true; return false;"/>
|
||||
</interface>
|
||||
<handlers>
|
||||
<handler type="mouseup" value="this.checked = !this.checked;"/>
|
||||
|
@ -269,8 +272,8 @@
|
|||
onget="return this.anonymousContent[0].firstChild.readonly;"/>
|
||||
</interface>
|
||||
<handlers>
|
||||
<handler type="focus" value="var v = this.anonymousContent[0]; this.setAttribute('focused','true'); v.firstChild.focus();"/>
|
||||
<handler type="blur" value="var v = this.anonymousContent[0]; this.removeAttribute('focused'); v.firstChild.blur();"/>
|
||||
<handler type="focus" value="this.setAttribute('focused','true');"/>
|
||||
<handler type="blur" value="this.removeAttribute('focused');"/>
|
||||
</handlers>
|
||||
</binding>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче