mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 940698 - Add an "ownerNumberControl" property to HTMLInputElement. r=smaug
This commit is contained in:
parent
05d379bdc6
commit
c500711e7e
@ -2244,6 +2244,21 @@ HTMLInputElement::MozIsTextField(bool aExcludePassword)
|
||||
return IsSingleLineTextControl(aExcludePassword);
|
||||
}
|
||||
|
||||
HTMLInputElement*
|
||||
HTMLInputElement::GetOwnerNumberControl()
|
||||
{
|
||||
if (IsInNativeAnonymousSubtree() &&
|
||||
mType == NS_FORM_INPUT_TEXT &&
|
||||
GetParent() && GetParent()->GetParent()) {
|
||||
HTMLInputElement* grandparent =
|
||||
HTMLInputElement::FromContentOrNull(GetParent()->GetParent());
|
||||
if (grandparent && grandparent->mType == NS_FORM_INPUT_NUMBER) {
|
||||
return grandparent;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
HTMLInputElement::MozIsTextField(bool aExcludePassword, bool* aResult)
|
||||
{
|
||||
|
@ -668,6 +668,8 @@ public:
|
||||
|
||||
void MozSetFileNameArray(const Sequence< nsString >& aFileNames);
|
||||
|
||||
HTMLInputElement* GetOwnerNumberControl();
|
||||
|
||||
bool MozIsTextField(bool aExcludePassword);
|
||||
|
||||
nsIEditor* GetEditor();
|
||||
|
@ -154,6 +154,18 @@ partial interface HTMLInputElement {
|
||||
[ChromeOnly]
|
||||
void mozSetFileNameArray(sequence<DOMString> fileNames);
|
||||
|
||||
// Number controls (<input type=number>) have an anonymous text control
|
||||
// (<input type=text>) in the anonymous shadow tree that they contain. On
|
||||
// such an anonymous text control this property provides access to the
|
||||
// number control that owns the text control. This is useful, for example,
|
||||
// in code that looks at the currently focused element to make decisions
|
||||
// about which IME to bring up. Such code needs to be able to check for any
|
||||
// owning number control since it probably wants to bring up a number pad
|
||||
// instead of the standard keyboard, even when the anonymous text control has
|
||||
// focus.
|
||||
[ChromeOnly]
|
||||
readonly attribute HTMLInputElement? ownerNumberControl;
|
||||
|
||||
boolean mozIsTextField(boolean aExcludePassword);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user