chromium/third_party/blink/renderer/core/html/forms/html_input_element.idl

/*
 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
 * Copyright (C) 2006 Samuel Weinig <[email protected]>
 * 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;
    [ImplementedAs=checkedForBinding] 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;
    [ImplementedAs=listForBinding] 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, ImplementedAs=valueForBinding, RaisesException=Setter] attribute [LegacyNullToEmptyString] 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;

    // https://html.spec.whatwg.org/multipage/input.html#dom-input-showpicker
    [Measure, RaisesException] void showPicker();

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

HTMLInputElement includes PopoverInvokerElement;
HTMLInputElement includes InvokerElement;
HTMLInputElement includes InterestInvokerElement;