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 // See |
| 22 // https://docs.google.com/document/d/1VnvAqeWFG9JFZfgG5evBqrLGDZYRE5w6G5jEDORek
PY |
| 23 // for details. |
| 24 enum NativeScrollBehavior { "disable-native-scroll", "perform-before-native-scro
ll", "perform-after-native-scroll" }; |
| 25 |
21 // https://dom.spec.whatwg.org/#interface-element | 26 // https://dom.spec.whatwg.org/#interface-element |
22 | 27 |
23 [ | 28 interface Element : Node { |
24 TypeChecking=Interface, | |
25 ] interface Element : Node { | |
26 readonly attribute DOMString? namespaceURI; | 29 readonly attribute DOMString? namespaceURI; |
27 readonly attribute DOMString? prefix; | 30 readonly attribute DOMString? prefix; |
28 readonly attribute DOMString localName; | 31 readonly attribute DOMString localName; |
29 readonly attribute DOMString tagName; | 32 readonly attribute DOMString tagName; |
30 | 33 |
31 [Reflect] attribute DOMString id; | 34 [Reflect] attribute DOMString id; |
32 [Reflect=class] attribute DOMString className; | 35 [Reflect=class] attribute DOMString className; |
33 [SameObject, PerWorldBindings] readonly attribute DOMTokenList classList; | 36 [SameObject, PerWorldBindings, PutForwards=value] readonly attribute DOMToke
nList classList; |
34 | 37 |
35 [MeasureAs=HasAttributes] boolean hasAttributes(); | 38 [MeasureAs=HasAttributes] boolean hasAttributes(); |
36 [SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly
attribute NamedNodeMap attributes; | 39 [SameObject, PerWorldBindings, ImplementedAs=attributesForBindings] readonly
attribute NamedNodeMap attributes; |
37 DOMString? getAttribute(DOMString name); | 40 DOMString? getAttribute(DOMString name); |
38 DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName); | 41 DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName); |
39 [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name,
DOMString value); | 42 [RaisesException, CustomElementCallbacks] void setAttribute(DOMString name,
DOMString value); |
40 [RaisesException, CustomElementCallbacks] void setAttributeNS(DOMString? nam
espaceURI, DOMString name, DOMString value); | 43 [RaisesException, CustomElementCallbacks] void setAttributeNS(DOMString? nam
espaceURI, DOMString name, DOMString value); |
41 [CustomElementCallbacks] void removeAttribute(DOMString name); | 44 [CustomElementCallbacks] void removeAttribute(DOMString name); |
42 [CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOM
String localName); | 45 [CustomElementCallbacks] void removeAttributeNS(DOMString? namespaceURI, DOM
String localName); |
43 boolean hasAttribute(DOMString name); | 46 boolean hasAttribute(DOMString name); |
(...skipping 14 matching lines...) Expand all Loading... |
58 | 61 |
59 // DOM Parsing and Serialization | 62 // DOM Parsing and Serialization |
60 // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-th
e-element-interface | 63 // https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#extensions-to-th
e-element-interface |
61 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString innerHTML; | 64 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString innerHTML; |
62 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString outerHTML; | 65 [TreatNullAs=NullString, CustomElementCallbacks, RaisesException=Setter] att
ribute DOMString outerHTML; |
63 [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void
insertAdjacentHTML(DOMString position, DOMString text); | 66 [CustomElementCallbacks, RaisesException, MeasureAs=InsertAdjacentHTML] void
insertAdjacentHTML(DOMString position, DOMString text); |
64 | 67 |
65 // Shadow DOM | 68 // Shadow DOM |
66 // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-int
erface | 69 // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-int
erface |
67 [RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] S
hadowRoot createShadowRoot(); | 70 [RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] S
hadowRoot createShadowRoot(); |
68 [RuntimeEnabled=CreateShadowRootWithParameter, RaisesException, CallWith=Scr
iptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot(ShadowR
ootInit shadowRootInitDict); | 71 [RuntimeEnabled=ShadowDOMV1, RaisesException, CallWith=ScriptState, MeasureA
s=ElementAttachShadow] ShadowRoot attachShadow(ShadowRootInit shadowRootInitDict
); |
69 NodeList getDestinationInsertionPoints(); | 72 NodeList getDestinationInsertionPoints(); |
70 [PerWorldBindings] readonly attribute ShadowRoot? shadowRoot; | 73 [PerWorldBindings, ImplementedAs=openShadowRoot] readonly attribute ShadowRo
ot? shadowRoot; |
| 74 [RuntimeEnabled=ShadowDOMV1, Reflect] attribute DOMString slot; |
| 75 [RuntimeEnabled=ShadowDOMV1, ImplementedAs=assignedSlotForBinding] readonly
attribute HTMLSlotElement assignedSlot; |
71 | 76 |
72 // Pointer Lock | 77 // Pointer Lock |
73 // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions
-to-the-element-interface | 78 // https://dvcs.w3.org/hg/pointerlock/raw-file/default/index.html#extensions
-to-the-element-interface |
74 [MeasureAs=ElementRequestPointerLock] void requestPointerLock(); | 79 [MeasureAs=ElementRequestPointerLock] void requestPointerLock(); |
75 | 80 |
76 // CSSOM View Module | 81 // CSSOM View Module |
77 // http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface | 82 // http://dev.w3.org/csswg/cssom-view/#extension-to-the-element-interface |
78 // FIXME: getClientRect() and getBoundingClientRect() should | 83 // FIXME: getClientRect() and getBoundingClientRect() should |
79 // return DOMRectList and DOMRect respectively. | 84 // return DOMRectList and DOMRect respectively. |
80 ClientRectList getClientRects(); | 85 ClientRectList getClientRects(); |
81 ClientRect getBoundingClientRect(); | 86 ClientRect getBoundingClientRect(); |
82 // FIXME: scrollIntoView() should have a ScrollIntoViewOptions dictionary ar
gument. | 87 // FIXME: scrollIntoView() should have a ScrollIntoViewOptions dictionary ar
gument. |
83 void scrollIntoView(optional boolean alignWithTop); | 88 void scrollIntoView(optional boolean alignWithTop); |
84 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(optio
nal ScrollToOptions options); | 89 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(optio
nal ScrollToOptions options); |
85 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(unres
tricted double x, unrestricted double y); | 90 [RuntimeEnabled=CSSOMSmoothScroll, ImplementedAs=scrollTo] void scroll(unres
tricted double x, unrestricted double y); |
86 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions op
tions); | 91 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(optional ScrollToOptions op
tions); |
87 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(unrestricted double x, unre
stricted double y); | 92 [RuntimeEnabled=CSSOMSmoothScroll] void scrollTo(unrestricted double x, unre
stricted double y); |
88 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions op
tions); | 93 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(optional ScrollToOptions op
tions); |
89 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(unrestricted double x, unre
stricted double y); | 94 [RuntimeEnabled=CSSOMSmoothScroll] void scrollBy(unrestricted double x, unre
stricted double y); |
90 attribute unrestricted double scrollTop; | 95 attribute unrestricted double scrollTop; |
91 attribute unrestricted double scrollLeft; | 96 attribute unrestricted double scrollLeft; |
92 readonly attribute long scrollWidth; | 97 readonly attribute long scrollWidth; |
93 readonly attribute long scrollHeight; | 98 readonly attribute long scrollHeight; |
94 readonly attribute long clientTop; | 99 readonly attribute long clientTop; |
95 readonly attribute long clientLeft; | 100 readonly attribute long clientLeft; |
96 readonly attribute long clientWidth; | 101 readonly attribute long clientWidth; |
97 readonly attribute long clientHeight; | 102 readonly attribute long clientHeight; |
98 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-htmlelement-interfa
ce | 103 |
99 // FIXME: offset* should only be on HTMLElement. | 104 // Scroll Customization API. See crbug.com/410974 for details. |
100 [MeasureAs=ElementOffsetParent, PerWorldBindings] readonly attribute Element
? offsetParent; | 105 [RuntimeEnabled=ScrollCustomization] void setApplyScroll(ScrollStateCallback
scrollStateCallback, NativeScrollBehavior nativeScrollBehavior); |
101 [MeasureAs=ElementOffsetTop] readonly attribute long offsetTop; | 106 [RuntimeEnabled=ScrollCustomization] void setDistributeScroll(ScrollStateCal
lback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior); |
102 [MeasureAs=ElementOffsetLeft] readonly attribute long offsetLeft; | |
103 [MeasureAs=ElementOffsetWidth] readonly attribute long offsetWidth; | |
104 [MeasureAs=ElementOffsetHeight] readonly attribute long offsetHeight; | |
105 | 107 |
106 // Non-standard APIs | 108 // Non-standard APIs |
107 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19962 | 109 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19962 |
108 [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] E
lement insertAdjacentElement(DOMString where, Element element); | 110 [RaisesException, CustomElementCallbacks, MeasureAs=InsertAdjacentElement] E
lement insertAdjacentElement(DOMString where, Element element); |
109 [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMS
tring where, DOMString text); | 111 [RaisesException, MeasureAs=InsertAdjacentText] void insertAdjacentText(DOMS
tring where, DOMString text); |
110 [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(option
al boolean centerIfNeeded); | 112 [MeasureAs=ElementScrollIntoViewIfNeeded] void scrollIntoViewIfNeeded(option
al boolean centerIfNeeded); |
111 [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSel
ector] boolean webkitMatchesSelector(DOMString selectors); | 113 [RaisesException, ImplementedAs=matches, MeasureAs=ElementPrefixedMatchesSel
ector] boolean webkitMatchesSelector(DOMString selectors); |
112 | 114 |
113 // Experimental accessibility API | 115 // Experimental accessibility API |
114 [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? com
putedRole; | 116 [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? com
putedRole; |
115 [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? com
putedName; | 117 [RuntimeEnabled=ComputedAccessibilityInfo] readonly attribute DOMString? com
putedName; |
116 | 118 |
117 // Event handler attributes | 119 // Event handler attributes |
118 attribute EventHandler onbeforecopy; | 120 attribute EventHandler onbeforecopy; |
119 attribute EventHandler onbeforecut; | 121 attribute EventHandler onbeforecut; |
120 attribute EventHandler onbeforepaste; | 122 attribute EventHandler onbeforepaste; |
121 attribute EventHandler oncopy; | 123 attribute EventHandler oncopy; |
122 attribute EventHandler oncut; | 124 attribute EventHandler oncut; |
123 attribute EventHandler onpaste; | 125 attribute EventHandler onpaste; |
124 attribute EventHandler onsearch; | 126 attribute EventHandler onsearch; |
125 attribute EventHandler onselectstart; | 127 attribute EventHandler onselectstart; |
126 [RuntimeEnabled=Touch] attribute EventHandler ontouchcancel; | |
127 [RuntimeEnabled=Touch] attribute EventHandler ontouchend; | |
128 [RuntimeEnabled=Touch] attribute EventHandler ontouchmove; | |
129 [RuntimeEnabled=Touch] attribute EventHandler ontouchstart; | |
130 attribute EventHandler onwheel; | 128 attribute EventHandler onwheel; |
131 }; | 129 }; |
132 | 130 |
133 Element implements ParentNode; | 131 Element implements ParentNode; |
134 Element implements ChildNode; | 132 Element implements ChildNode; |
135 Element implements NonDocumentTypeChildNode; | 133 Element implements NonDocumentTypeChildNode; |
OLD | NEW |