dom/webidl/HTMLInputElement.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/HTMLInputElement.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,193 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * http://www.whatwg.org/specs/web-apps/current-work/#the-input-element
    1.11 + * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
    1.12 + *
    1.13 + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
    1.14 + * Opera Software ASA. You are granted a license to use, reproduce
    1.15 + * and create derivative works of this document.
    1.16 + */
    1.17 +
    1.18 +enum SelectionMode {
    1.19 +  "select",
    1.20 +  "start",
    1.21 +  "end",
    1.22 +  "preserve",
    1.23 +};
    1.24 +
    1.25 +interface nsIControllers;
    1.26 +
    1.27 +interface HTMLInputElement : HTMLElement {
    1.28 +  [Pure, SetterThrows]
    1.29 +           attribute DOMString accept;
    1.30 +  [Pure, SetterThrows]
    1.31 +           attribute DOMString alt;
    1.32 +  [Pure, SetterThrows]
    1.33 +           attribute DOMString autocomplete;
    1.34 +  [Pure, SetterThrows]
    1.35 +           attribute boolean autofocus;
    1.36 +  [Pure, SetterThrows]
    1.37 +           attribute boolean defaultChecked;
    1.38 +  [Pure]
    1.39 +           attribute boolean checked;
    1.40 +           // Bug 850337 - attribute DOMString dirName;
    1.41 +  [Pure, SetterThrows]
    1.42 +           attribute boolean disabled;
    1.43 +  readonly attribute HTMLFormElement? form;
    1.44 +  [Pure]
    1.45 +  readonly attribute FileList? files;
    1.46 +  [Throws, Pref="dom.input.dirpicker"]
    1.47 +  void openDirectoryPicker();
    1.48 +  [Pure, SetterThrows]
    1.49 +           attribute DOMString formAction;
    1.50 +  [Pure, SetterThrows]
    1.51 +           attribute DOMString formEnctype;
    1.52 +  [Pure, SetterThrows]
    1.53 +           attribute DOMString formMethod;
    1.54 +  [Pure, SetterThrows]
    1.55 +           attribute boolean formNoValidate;
    1.56 +  [Pure, SetterThrows]
    1.57 +           attribute DOMString formTarget;
    1.58 +  [Pure, SetterThrows]
    1.59 +           attribute unsigned long height;
    1.60 +  [Pure]
    1.61 +           attribute boolean indeterminate;
    1.62 +  [Pure, SetterThrows, Pref="dom.forms.inputmode"]
    1.63 +           attribute DOMString inputMode;
    1.64 +  [Pure]
    1.65 +  readonly attribute HTMLElement? list;
    1.66 +  [Pure, SetterThrows]
    1.67 +           attribute DOMString max;
    1.68 +  [Pure, SetterThrows]
    1.69 +           attribute long maxLength;
    1.70 +  [Pure, SetterThrows]
    1.71 +           attribute DOMString min;
    1.72 +  [Pure, SetterThrows]
    1.73 +           attribute boolean multiple;
    1.74 +  [Pure, SetterThrows]
    1.75 +           attribute DOMString name;
    1.76 +  [Pure, SetterThrows]
    1.77 +           attribute DOMString pattern;
    1.78 +  [Pure, SetterThrows]
    1.79 +           attribute DOMString placeholder;
    1.80 +  [Pure, SetterThrows]
    1.81 +           attribute boolean readOnly;
    1.82 +  [Pure, SetterThrows]
    1.83 +           attribute boolean required;
    1.84 +  [Pure, SetterThrows]
    1.85 +           attribute unsigned long size;
    1.86 +  [Pure, SetterThrows]
    1.87 +           attribute DOMString src;
    1.88 +  [Pure, SetterThrows]
    1.89 +           attribute DOMString step;
    1.90 +  [Pure, SetterThrows]
    1.91 +           attribute DOMString type;
    1.92 +  [Pure, SetterThrows]
    1.93 +           attribute DOMString defaultValue;
    1.94 +  [Pure, TreatNullAs=EmptyString, SetterThrows]
    1.95 +           attribute DOMString value;
    1.96 +  [Throws, Pref="dom.experimental_forms"]
    1.97 +           attribute Date? valueAsDate;
    1.98 +  [Pure, SetterThrows]
    1.99 +           attribute unrestricted double valueAsNumber;
   1.100 +           attribute unsigned long width;
   1.101 +
   1.102 +  [Throws]
   1.103 +  void stepUp(optional long n = 1);
   1.104 +  [Throws]
   1.105 +  void stepDown(optional long n = 1);
   1.106 +
   1.107 +  [Pure]
   1.108 +  readonly attribute boolean willValidate;
   1.109 +  [Pure]
   1.110 +  readonly attribute ValidityState validity;
   1.111 +  [GetterThrows]
   1.112 +  readonly attribute DOMString validationMessage;
   1.113 +  boolean checkValidity();
   1.114 +  void setCustomValidity(DOMString error);
   1.115 +
   1.116 +  // Bug 850365 readonly attribute NodeList labels;
   1.117 +
   1.118 +  void select();
   1.119 +
   1.120 +  [Throws]
   1.121 +           // TODO: unsigned vs signed
   1.122 +           attribute long selectionStart;
   1.123 +  [Throws]
   1.124 +           attribute long selectionEnd;
   1.125 +  [Throws]
   1.126 +           attribute DOMString selectionDirection;
   1.127 +  [Throws]
   1.128 +  void setRangeText(DOMString replacement);
   1.129 +  [Throws]
   1.130 +  void setRangeText(DOMString replacement, unsigned long start,
   1.131 +    unsigned long end, optional SelectionMode selectionMode = "preserve");
   1.132 +
   1.133 +  // also has obsolete members
   1.134 +};
   1.135 +
   1.136 +partial interface HTMLInputElement {
   1.137 +  [Pure, SetterThrows]
   1.138 +           attribute DOMString align;
   1.139 +  [Pure, SetterThrows]
   1.140 +           attribute DOMString useMap;
   1.141 +};
   1.142 +
   1.143 +// Mozilla extensions
   1.144 +
   1.145 +partial interface HTMLInputElement {
   1.146 +  [Throws]
   1.147 +  void setSelectionRange(long start, long end, optional DOMString direction);
   1.148 +
   1.149 +  [GetterThrows, ChromeOnly]
   1.150 +  readonly attribute nsIControllers        controllers;
   1.151 +  [GetterThrows]
   1.152 +  readonly attribute long                  textLength;
   1.153 +
   1.154 +  [ChromeOnly]
   1.155 +  sequence<DOMString> mozGetFileNameArray();
   1.156 +
   1.157 +  [ChromeOnly]
   1.158 +  void mozSetFileNameArray(sequence<DOMString> fileNames);
   1.159 +
   1.160 +  // Number controls (<input type=number>) have an anonymous text control
   1.161 +  // (<input type=text>) in the anonymous shadow tree that they contain. On
   1.162 +  // such an anonymous text control this property provides access to the
   1.163 +  // number control that owns the text control. This is useful, for example,
   1.164 +  // in code that looks at the currently focused element to make decisions
   1.165 +  // about which IME to bring up. Such code needs to be able to check for any
   1.166 +  // owning number control since it probably wants to bring up a number pad
   1.167 +  // instead of the standard keyboard, even when the anonymous text control has
   1.168 +  // focus.
   1.169 +  [ChromeOnly]
   1.170 +  readonly attribute HTMLInputElement? ownerNumberControl;
   1.171 +
   1.172 +  boolean mozIsTextField(boolean aExcludePassword);
   1.173 +};
   1.174 +
   1.175 +partial interface HTMLInputElement {
   1.176 +  // Mirrored chrome-only nsIDOMNSEditableElement methods.  Please make sure
   1.177 +  // to update this list if nsIDOMNSEditableElement changes.
   1.178 +
   1.179 +  [Pure, ChromeOnly]
   1.180 +  readonly attribute nsIEditor? editor;
   1.181 +
   1.182 +  // This is similar to set .value on nsIDOMInput/TextAreaElements, but handling
   1.183 +  // of the value change is closer to the normal user input, so 'change' event
   1.184 +  // for example will be dispatched when focusing out the element.
   1.185 +  [ChromeOnly]
   1.186 +  void setUserInput(DOMString input);
   1.187 +};
   1.188 +
   1.189 +[NoInterfaceObject]
   1.190 +interface MozPhonetic {
   1.191 +  [Pure, ChromeOnly]
   1.192 +  readonly attribute DOMString phonetic;
   1.193 +};
   1.194 +
   1.195 +HTMLInputElement implements MozImageLoadingContent;
   1.196 +HTMLInputElement implements MozPhonetic;

mercurial