summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/html/forms/html_input_element.idl
blob: 1fdc1e13bde55e8ab5dc3df8316fe6975bc28c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

// https://html.spec.whatwg.org/multipage/input.html#htmlinputelement

enum SelectionMode { "select", "start", "end", "preserve" };

[
    Exposed=Window,
    HTMLConstructor,
    ActiveScriptWrappable
] interface HTMLInputElement : HTMLElement {
    [CEReactions, Reflect] attribute DOMString accept;
    [CEReactions, Reflect] attribute DOMString alt;
    [CEReactions, ImplementedAs=IDLExposedAutofillValue] attribute DOMString autocomplete;
    [CEReactions, Reflect=checked] attribute boolean defaultChecked;
    attribute boolean checked;
    [CEReactions, Reflect] attribute DOMString dirName;
    [CEReactions, Reflect] attribute boolean disabled;
    [ImplementedAs=formOwner] readonly attribute HTMLFormElement? form;
    // The 'files' attribute is intentionally not readonly.
    // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22682
    attribute FileList? files;
    [CEReactions] attribute DOMString formAction;
    [CEReactions] attribute DOMString formEnctype;
    [CEReactions] attribute DOMString formMethod;
    [CEReactions, Reflect] attribute boolean formNoValidate;
    [CEReactions, Reflect] attribute DOMString formTarget;
    [CEReactions] attribute unsigned long height;
    attribute boolean indeterminate;
    readonly attribute HTMLElement? list;
    [CEReactions, Reflect] attribute DOMString max;
    [CEReactions, RaisesException=Setter] attribute long maxLength;
    [CEReactions, Reflect] attribute DOMString min;
    [CEReactions, RaisesException=Setter] attribute long minLength;
    [CEReactions, Reflect] attribute boolean multiple;
    [CEReactions, Reflect] attribute DOMString name;
    [CEReactions, Reflect] attribute DOMString pattern;
    [CEReactions, Reflect] attribute DOMString placeholder;
    [CEReactions, Reflect] attribute boolean readOnly;
    [CEReactions, Reflect] attribute boolean required;
    [CEReactions, RaisesException=Setter] attribute unsigned long size;
    [CEReactions, Reflect, URL] attribute DOMString src;
    [CEReactions, Reflect] attribute DOMString step;
    [CEReactions] attribute DOMString type;
    [CEReactions, Reflect=value] attribute DOMString defaultValue;
    [CEReactions, RaisesException=Setter] attribute [TreatNullAs=EmptyString] DOMString value;
    [CEReactions, RaisesException=Setter, CallWith=ScriptState] attribute object? valueAsDate;
    [RaisesException=Setter] attribute unrestricted double valueAsNumber;
    // Note: The spec has valueLow and valueHigh for two-valued range controls.
    // https://www.w3.org/Bugs/Public/show_bug.cgi?id=13154
    [CEReactions] attribute unsigned long width;

    [RaisesException] void stepUp(optional long n = 1);
    [RaisesException] void stepDown(optional long n = 1);

    readonly attribute boolean willValidate;
    readonly attribute ValidityState validity;
    readonly attribute DOMString validationMessage;
    boolean checkValidity();
    boolean reportValidity();
    void setCustomValidity(DOMString error);

    readonly attribute NodeList labels;

    void select();
    [RaisesException, ImplementedAs=selectionStartForBinding] attribute unsigned long? selectionStart;
    [RaisesException, ImplementedAs=selectionEndForBinding] attribute unsigned long? selectionEnd;
    [RaisesException, ImplementedAs=selectionDirectionForBinding] attribute DOMString? selectionDirection;
    [RaisesException] void setRangeText(DOMString replacement);
    [RaisesException] void setRangeText(DOMString replacement,
                                        unsigned long start,
                                        unsigned long end,
                                        optional SelectionMode selectionMode = "preserve");
    [RaisesException, ImplementedAs=setSelectionRangeForBinding]
    void setSelectionRange(unsigned long start,
                           unsigned long end,
                           optional DOMString direction);

    // obsolete members
    // https://html.spec.whatwg.org/C/#HTMLInputElement-partial
    [CEReactions, Reflect] attribute DOMString align;
    [CEReactions, Reflect] attribute DOMString useMap;

    // HTML Media Capture
    // https://w3c.github.io/html-media-capture/#the-capture-attribute
    [Measure, RuntimeEnabled=MediaCapture, Reflect] attribute DOMString capture;

    // Non-standard APIs
    [Reflect, MeasureAs=PrefixedDirectoryAttribute] attribute boolean webkitdirectory;
    [Reflect, MeasureAs=IncrementalAttribute] attribute boolean incremental;
};