michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#the-input-element michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis michael@0: * michael@0: * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and michael@0: * Opera Software ASA. You are granted a license to use, reproduce michael@0: * and create derivative works of this document. michael@0: */ michael@0: michael@0: enum SelectionMode { michael@0: "select", michael@0: "start", michael@0: "end", michael@0: "preserve", michael@0: }; michael@0: michael@0: interface nsIControllers; michael@0: michael@0: interface HTMLInputElement : HTMLElement { michael@0: [Pure, SetterThrows] michael@0: attribute DOMString accept; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString alt; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString autocomplete; michael@0: [Pure, SetterThrows] michael@0: attribute boolean autofocus; michael@0: [Pure, SetterThrows] michael@0: attribute boolean defaultChecked; michael@0: [Pure] michael@0: attribute boolean checked; michael@0: // Bug 850337 - attribute DOMString dirName; michael@0: [Pure, SetterThrows] michael@0: attribute boolean disabled; michael@0: readonly attribute HTMLFormElement? form; michael@0: [Pure] michael@0: readonly attribute FileList? files; michael@0: [Throws, Pref="dom.input.dirpicker"] michael@0: void openDirectoryPicker(); michael@0: [Pure, SetterThrows] michael@0: attribute DOMString formAction; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString formEnctype; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString formMethod; michael@0: [Pure, SetterThrows] michael@0: attribute boolean formNoValidate; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString formTarget; michael@0: [Pure, SetterThrows] michael@0: attribute unsigned long height; michael@0: [Pure] michael@0: attribute boolean indeterminate; michael@0: [Pure, SetterThrows, Pref="dom.forms.inputmode"] michael@0: attribute DOMString inputMode; michael@0: [Pure] michael@0: readonly attribute HTMLElement? list; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString max; michael@0: [Pure, SetterThrows] michael@0: attribute long maxLength; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString min; michael@0: [Pure, SetterThrows] michael@0: attribute boolean multiple; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString name; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString pattern; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString placeholder; michael@0: [Pure, SetterThrows] michael@0: attribute boolean readOnly; michael@0: [Pure, SetterThrows] michael@0: attribute boolean required; michael@0: [Pure, SetterThrows] michael@0: attribute unsigned long size; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString src; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString step; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString type; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString defaultValue; michael@0: [Pure, TreatNullAs=EmptyString, SetterThrows] michael@0: attribute DOMString value; michael@0: [Throws, Pref="dom.experimental_forms"] michael@0: attribute Date? valueAsDate; michael@0: [Pure, SetterThrows] michael@0: attribute unrestricted double valueAsNumber; michael@0: attribute unsigned long width; michael@0: michael@0: [Throws] michael@0: void stepUp(optional long n = 1); michael@0: [Throws] michael@0: void stepDown(optional long n = 1); michael@0: michael@0: [Pure] michael@0: readonly attribute boolean willValidate; michael@0: [Pure] michael@0: readonly attribute ValidityState validity; michael@0: [GetterThrows] michael@0: readonly attribute DOMString validationMessage; michael@0: boolean checkValidity(); michael@0: void setCustomValidity(DOMString error); michael@0: michael@0: // Bug 850365 readonly attribute NodeList labels; michael@0: michael@0: void select(); michael@0: michael@0: [Throws] michael@0: // TODO: unsigned vs signed michael@0: attribute long selectionStart; michael@0: [Throws] michael@0: attribute long selectionEnd; michael@0: [Throws] michael@0: attribute DOMString selectionDirection; michael@0: [Throws] michael@0: void setRangeText(DOMString replacement); michael@0: [Throws] michael@0: void setRangeText(DOMString replacement, unsigned long start, michael@0: unsigned long end, optional SelectionMode selectionMode = "preserve"); michael@0: michael@0: // also has obsolete members michael@0: }; michael@0: michael@0: partial interface HTMLInputElement { michael@0: [Pure, SetterThrows] michael@0: attribute DOMString align; michael@0: [Pure, SetterThrows] michael@0: attribute DOMString useMap; michael@0: }; michael@0: michael@0: // Mozilla extensions michael@0: michael@0: partial interface HTMLInputElement { michael@0: [Throws] michael@0: void setSelectionRange(long start, long end, optional DOMString direction); michael@0: michael@0: [GetterThrows, ChromeOnly] michael@0: readonly attribute nsIControllers controllers; michael@0: [GetterThrows] michael@0: readonly attribute long textLength; michael@0: michael@0: [ChromeOnly] michael@0: sequence mozGetFileNameArray(); michael@0: michael@0: [ChromeOnly] michael@0: void mozSetFileNameArray(sequence fileNames); michael@0: michael@0: // Number controls () have an anonymous text control michael@0: // () in the anonymous shadow tree that they contain. On michael@0: // such an anonymous text control this property provides access to the michael@0: // number control that owns the text control. This is useful, for example, michael@0: // in code that looks at the currently focused element to make decisions michael@0: // about which IME to bring up. Such code needs to be able to check for any michael@0: // owning number control since it probably wants to bring up a number pad michael@0: // instead of the standard keyboard, even when the anonymous text control has michael@0: // focus. michael@0: [ChromeOnly] michael@0: readonly attribute HTMLInputElement? ownerNumberControl; michael@0: michael@0: boolean mozIsTextField(boolean aExcludePassword); michael@0: }; michael@0: michael@0: partial interface HTMLInputElement { michael@0: // Mirrored chrome-only nsIDOMNSEditableElement methods. Please make sure michael@0: // to update this list if nsIDOMNSEditableElement changes. michael@0: michael@0: [Pure, ChromeOnly] michael@0: readonly attribute nsIEditor? editor; michael@0: michael@0: // This is similar to set .value on nsIDOMInput/TextAreaElements, but handling michael@0: // of the value change is closer to the normal user input, so 'change' event michael@0: // for example will be dispatched when focusing out the element. michael@0: [ChromeOnly] michael@0: void setUserInput(DOMString input); michael@0: }; michael@0: michael@0: [NoInterfaceObject] michael@0: interface MozPhonetic { michael@0: [Pure, ChromeOnly] michael@0: readonly attribute DOMString phonetic; michael@0: }; michael@0: michael@0: HTMLInputElement implements MozImageLoadingContent; michael@0: HTMLInputElement implements MozPhonetic;