Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLInputElement.idl
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
22 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#htmlinputelement
23
24 interface HTMLInputElement : HTMLElement {
25     [Reflect] attribute DOMString accept;
26     [Reflect] attribute DOMString align;
27     [Reflect] attribute DOMString alt;
28     [Reflect] attribute DOMString autocomplete;
29     [Reflect] attribute boolean autofocus;
30     [Reflect=checked] attribute boolean defaultChecked;
31     attribute boolean checked;
32     [Reflect] attribute DOMString dirName;
33     [Reflect] attribute boolean disabled;
34     [ImplementedAs=formOwner] readonly attribute HTMLFormElement form;
35     // The 'files' attribute is intentionally not readonly.
36     // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
37     attribute FileList files;
38     [Reflect, URL] attribute DOMString formAction;
39     [CustomElementCallbacks] attribute DOMString formEnctype;
40     [CustomElementCallbacks] attribute DOMString formMethod;
41     [Reflect] attribute boolean formNoValidate;
42     [Reflect] attribute DOMString formTarget;
43     [CustomElementCallbacks] attribute unsigned long height;
44     attribute boolean indeterminate;
45     [RuntimeEnabled=InputModeAttribute, Reflect] attribute DOMString inputMode;
46     readonly attribute HTMLElement list;
47     [Reflect] attribute DOMString max;
48     [RaisesException=Setter, CustomElementCallbacks] attribute long maxLength;
49     [Reflect] attribute DOMString min;
50     [Reflect] attribute boolean multiple;
51     [Reflect] attribute DOMString name;
52     [Reflect] attribute DOMString pattern;
53     [Reflect] attribute DOMString placeholder;
54     [Reflect] attribute boolean readOnly;
55     [Reflect] attribute boolean required;
56     [RaisesException=Setter, CustomElementCallbacks] attribute unsigned long size; // Changed string -> long -> unsigned long
57     [Reflect, URL] attribute DOMString src;
58     [Reflect] attribute DOMString step;
59     [CustomElementCallbacks] attribute DOMString type; // readonly dropped as part of DOM level 2
60     [Reflect=value, CustomElementCallbacks] attribute DOMString defaultValue;
61     [Reflect] attribute DOMString useMap;
62     // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085
63     [TreatNullAs=EmptyString, RaisesException=Setter, CustomElementCallbacks] attribute DOMString value;
64     [RaisesException=Setter, CustomElementCallbacks] attribute Date? valueAsDate;
65     [RaisesException=Setter, CustomElementCallbacks] attribute unrestricted double valueAsNumber;
66
67     [RaisesException, CustomElementCallbacks] void stepUp(optional long n);
68     [RaisesException, CustomElementCallbacks] void stepDown(optional long n);
69
70     [CustomElementCallbacks] attribute unsigned long width;
71     readonly attribute boolean willValidate;
72     readonly attribute ValidityState validity;
73     readonly attribute DOMString validationMessage;
74     boolean checkValidity();
75     void setCustomValidity([TreatUndefinedAs=NullString] DOMString? error);
76
77     readonly attribute NodeList labels;
78
79     void select();
80     [RaisesException, ImplementedAs=selectionStartForBinding] attribute long selectionStart;
81     [RaisesException, ImplementedAs=selectionEndForBinding] attribute long selectionEnd;
82     [RaisesException, ImplementedAs=selectionDirectionForBinding] attribute DOMString selectionDirection;
83
84     [RaisesException] void setRangeText(DOMString replacement);
85     [RaisesException] void setRangeText(DOMString replacement,
86                         unsigned long start,
87                         unsigned long end,
88                         optional DOMString selectionMode = null);
89
90     [RaisesException, ImplementedAs=setSelectionRangeForBinding]
91     void setSelectionRange([Default=Undefined] optional long start,
92                            [Default=Undefined] optional long end,
93                            optional DOMString direction);
94
95     // Non-standard attributes
96     [Reflect, MeasureAs=PrefixedDirectoryAttribute] attribute boolean webkitdirectory;
97     [Reflect, MeasureAs=IncrementalAttribute] attribute boolean incremental;
98
99     // See http://www.w3.org/TR/html-media-capture/
100     [RuntimeEnabled=MediaCapture, Reflect] attribute boolean capture;
101 };