1/*
2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB.  If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 */
21
22interface HTMLInputElement : HTMLElement {
23    [Reflect] attribute DOMString accept;
24    [Reflect] attribute DOMString align;
25    [Reflect] attribute DOMString alt;
26    [Reflect] attribute DOMString autocomplete;
27    [Reflect] attribute boolean autofocus;
28    [Reflect=checked] attribute boolean defaultChecked;
29    attribute boolean checked;
30    [Reflect] attribute DOMString dirName;
31    [Reflect] attribute boolean disabled;
32    [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
33    // The 'files' attribute is intentionally not readonly.
34    // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
35    attribute FileList files;
36    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString formAction;
37    [CustomElementCallbacks] attribute DOMString formEnctype;
38    [CustomElementCallbacks] attribute DOMString formMethod;
39    [Reflect] attribute boolean formNoValidate;
40    [Reflect] attribute DOMString formTarget;
41    [CustomElementCallbacks] attribute unsigned long height;
42    attribute boolean indeterminate;
43    [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
44    [RuntimeEnabled=DataListElement] readonly attribute HTMLElement list;
45    [Reflect] attribute DOMString max;
46    [RaisesException=Setter, CustomElementCallbacks] attribute long maxLength;
47    [Reflect] attribute DOMString min;
48    [Reflect] attribute boolean multiple;
49    [Reflect] attribute DOMString name;
50    [Reflect] attribute DOMString pattern;
51    [Reflect] attribute DOMString placeholder;
52    [Reflect] attribute boolean readOnly;
53    [Reflect] attribute boolean required;
54    [RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size; // Changed string -> long -> unsigned long
55    [Reflect, URL, PerWorldBindings, ActivityLogging=SetterForIsolatedWorlds] attribute DOMString src;
56    [Reflect] attribute DOMString step;
57    [CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
58    [CustomElementCallbacks] attribute DOMString defaultValue;
59    [Reflect] attribute DOMString useMap;
60    // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
61    [TreatNullAs=NullString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
62    [RaisesException=Setter, CustomElementCallbacks] attribute Date valueAsDate;
63    [RaisesException=Setter, CustomElementCallbacks] attribute double valueAsNumber;
64
65    [RaisesException, CustomElementCallbacks] void stepUp(optional long n);
66    [RaisesException, CustomElementCallbacks] void stepDown(optional long n);
67
68    [CustomElementCallbacks] attribute unsigned long width;
69    readonly attribute boolean willValidate;
70    readonly attribute ValidityState validity;
71    readonly attribute DOMString validationMessage;
72    boolean checkValidity();
73    void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
74
75    readonly attribute NodeList labels;
76
77    void select();
78    [RaisesException, ImplementedAs=selectionStartForBinding] attribute long selectionStart;
79    [RaisesException, ImplementedAs=selectionEndForBinding] attribute long selectionEnd;
80    [RaisesException, ImplementedAs=selectionDirectionForBinding] attribute DOMString selectionDirection;
81
82    [RaisesException] void setRangeText(DOMString replacement);
83    [RaisesException] void setRangeText(DOMString replacement,
84                        unsigned long start,
85                        unsigned long end,
86                        [Default=NullString] optional DOMString selectionMode);
87
88    [RaisesException, ImplementedAs=setSelectionRangeForBinding]
89    void setSelectionRange([Default=Undefined] optional long start,
90                           [Default=Undefined] optional long end,
91                           optional DOMString direction);
92
93    // Non-standard attributes
94    [Reflect, RuntimeEnabled=DirectoryUpload] attribute boolean webkitdirectory;
95    [Reflect] attribute boolean incremental;
96    [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitSpeech;
97    [Conditional=INPUT_SPEECH, Reflect, RuntimeEnabled=SpeechInput] attribute boolean webkitGrammar;
98    [Conditional=INPUT_SPEECH] attribute EventHandler onwebkitspeechchange;
99
100    // See http://www.w3.org/TR/html-media-capture/
101    [Conditional=MEDIA_CAPTURE, Reflect] attribute boolean capture;
102};
103