Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * http://www.whatwg.org/specs/web-apps/current-work/#the-textarea-element |
michael@0 | 8 | * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis |
michael@0 | 9 | * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and |
michael@0 | 10 | * Opera Software ASA. You are granted a license to use, reproduce |
michael@0 | 11 | * and create derivative works of this document. |
michael@0 | 12 | */ |
michael@0 | 13 | |
michael@0 | 14 | interface nsIEditor; |
michael@0 | 15 | interface MozControllers; |
michael@0 | 16 | |
michael@0 | 17 | interface HTMLTextAreaElement : HTMLElement { |
michael@0 | 18 | // attribute DOMString autocomplete; |
michael@0 | 19 | [SetterThrows, Pure] |
michael@0 | 20 | attribute boolean autofocus; |
michael@0 | 21 | [SetterThrows, Pure] |
michael@0 | 22 | attribute unsigned long cols; |
michael@0 | 23 | // attribute DOMString dirName; |
michael@0 | 24 | [SetterThrows, Pure] |
michael@0 | 25 | attribute boolean disabled; |
michael@0 | 26 | [Pure] |
michael@0 | 27 | readonly attribute HTMLFormElement? form; |
michael@0 | 28 | // attribute DOMString inputMode; |
michael@0 | 29 | [SetterThrows, Pure] |
michael@0 | 30 | attribute long maxLength; |
michael@0 | 31 | [SetterThrows, Pure] |
michael@0 | 32 | attribute DOMString name; |
michael@0 | 33 | [SetterThrows, Pure] |
michael@0 | 34 | attribute DOMString placeholder; |
michael@0 | 35 | [SetterThrows, Pure] |
michael@0 | 36 | attribute boolean readOnly; |
michael@0 | 37 | [SetterThrows, Pure] |
michael@0 | 38 | attribute boolean required; |
michael@0 | 39 | [SetterThrows, Pure] |
michael@0 | 40 | attribute unsigned long rows; |
michael@0 | 41 | [SetterThrows, Pure] |
michael@0 | 42 | attribute DOMString wrap; |
michael@0 | 43 | |
michael@0 | 44 | [Constant] |
michael@0 | 45 | readonly attribute DOMString type; |
michael@0 | 46 | [SetterThrows, Pure] |
michael@0 | 47 | attribute DOMString defaultValue; |
michael@0 | 48 | [TreatNullAs=EmptyString] attribute DOMString value; |
michael@0 | 49 | readonly attribute unsigned long textLength; |
michael@0 | 50 | |
michael@0 | 51 | readonly attribute boolean willValidate; |
michael@0 | 52 | readonly attribute ValidityState validity; |
michael@0 | 53 | readonly attribute DOMString validationMessage; |
michael@0 | 54 | boolean checkValidity(); |
michael@0 | 55 | void setCustomValidity(DOMString error); |
michael@0 | 56 | |
michael@0 | 57 | // readonly attribute NodeList labels; |
michael@0 | 58 | |
michael@0 | 59 | void select(); |
michael@0 | 60 | [Throws] |
michael@0 | 61 | attribute unsigned long selectionStart; |
michael@0 | 62 | [Throws] |
michael@0 | 63 | attribute unsigned long selectionEnd; |
michael@0 | 64 | [Throws] |
michael@0 | 65 | attribute DOMString selectionDirection; |
michael@0 | 66 | [Throws] |
michael@0 | 67 | void setRangeText(DOMString replacement); |
michael@0 | 68 | [Throws] |
michael@0 | 69 | void setRangeText(DOMString replacement, unsigned long start, |
michael@0 | 70 | unsigned long end, optional SelectionMode selectionMode = "preserve"); |
michael@0 | 71 | [Throws] |
michael@0 | 72 | void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction); |
michael@0 | 73 | }; |
michael@0 | 74 | |
michael@0 | 75 | partial interface HTMLTextAreaElement { |
michael@0 | 76 | // Mirrored chrome-only Mozilla extensions to nsIDOMHTMLTextAreaElement. |
michael@0 | 77 | // Please make sure to update this list of nsIDOMHTMLTextAreaElement changes. |
michael@0 | 78 | |
michael@0 | 79 | [Throws, ChromeOnly] |
michael@0 | 80 | readonly attribute MozControllers controllers; |
michael@0 | 81 | }; |
michael@0 | 82 | |
michael@0 | 83 | partial interface HTMLTextAreaElement { |
michael@0 | 84 | // Mirrored chrome-only nsIDOMNSEditableElement methods. Please make sure |
michael@0 | 85 | // to update this list if nsIDOMNSEditableElement changes. |
michael@0 | 86 | |
michael@0 | 87 | [ChromeOnly] |
michael@0 | 88 | readonly attribute nsIEditor? editor; |
michael@0 | 89 | |
michael@0 | 90 | // This is similar to set .value on nsIDOMInput/TextAreaElements, but |
michael@0 | 91 | // handling of the value change is closer to the normal user input, so |
michael@0 | 92 | // 'change' event for example will be dispatched when focusing out the |
michael@0 | 93 | // element. |
michael@0 | 94 | [ChromeOnly] |
michael@0 | 95 | void setUserInput(DOMString input); |
michael@0 | 96 | }; |