mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 795610 - Part d: Prepare HTMLElement.click() for WebIDL bindings; r=mounir
This commit is contained in:
parent
ade404accf
commit
f5b72a0de2
@ -3808,10 +3808,11 @@ nsGenericHTMLElement::Focus()
|
||||
return fm ? fm->SetFocus(elem, 0) : NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsGenericHTMLElement::Click()
|
||||
void
|
||||
nsGenericHTMLElement::Click()
|
||||
{
|
||||
if (HasFlag(NODE_HANDLING_CLICK))
|
||||
return NS_OK;
|
||||
return;
|
||||
|
||||
// Strong in case the event kills it
|
||||
nsCOMPtr<nsIDocument> doc = GetCurrentDoc();
|
||||
@ -3837,7 +3838,6 @@ nsresult nsGenericHTMLElement::Click()
|
||||
nsEventDispatcher::Dispatch(this, context, &event);
|
||||
|
||||
UnsetFlags(NODE_HANDLING_CLICK);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -81,6 +81,7 @@ public:
|
||||
const nsAString& aValue);
|
||||
|
||||
// WebIDL HTMLElement
|
||||
virtual void Click();
|
||||
virtual int32_t TabIndexDefault()
|
||||
{
|
||||
return -1;
|
||||
@ -119,6 +120,11 @@ public:
|
||||
nsresult GetClassName(nsAString& aClassName);
|
||||
nsresult SetClassName(const nsAString& aClassName);
|
||||
|
||||
nsresult DOMClick()
|
||||
{
|
||||
Click();
|
||||
return NS_OK;
|
||||
}
|
||||
nsresult GetTabIndex(int32_t* aTabIndex)
|
||||
{
|
||||
*aTabIndex = TabIndex();
|
||||
@ -159,7 +165,6 @@ public:
|
||||
// methods properly override them.
|
||||
NS_IMETHOD Focus();
|
||||
NS_IMETHOD Blur();
|
||||
NS_IMETHOD Click();
|
||||
NS_IMETHOD GetHidden(bool* aHidden);
|
||||
NS_IMETHOD SetHidden(bool aHidden);
|
||||
NS_IMETHOD GetSpellcheck(bool* aSpellcheck);
|
||||
@ -1396,7 +1401,6 @@ protected:
|
||||
/* Use this macro to declare functions that forward the behavior of this
|
||||
* interface to another object.
|
||||
* This macro doesn't forward
|
||||
* - Click
|
||||
* - Focus
|
||||
* - GetInnerHTML
|
||||
* - SetInnerHTML
|
||||
@ -1442,6 +1446,9 @@ protected:
|
||||
NS_IMETHOD SetHidden(bool aHidden) { \
|
||||
return _to SetHidden(aHidden); \
|
||||
} \
|
||||
NS_IMETHOD DOMClick() { \
|
||||
return _to DOMClick(); \
|
||||
} \
|
||||
NS_IMETHOD GetTabIndex(int32_t* aTabIndex) { \
|
||||
return _to GetTabIndex(aTabIndex); \
|
||||
} \
|
||||
|
@ -28,9 +28,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLElement::)
|
||||
NS_IMETHOD Click() {
|
||||
return nsGenericHTMLElement::Click();
|
||||
}
|
||||
NS_IMETHOD Focus() {
|
||||
return nsGenericHTMLElement::Focus();
|
||||
}
|
||||
|
@ -1972,13 +1972,14 @@ nsHTMLInputElement::SelectAll(nsPresContext* aPresContext)
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
nsHTMLInputElement::Click()
|
||||
{
|
||||
if (mType == NS_FORM_INPUT_FILE)
|
||||
if (mType == NS_FORM_INPUT_FILE) {
|
||||
FireAsyncClickHandler();
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::Click();
|
||||
nsGenericHTMLElement::Click();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -76,7 +76,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLFormElement::)
|
||||
NS_IMETHOD Click();
|
||||
NS_IMETHOD Focus();
|
||||
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) {
|
||||
return nsGenericHTMLFormElement::GetInnerHTML(aInnerHTML);
|
||||
@ -84,6 +83,7 @@ public:
|
||||
NS_IMETHOD SetInnerHTML(const nsAString& aInnerHTML) {
|
||||
return nsGenericHTMLFormElement::SetInnerHTML(aInnerHTML);
|
||||
}
|
||||
virtual void Click() MOZ_OVERRIDE;
|
||||
virtual int32_t TabIndexDefault() MOZ_OVERRIDE;
|
||||
|
||||
// nsIDOMHTMLInputElement
|
||||
|
@ -42,9 +42,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLFormElement::)
|
||||
NS_IMETHOD Click() {
|
||||
return nsGenericHTMLFormElement::Click();
|
||||
}
|
||||
NS_IMETHOD Focus();
|
||||
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) {
|
||||
return nsGenericHTMLFormElement::GetInnerHTML(aInnerHTML);
|
||||
|
@ -37,9 +37,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLElement::)
|
||||
NS_IMETHOD Click() {
|
||||
return nsGenericHTMLElement::Click();
|
||||
}
|
||||
NS_IMETHOD Focus();
|
||||
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) {
|
||||
return nsGenericHTMLElement::GetInnerHTML(aInnerHTML);
|
||||
|
@ -50,9 +50,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLElement::)
|
||||
NS_IMETHOD Click() {
|
||||
return nsGenericHTMLElement::Click();
|
||||
}
|
||||
NS_IMETHOD Focus() {
|
||||
return nsGenericHTMLElement::Focus();
|
||||
}
|
||||
|
@ -38,9 +38,6 @@ public:
|
||||
|
||||
// nsIDOMHTMLElement
|
||||
NS_FORWARD_NSIDOMHTMLELEMENT_BASIC(nsGenericHTMLElement::)
|
||||
NS_IMETHOD Click() {
|
||||
return nsGenericHTMLElement::Click();
|
||||
}
|
||||
NS_IMETHOD Focus() {
|
||||
return nsGenericHTMLElement::Focus();
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ nsXULContextMenuBuilder::Click(const nsAString& aGeneratedItemId)
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIDOMHTMLElement> element = mElements.SafeObjectAt(idx);
|
||||
if (element) {
|
||||
element->Click();
|
||||
element->DOMClick();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ interface nsIDOMHTMLElement : nsIDOMElement
|
||||
* See <http://www.whatwg.org/html5/#the-hidden-attribute>.
|
||||
*/
|
||||
attribute boolean hidden;
|
||||
[binaryname(DOMClick)]
|
||||
void click();
|
||||
attribute long tabIndex;
|
||||
void focus();
|
||||
|
Loading…
Reference in New Issue
Block a user