зеркало из https://github.com/mozilla/pjs.git
[XForms] Expose switch-state to script. Bug 332127, r=aaronr+doronr
This commit is contained in:
Родитель
79060aff34
Коммит
3e4469d997
|
@ -43,16 +43,21 @@ interface nsIDOMElement;
|
|||
/**
|
||||
* Interface implemented by the switch element.
|
||||
*/
|
||||
[uuid(edeb1e48-5d5c-4091-8021-5975310caa66)]
|
||||
[scriptable, uuid(42af102c-4c96-4534-9ea7-20a23fddbf60)]
|
||||
interface nsIXFormsSwitchElement : nsISupports
|
||||
{
|
||||
/**
|
||||
* Used by case elements to select or deselect themselves.
|
||||
* Select or deselect a given case element.
|
||||
*
|
||||
* @param aCase The case element
|
||||
* @param aValue The value of the selected attribute.
|
||||
* @param caseEl The case element
|
||||
* @param value Select (true) or deselect (false)
|
||||
*/
|
||||
void setSelected(in nsIDOMElement aCase, in boolean aValue);
|
||||
void setSelected(in nsIDOMElement caseEl, in boolean value);
|
||||
|
||||
/**
|
||||
* Retrieve the currently selected case element.
|
||||
*/
|
||||
readonly attribute nsIDOMElement selected;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -232,6 +232,17 @@ nsXFormsSwitchElement::FindFirstSelectedCase(nsIDOMElement* aDeselected)
|
|||
return result;
|
||||
}
|
||||
|
||||
// nsIXFormsSwitchElement
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXFormsSwitchElement::GetSelected(nsIDOMElement **aCase)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCase);
|
||||
NS_IF_ADDREF(*aCase = mSelected);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXFormsSwitchElement::SetSelected(nsIDOMElement *aCase, PRBool aValue)
|
||||
{
|
||||
|
@ -292,6 +303,8 @@ nsXFormsSwitchElement::SetSelected(nsIDOMElement *aCase, PRBool aValue)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// nsXFormsSwitchElement
|
||||
|
||||
void
|
||||
nsXFormsSwitchElement::SetFocus(nsIDOMElement* aDeselected,
|
||||
nsIDOMElement* aSelected)
|
||||
|
@ -380,6 +393,8 @@ nsXFormsSwitchElement::CaseChanged(nsIDOMNode* aCase, PRBool aRemoved)
|
|||
}
|
||||
}
|
||||
|
||||
// nsIXFormsControl
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXFormsSwitchElement::IsEventTarget(PRBool *aOK)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче