Use a 1-byte enum class for TextDirection
[WebKit-https.git] / Source / WebCore / dom / Element.idl
index 7a60a3b..7df36ec 100644 (file)
@@ -20,6 +20,7 @@
 
 [
     CustomToJSObject,
+    DOMJIT,
     JSCustomHeader,
     JSGenerateToNativeObject,
     ExportMacro=WEBCORE_EXPORT,
@@ -43,6 +44,7 @@
     [CEReactions, MayThrowException] void setAttributeNS(DOMString? namespaceURI, DOMString qualifiedName, DOMString value);
     [CEReactions] void removeAttribute(DOMString qualifiedName);
     [CEReactions] void removeAttributeNS(DOMString? namespaceURI, DOMString localName);
+    [CEReactions, MayThrowException] boolean toggleAttribute(DOMString qualifiedName, optional boolean force);
     boolean hasAttribute(DOMString qualifiedName);
     boolean hasAttributeNS(DOMString? namespaceURI, DOMString localName);
 
     [MayThrowException] void insertAdjacentText(DOMString where, DOMString data); // Historical.
 
     // CSSOM-view extensions (https://drafts.csswg.org/cssom-view/#extension-to-the-element-interface).
-    sequence<DOMRect> getClientRects();
+    DOMRectList getClientRects();
     [NewObject] DOMRect getBoundingClientRect();
-    void scrollIntoView(optional boolean alignWithTop = true); // FIXME: Parameter type should be (boolean or object).
+    void scrollIntoView(optional boolean alignWithTop = true); // FIXME(webkit.org/b/161611): 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.
+    attribute long scrollTop; // FIXME(webkit.org/b/188045): should be unrestricted double.
+    attribute long scrollLeft; // FIXME(webkit.org/b/188045): should be unrestricted double.
     readonly attribute long scrollWidth;
     readonly attribute long scrollHeight;
     readonly attribute double clientTop; // FIXME: Should be of type long.
 
     // 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] attribute [TreatNullAs=EmptyString] DOMString innerHTML;
+    [CEReactions] attribute [TreatNullAs=EmptyString] DOMString outerHTML;
     [CEReactions, MayThrowException] void insertAdjacentHTML(DOMString position, DOMString text);
 
     // 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.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen, ImplementedAs=webkitRequestFullscreen] void webkitRequestFullScreen(); // Prefixed Mozilla version.
+    [Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] void webkitRequestFullscreen(); // Prefixed W3C version.
 
     // Extensions from Pointer Lock API (https://w3c.github.io/pointerlock/#extensions-to-the-element-interface).
     [Conditional=POINTER_LOCK] void requestPointerLock();
 
-    // 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();
-
     // Non standard API (https://www.w3.org/Bugs/Public/show_bug.cgi?id=17152).
     void scrollIntoViewIfNeeded(optional boolean centerIfNeeded = true);
 
     [NotEnumerable, ImplementedAs=onwebkitTransitionEnd] attribute EventHandler onwebkittransitionend;
 
     // 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;
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenchange;
+    [NotEnumerable, Conditional=FULLSCREEN_API, EnabledBySetting=FullScreen] attribute EventHandler onwebkitfullscreenerror;
 
     // FIXME: Cannot find those EventHandlers in the latest specification (https://w3c.github.io/uievents/#events-focus-types).
     [NotEnumerable] attribute EventHandler onfocusin;
     [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;
+    [NotEnumerable, Conditional=LEGACY_ENCRYPTED_MEDIA, EnabledAtRuntime=LegacyEncryptedMediaAPI] 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/1629580-onwebkitplaybacktargetavailabili).
     [NotEnumerable, Conditional=WIRELESS_PLAYBACK_TARGET] attribute EventHandler onwebkitplaybacktargetavailabilitychanged;
+
+    // Accessibility events.
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessiblecontextmenu;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessibleclick;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessibledecrement;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessibledismiss;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessiblefocus;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessibleincrement;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessiblescrollintoview;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessiblesetvalue;
+    [EnabledAtRuntime=AccessibilityObjectModel] attribute EventHandler onaccessibleselect;
 };
 
 dictionary ShadowRootInit {
     required ShadowRootMode mode;
 };
 
+Element implements AccessibilityRole;
+Element implements AriaAttributes;
 Element implements Animatable;
 Element implements ChildNode;
 Element implements DocumentAndElementEventHandlers;