OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
21 // https://dom.spec.whatwg.org/#interface-element | 21 // https://dom.spec.whatwg.org/#interface-element |
22 | 22 |
23 [ | 23 [ |
24 TypeChecking=Unrestricted, | 24 TypeChecking=Unrestricted, |
25 ] interface Element : Node { | 25 ] interface Element : Node { |
26 readonly attribute DOMString? namespaceURI; | 26 readonly attribute DOMString? namespaceURI; |
27 readonly attribute DOMString? prefix; | 27 readonly attribute DOMString? prefix; |
28 // FIXME: localName/tagName should not be nullable. | |
28 readonly attribute DOMString? localName; | 29 readonly attribute DOMString? localName; |
29 readonly attribute DOMString? tagName; | 30 readonly attribute DOMString? tagName; |
30 | 31 |
31 [Reflect, ExposeJSAccessors] attribute DOMString id; | 32 [Reflect, ExposeJSAccessors] attribute DOMString id; |
32 [Reflect=class] attribute DOMString className; | 33 [Reflect=class] attribute DOMString className; |
33 [PerWorldBindings] readonly attribute DOMTokenList classList; | 34 [PerWorldBindings] readonly attribute DOMTokenList classList; |
34 | 35 |
35 [MeasureAs=HasAttributes] boolean hasAttributes(); | 36 [MeasureAs=HasAttributes] boolean hasAttributes(); |
36 [PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute N amedNodeMap attributes; | 37 [PerWorldBindings, ImplementedAs=attributesForBindings] readonly attribute N amedNodeMap attributes; |
37 DOMString? getAttribute(DOMString name); | 38 DOMString? getAttribute(DOMString name); |
38 DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName); | 39 DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName); |
39 [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name, DOMString value); | 40 [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name, DOMString value); |
40 [RaisesException, CustomElementCallbacks] void setAttributeNS(DOMString? nam espaceURI, DOMString qualifiedName, DOMString value); | 41 [RaisesException, CustomElementCallbacks] void setAttributeNS(DOMString? nam espaceURI, DOMString name, DOMString value); |
41 [CustomElementCallbacks] void removeAttribute(DOMString name); | 42 [CustomElementCallbacks] void removeAttribute(DOMString name); |
42 [CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOM String localName); | 43 [CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOM String localName); |
43 boolean hasAttribute(DOMString name); | 44 boolean hasAttribute(DOMString name); |
44 boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName); | 45 boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName); |
45 | 46 |
46 [MeasureAs=ElementGetAttributeNode] Attr getAttributeNode(DOMString name); | 47 [MeasureAs=ElementGetAttributeNode] Attr? getAttributeNode(DOMString name); |
47 [MeasureAs=ElementGetAttributeNodeNS] Attr getAttributeNodeNS(DOMString? nam espaceURI, DOMString localName); | 48 [MeasureAs=ElementGetAttributeNodeNS] Attr? getAttributeNodeNS(DOMString? na mespaceURI, DOMString localName); |
48 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr setAttributeNode(Attr newAttr); | 49 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNode] Attr? setAttributeNode(Attr attr); |
49 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNodeN S] Attr setAttributeNodeNS(Attr newAttr); | 50 [RaisesException, CustomElementCallbacks, MeasureAs=ElementSetAttributeNodeN S] Attr? setAttributeNodeNS(Attr attr); |
50 [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNo de] Attr removeAttributeNode(Attr oldAttr); | 51 [RaisesException, CustomElementCallbacks, MeasureAs=ElementRemoveAttributeNo de] Attr removeAttributeNode(Attr attr); |
51 | 52 |
52 [RaisesException] Element closest(DOMString selectors); | 53 [RaisesException] Element? closest(DOMString selectors); |
53 [RaisesException] boolean matches(DOMString selectors); | 54 [RaisesException] boolean matches(DOMString selectors); |
54 | 55 |
55 HTMLCollection getElementsByTagName(DOMString name); | 56 HTMLCollection getElementsByTagName(DOMString localName); |
56 HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString loc alName); | 57 HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString loc alName); |
57 HTMLCollection getElementsByClassName(DOMString classNames); | 58 HTMLCollection getElementsByClassName(DOMString classNames); |
58 | 59 |
59 // DOM Parsing and Serialization | 60 // DOM Parsing and Serialization |
60 // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-th e-element-interface | 61 // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-th e-element-interface |
61 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, Exp oseJSAccessors] attribute DOMString innerHTML; | 62 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter, Exp oseJSAccessors] attribute DOMString innerHTML; |
62 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att ribute DOMString outerHTML; | 63 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att ribute DOMString outerHTML; |
63 [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString where, DOMString html); | 64 [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void insertAdjacentHTML(DOMString position, DOMString text); |
64 | 65 |
65 // Shadow DOM | 66 // Shadow DOM |
66 // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-int erface | 67 // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-int erface |
67 [RaisesException, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadow Root(); | 68 [RaisesException, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadow Root(); |
68 NodeList getDestinationInsertionPoints(); | 69 NodeList getDestinationInsertionPoints(); |
69 [PerWorldBindings] readonly attribute ShadowRoot shadowRoot; | 70 [PerWorldBindings] readonly attribute ShadowRoot? shadowRoot; |
70 | 71 |
71 // Pointer Lock | 72 // Pointer Lock |
72 // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions -to-the-element-interface | 73 // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions -to-the-element-interface |
73 [MeasureAs=ElementRequestPointerLock] void requestPointerLock(); | 74 [MeasureAs=ElementRequestPointerLock] void requestPointerLock(); |
74 | 75 |
75 // CSSOM View Module | 76 // CSSOM View Module |
76 // http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface | 77 // http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface |
78 // FIXME: getClientRect() and getBoundingClientRect() should | |
79 // return DOMRectList and DOMRect respectively. | |
77 ClientRectList getClientRects(); | 80 ClientRectList getClientRects(); |
78 ClientRect getBoundingClientRect(); | 81 ClientRect getBoundingClientRect(); |
82 // FIXME: scrollIntoView() should have a ScrollIntoViewOptions dictionary ar gument. | |
haraken
2015/03/01 08:58:35
+bashi, FYI.
| |
79 void scrollIntoView(optional boolean alignWithTop); | 83 void scrollIntoView(optional boolean alignWithTop); |
80 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(optio nal ScrollToOptions scrollToOptions); | 84 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(optio nal ScrollToOptions options); |
81 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(unres tricted double x, unrestricted double y); | 85 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(unres tricted double x, unrestricted double y); |
82 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions sc rollToOptions); | 86 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions op tions); |
83 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(unrestricted double x, unre stricted double y); | 87 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(unrestricted double x, unre stricted double y); |
84 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions sc rollToOptions); | 88 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions op tions); |
85 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(unrestricted double x, unre stricted double y); | 89 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(unrestricted double x, unre stricted double y); |
86 attribute unrestricted double scrollTop; | 90 attribute unrestricted double scrollTop; |
87 attribute unrestricted double scrollLeft; | 91 attribute unrestricted double scrollLeft; |
88 readonly attribute long scrollWidth; | 92 readonly attribute long scrollWidth; |
89 readonly attribute long scrollHeight; | 93 readonly attribute long scrollHeight; |
90 readonly attribute long clientTop; | 94 readonly attribute long clientTop; |
91 readonly attribute long clientLeft; | 95 readonly attribute long clientLeft; |
92 readonly attribute long clientWidth; | 96 readonly attribute long clientWidth; |
93 readonly attribute long clientHeight; | 97 readonly attribute long clientHeight; |
94 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interfa ce | 98 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interfa ce |
95 // FIXME: offset* should be on HTMLElement. | 99 // FIXME: offset* should be on HTMLElement. |
96 [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute Element offsetParent; | 100 [ImplementedAs=offsetParentForBindings, PerWorldBindings] readonly attribute Element? offsetParent; |
97 readonly attribute long offsetTop; | 101 readonly attribute long offsetTop; |
98 readonly attribute long offsetLeft; | 102 readonly attribute long offsetLeft; |
99 readonly attribute long offsetWidth; | 103 readonly attribute long offsetWidth; |
100 readonly attribute long offsetHeight; | 104 readonly attribute long offsetHeight; |
101 | 105 |
102 // CSS Object Model (CSSOM) | 106 // CSS Object Model (CSSOM) |
103 // http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface | 107 // http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface |
104 // FIXME: style should be on HTMLElement and SVGElement. | 108 // FIXME: style should be on HTMLElement and SVGElement. |
109 // FIXME: style should have [PutForwards=cssText]. | |
105 [PerWorldBindings] readonly attribute CSSStyleDeclaration style; | 110 [PerWorldBindings] readonly attribute CSSStyleDeclaration style; |
106 | 111 |
107 // HTML | 112 // HTML |
108 // https://html.spec.whatwg.org/#htmlelement | 113 // https://html.spec.whatwg.org/#htmlelement |
109 // FIXME: dataset, focus() and blur() should be on HTMLElement. | 114 // FIXME: dataset, focus() and blur() should be on HTMLElement. |
110 [PerWorldBindings] readonly attribute DOMStringMap dataset; | 115 [PerWorldBindings] readonly attribute DOMStringMap dataset; |
111 void focus(); | 116 void focus(); |
112 void blur(); | 117 void blur(); |
113 | 118 |
114 // Non-standard APIs | 119 // Non-standard APIs |
(...skipping 22 matching lines...) Expand all Loading... | |
137 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | 142 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; |
138 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | 143 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; |
139 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | 144 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; |
140 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | 145 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; |
141 attribute EventHandler onwheel; | 146 attribute EventHandler onwheel; |
142 }; | 147 }; |
143 | 148 |
144 Element implements ParentNode; | 149 Element implements ParentNode; |
145 Element implements ChildNode; | 150 Element implements ChildNode; |
146 Element implements NonDocumentTypeChildNode; | 151 Element implements NonDocumentTypeChildNode; |
OLD | NEW |