Modified: trunk/Source/WebCore/dom/Element.idl (216250 => 216251)
--- trunk/Source/WebCore/dom/Element.idl 2017-05-05 18:13:18 UTC (rev 216250)
+++ trunk/Source/WebCore/dom/Element.idl 2017-05-05 18:14:12 UTC (rev 216251)
@@ -24,120 +24,136 @@
JSGenerateToNativeObject,
ExportMacro=WEBCORE_EXPORT,
] interface Element : Node {
- readonly attribute DOMString? tagName;
+ readonly attribute DOMString? namespaceURI;
+ readonly attribute DOMString? prefix;
+ readonly attribute DOMString localName;
+ readonly attribute DOMString tagName;
- [DOMJIT=ReadDOM] DOMString? getAttribute(DOMString name);
+ [CEReactions, Reflect] attribute DOMString id;
+ [CEReactions, Reflect=class] attribute DOMString className;
+ [PutForwards=value] readonly attribute DOMTokenList classList; // FIXME: Should be [SameObject].
+ [CEReactions, EnabledAtRuntime=ShadowDOM, Reflect, Unscopable] attribute DOMString slot;
- [CEReactions, MayThrowException] void setAttribute(DOMString name, DOMString value);
-
- [CEReactions] void removeAttribute(DOMString name);
- [DOMJIT=ReadDOM] Attr? getAttributeNode(DOMString name);
-
- [CEReactions, MayThrowException] Attr? setAttributeNode(Attr newAttr);
- [CEReactions, MayThrowException] Attr removeAttributeNode(Attr oldAttr);
-
- [DOMJIT=ReadDOM] HTMLCollection getElementsByTagName(DOMString name);
-
- readonly attribute NamedNodeMap attributes;
[DOMJIT=ReadDOM] boolean hasAttributes();
-
+ readonly attribute NamedNodeMap attributes; // FIXME: Should be [SameObject].
+ sequence<DOMString> getAttributeNames();
+ [DOMJIT=ReadDOM] DOMString? getAttribute(DOMString qualifiedName);
DOMString? getAttributeNS(DOMString? namespaceURI, DOMString localName);
-
+ [CEReactions, MayThrowException] void setAttribute(DOMString qualifiedName, DOMString value);
[CEReactions, MayThrowException] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
+ [CEReactions] void removeAttribute(DOMString qualifiedName);
[CEReactions] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
+ boolean hasAttribute(DOMString qualifiedName);
+ boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
- HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
-
+ [DOMJIT=ReadDOM] Attr? getAttributeNode(DOMString qualifiedName);
Attr? getAttributeNodeNS(DOMString? namespaceURI, DOMString localName);
- [CEReactions, MayThrowException] Attr? setAttributeNodeNS(Attr newAttr);
- boolean hasAttribute(DOMString name);
+ [CEReactions, MayThrowException] Attr? setAttributeNode(Attr attr);
+ [CEReactions, MayThrowException] Attr? setAttributeNodeNS(Attr attr);
+ [CEReactions, MayThrowException] Attr removeAttributeNode(Attr attr);
- boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
+ [EnabledAtRuntime=ShadowDOM, MayThrowException] ShadowRoot attachShadow(ShadowRootInit init);
+ [EnabledAtRuntime=ShadowDOM, ImplementedAs=shadowRootForBindings, CallWith=ScriptState] readonly attribute ShadowRoot? shadowRoot;
- [ImplementedAs=cssomStyle] readonly attribute CSSStyleDeclaration style;
+ [MayThrowException] Element? closest(DOMString selectors);
+ [MayThrowException] boolean matches(DOMString selectors);
+ [ImplementedAs=matches, MayThrowException] boolean webkitMatchesSelector(DOMString selectors); // Historical alias of .matches.
- [CEReactions, Reflect] attribute DOMString id;
+ [DOMJIT=ReadDOM] HTMLCollection getElementsByTagName(DOMString qualifiedName);
+ HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
+ HTMLCollection getElementsByClassName(DOMString name);
- readonly attribute DOMString? namespaceURI;
- readonly attribute DOMString? prefix;
- readonly attribute DOMString localName;
+ [CEReactions, MayThrowException] Element? insertAdjacentElement(DOMString where, Element element); // Historical.
+ [MayThrowException] void insertAdjacentText(DOMString where, DOMString data); // Historical.
- readonly attribute double offsetLeft;
- readonly attribute double offsetTop;
- readonly attribute double offsetWidth;
- readonly attribute double offsetHeight;
- readonly attribute double clientLeft;
- readonly attribute double clientTop;
- readonly attribute double clientWidth;
- readonly attribute double clientHeight;
+ // FIXME: Should be in a separate ElementCSSInlineStyle and implemented by HTMLElement / SVGElement.
+ // https://drafts.csswg.org/cssom/#the-elementcssinlinestyle-interface
+ [ImplementedAs=cssomStyle] readonly attribute CSSStyleDeclaration style; // FIXME: Should be [SameObject, PutForwards=cssText].
- attribute long scrollLeft; // FIXME: should be unrestricted double
- attribute long scrollTop; // FIXME: should be unrestricted double
- readonly attribute long scrollWidth;
- readonly attribute long scrollHeight;
-
- [ImplementedAs=bindingsOffsetParent] readonly attribute Element offsetParent;
-
- void scrollIntoView(optional boolean alignWithTop = true);
-
- void scrollIntoViewIfNeeded(optional boolean centerIfNeeded = true);
-
+ // CSSOM-view extensions (https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface).
+ sequence<DOMRect> getClientRects();
+ [NewObject] DOMRect getBoundingClientRect();
+ void scrollIntoView(optional boolean alignWithTop = true); // FIXME: Parameter type should be (boolean or object).
[ImplementedAs=scrollTo] void scroll(optional ScrollToOptions options);
[ImplementedAs=scrollTo] void scroll(unrestricted double x, unrestricted double y);
-
void scrollTo(optional ScrollToOptions options);
void scrollTo(unrestricted double x, unrestricted double y);
-
void scrollBy(optional ScrollToOptions option);
void scrollBy(unrestricted double x, unrestricted double y);
+ attribute long scrollTop; // FIXME: should be unrestricted double.
+ attribute long scrollLeft; // FIXME: should be unrestricted double.
+ readonly attribute long scrollWidth;
+ readonly attribute long scrollHeight;
+ readonly attribute double clientTop; // FIXME: Should be of type long.
+ readonly attribute double clientLeft; // FIXME: Should be of type long.
+ readonly attribute double clientWidth; // FIXME: Should be of type long.
+ readonly attribute double clientHeight; // FIXME: Should be of type long.
- void scrollByLines(optional long lines = 0);
- void scrollByPages(optional long pages = 0);
+ // FIXME: These CSSOM-view extensions should be on HTMLElement, not Element.
+ // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface
+ [ImplementedAs=bindingsOffsetParent] readonly attribute Element? offsetParent;
+ readonly attribute double offsetTop; // FIXME: Should be of type long.
+ readonly attribute double offsetLeft; // FIXME: Should be of type long.
+ readonly attribute double offsetWidth; // FIXME: Should be of type long.
+ readonly attribute double offsetHeight; // FIXME: Should be of type long.
- sequence<DOMString> getAttributeNames();
-
- HTMLCollection getElementsByClassName(DOMString name);
+ // Extensions to Element from DOM Parsing and Serialization specification.
+ // https://w3c.github.io/DOM-Parsing/#extensions-to-the-element-interface
[CEReactions, SetterMayThrowException] attribute [TreatNullAs=EmptyString] DOMString innerHTML;
[CEReactions, SetterMayThrowException] attribute [TreatNullAs=EmptyString] DOMString outerHTML;
+ [CEReactions, MayThrowException] void insertAdjacentHTML(DOMString position, DOMString text);
- [CEReactions, Reflect=class] attribute DOMString className;
- [PutForwards=value] readonly attribute DOMTokenList classList;
+ // Extensions from Full Screen API (https://fullscreen.spec.whatwg.org/#api).
+ // FIXME: Should we add unprefixed versions?
+ [Conditional=FULLSCREEN_API, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen(); // Prefixed Mozilla version.
+ [Conditional=FULLSCREEN_API] void webkitRequestFullscreen(); // Prefixed W3C version.
- [MayThrowException] boolean matches(DOMString selectors);
- [MayThrowException] Element? closest(DOMString selectors);
- [ImplementedAs=matches, MayThrowException] boolean webkitMatchesSelector(DOMString selectors);
+ // Extensions from Pointer Lock API (https://w3c.github.io/pointerlock/#extensions-to-the-element-interface).
+ [Conditional=POINTER_LOCK] void requestPointerLock();
- // CSSOM View Module API
- sequence<DOMRect> getClientRects();
- [NewObject] DOMRect getBoundingClientRect();
+ // Extensions from CSS Regions API (https://drafts.csswg.org/css-regions/#the-region-interface).
+ // FIXME: Should be in a separate Region interface implemented by Element.
+ // FIXME: Should we add unprefixed versions?
+ [Conditional=CSS_REGIONS] readonly attribute DOMString webkitRegionOverset;
+ [Conditional=CSS_REGIONS] sequence<Range>? webkitGetRegionFlowRanges();
-#if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
- // Mozilla version
- [ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen();
+ // Non standard API (https://www.w3.org/Bugs/Public/show_bug.cgi?id=17152).
+ void scrollIntoViewIfNeeded(optional boolean centerIfNeeded = true);
- // W3C version
- void webkitRequestFullscreen();
-#endif
+ // FIXME: Non standard API already dropped by Blink (https://bugs.chromium.org/p/chromium/issues/detail?id=398356).
+ void scrollByLines(optional long lines = 0);
+ void scrollByPages(optional long pages = 0);
- [CEReactions, MayThrowException] Element? insertAdjacentElement(DOMString where, Element element);
- [CEReactions, MayThrowException] void insertAdjacentHTML(DOMString where, DOMString html);
- [MayThrowException] void insertAdjacentText(DOMString where, DOMString text);
+ // Event handler from Selection API (http://w3c.github.io/selection-api/#extensions-to-globaleventhandlers).
+ // FIXME: Should be moved to GlobalEventHandlers.
+ [NotEnumerable] attribute EventHandler onselectstart; // FIXME: Should be enumerable.
- [Conditional=POINTER_LOCK] void requestPointerLock();
+ // Event handlers from CSS Animations API.
+ // FIXME: Should be moved to GlobalEventHandlers.
+ // https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl
+ [NotEnumerable] attribute EventHandler onanimationend; // FIXME: Should be enumerable.
+ [NotEnumerable] attribute EventHandler onanimationiteration; // FIXME: Should be enumerable.
+ [NotEnumerable] attribute EventHandler onanimationstart; // FIXME: Should be enumerable.
+ // attribute EventHandler onanimationcancel;
+ [NotEnumerable, ImplementedAs=onwebkitAnimationIteration] attribute EventHandler onwebkitanimationiteration; // Non-standard.
+ [NotEnumerable, ImplementedAs=onwebkitAnimationStart] attribute EventHandler onwebkitanimationstart; // Non-standard.
+ [NotEnumerable, ImplementedAs=onwebkitTransitionEnd] attribute EventHandler onwebkittransitionend; // Non-standard.
- // CSS Regions API
- [Conditional=CSS_REGIONS] readonly attribute DOMString webkitRegionOverset;
- [Conditional=CSS_REGIONS] sequence<Range> webkitGetRegionFlowRanges();
+ // Event handlers from CSS Transitions API.
+ // FIXME: Should be moved to GlobalEventHandlers.
+ // https://drafts.csswg.org/css-transitions/#interface-globaleventhandlers-idl
+ [NotEnumerable] attribute EventHandler ontransitionend; // FIXME: Should be enumerable.
+ // attribute EventHandler ontransitionrun;
+ // attribute EventHandler ontransitionstart;
+ // attribute EventHandler ontransitioncancel;
+ [NotEnumerable, ImplementedAs=onwebkitAnimationEnd] attribute EventHandler onwebkitanimationend; // Non-standard.
- // Shadow DOM API
- [EnabledAtRuntime=ShadowDOM, MayThrowException] ShadowRoot attachShadow(ShadowRootInit init);
- [EnabledAtRuntime=ShadowDOM, ImplementedAs=shadowRootForBindings, CallWith=ScriptState] readonly attribute ShadowRoot shadowRoot;
- [CEReactions, EnabledAtRuntime=ShadowDOM, Reflect, Unscopable] attribute DOMString slot;
+ // Non-standard WebKit API (https://developer.apple.com/reference/webkitjs/gestureevent).
+ [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongesturechange;
+ [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongestureend;
+ [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongesturestart;
- // Event Handlers
-
- // Unique to Element and Document
- // FIXME: Should these be exposed on Window as well (and therefore moved to GlobalEventHandlers.idl)?
+ // Non standard event handlers.
[NotEnumerable] attribute EventHandler onbeforecopy;
[NotEnumerable] attribute EventHandler onbeforecut;
[NotEnumerable] attribute EventHandler onbeforeinput;
@@ -145,33 +161,28 @@
[NotEnumerable] attribute EventHandler oncopy;
[NotEnumerable] attribute EventHandler oncut;
[NotEnumerable] attribute EventHandler onpaste;
- [NotEnumerable] attribute EventHandler onselectstart;
+
+ // FIXME: These event handlers should only be on Document (https://fullscreen.spec.whatwg.org/#api).
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenchange;
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenerror;
- // Unique to Element and DOMWindow
- // FIXME: Should these be exposed on Document as well (and therefore moved to GlobalEventHandlers.idl)?
- [NotEnumerable] attribute EventHandler onanimationend;
- [NotEnumerable] attribute EventHandler onanimationiteration;
- [NotEnumerable] attribute EventHandler onanimationstart;
- [NotEnumerable] attribute EventHandler ontransitionend;
- [NotEnumerable, ImplementedAs=onwebkitAnimationEnd] attribute EventHandler onwebkitanimationend;
- [NotEnumerable, ImplementedAs=onwebkitAnimationIteration] attribute EventHandler onwebkitanimationiteration;
- [NotEnumerable, ImplementedAs=onwebkitAnimationStart] attribute EventHandler onwebkitanimationstart;
- [NotEnumerable, ImplementedAs=onwebkitTransitionEnd] attribute EventHandler onwebkittransitionend;
- [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongesturechange;
- [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongestureend;
- [NotEnumerable, Conditional=IOS_GESTURE_EVENTS] attribute EventHandler ongesturestart;
-
- // Unique to Element, HTMLBodyElement and HTMLFrameSetElement
+ // FIXME: Cannot find those EventHandlers in the latest specification (https://w3c.github.io/uievents/#events-focus-types).
[NotEnumerable] attribute EventHandler onfocusin;
[NotEnumerable] attribute EventHandler onfocusout;
- // Unique to Element
+ // Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1633146-onbeforeload).
[NotEnumerable] attribute EventHandler onbeforeload;
+
+ // Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1634205-onwebkitneedkey).
[NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA] attribute EventHandler onwebkitneedkey;
+
+ // Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1633943-onwebkitpresentationmodechanged).
[NotEnumerable, Conditional=VIDEO_PRESENTATION_MODE] attribute EventHandler onwebkitpresentationmodechanged;
+
+ // Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1630042-onwebkitcurrentplaybacktargetisw).
[NotEnumerable, Conditional=WIRELESS_PLAYBACK_TARGET] attribute EventHandler onwebkitcurrentplaybacktargetiswirelesschanged;
+
+ // Non standard event handler (https://developer.apple.com/reference/webkitjs/element/1629580-onwebkitplaybacktargetavailabili).
[NotEnumerable, Conditional=WIRELESS_PLAYBACK_TARGET] attribute EventHandler onwebkitplaybacktargetavailabilitychanged;
};