Element Traversal is not just Elements anymore
[WebKit-https.git] / Source / WebCore / dom / Document.idl
index 3c3b67b..951d6fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2011, 2015 Apple Inc. All rights reserved.
  * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
  *
  * This library is free software; you can redistribute it and/or
  * Boston, MA 02110-1301, USA.
  */
 
-module core {
-
-    interface [
-        CustomToJS,
-        GenerateNativeConverter,
-        InlineGetOwnPropertySlot
-    ] Document : Node {
-
-        // DOM Level 1 Core
-        readonly attribute DocumentType doctype;
-        readonly attribute DOMImplementation implementation;
-        readonly attribute Element documentElement;
-
-        [ReturnsNew] Element createElement(in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString tagName)
-            raises (DOMException);
-        DocumentFragment   createDocumentFragment();
-        [ReturnsNew] Text createTextNode(in [Optional=CallWithDefaultValue] DOMString data);
-        [ReturnsNew] Comment createComment(in [Optional=CallWithDefaultValue] DOMString data);
-        [ReturnsNew] CDATASection createCDATASection(in [Optional=CallWithDefaultValue] DOMString data)
-            raises(DOMException);
-        [OldStyleObjC, ReturnsNew] ProcessingInstruction createProcessingInstruction(in [Optional=CallWithDefaultValue] DOMString target,
-                                                                                     in [Optional=CallWithDefaultValue] DOMString data)
-            raises (DOMException);
-        [ReturnsNew] Attr createAttribute(in [Optional=CallWithDefaultValue] DOMString name)
-            raises (DOMException);
-        [ReturnsNew] EntityReference createEntityReference(in [Optional=CallWithDefaultValue] DOMString name)
-            raises(DOMException);
-        NodeList           getElementsByTagName(in [Optional=CallWithDefaultValue] DOMString tagname);
-
-        // Introduced in DOM Level 2:
-
-        [OldStyleObjC, ReturnsNew] Node importNode(in [Optional=CallWithDefaultValue] Node importedNode,
-                                                   in [Optional] boolean deep)
-            raises (DOMException);
-        [OldStyleObjC, ReturnsNew] Element createElementNS(in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString namespaceURI,
-                                                           in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString qualifiedName)
-            raises (DOMException);
-        [OldStyleObjC, ReturnsNew] Attr createAttributeNS(in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString namespaceURI,
-                                                          in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString qualifiedName)
-            raises (DOMException);
-        [OldStyleObjC] NodeList getElementsByTagNameNS(in [TreatNullAs=EmptyString,Optional=CallWithDefaultValue] DOMString namespaceURI,
-                                                       in [Optional=CallWithDefaultValue] DOMString localName);
-        Element            getElementById(in [Optional=CallWithDefaultValue] DOMString elementId);
-
-        // DOM Level 3 Core
-
-        readonly attribute [ConvertNullStringTo=Null] DOMString inputEncoding;
-
-        readonly attribute [ConvertNullStringTo=Null] DOMString xmlEncoding;
-                 attribute [ConvertNullStringTo=Null, TreatNullAs=EmptyString] DOMString xmlVersion
-                    setter raises (DOMException);
-                 attribute boolean xmlStandalone
-                    setter raises (DOMException);
-
-        Node               adoptNode(in [Optional=CallWithDefaultValue] Node source)
-            raises (DOMException);
-
-                 attribute [ConvertNullStringTo=Null, TreatNullAs=EmptyString] DOMString documentURI;
-
-        // DOM Level 2 Events (DocumentEvents interface)
-
-        Event              createEvent(in [Optional=CallWithDefaultValue] DOMString eventType)
-            raises(DOMException);
-
-        // DOM Level 2 Tranversal and Range (DocumentRange interface)
-
-        Range              createRange();
-
-        // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
-
-        [OldStyleObjC] NodeIterator createNodeIterator(in [Optional=CallWithDefaultValue] Node root,
-                                                       in [Optional=CallWithDefaultValue] unsigned long whatToShow,
-                                                       in [Optional=CallWithDefaultValue] NodeFilter filter,
-                                                       in [Optional=CallWithDefaultValue] boolean expandEntityReferences)
-            raises(DOMException);
-        [OldStyleObjC] TreeWalker createTreeWalker(in [Optional=CallWithDefaultValue] Node root,
-                                                   in [Optional=CallWithDefaultValue] unsigned long whatToShow,
-                                                   in [Optional=CallWithDefaultValue] NodeFilter filter,
-                                                   in [Optional=CallWithDefaultValue] boolean expandEntityReferences)
-            raises(DOMException);
-
-        // DOM Level 2 Abstract Views (DocumentView interface)
-
-        readonly attribute DOMWindow defaultView;
-
-        // DOM Level 2 Style (DocumentStyle interface)
-
-        readonly attribute StyleSheetList styleSheets;
-
-        // DOM Level 2 Style (DocumentCSS interface)
-
-        [OldStyleObjC] CSSStyleDeclaration getOverrideStyle(in [Optional=CallWithDefaultValue] Element element,
-                                                            in [Optional=CallWithDefaultValue] DOMString pseudoElement);
-
-        // DOM Level 3 XPath (XPathEvaluator interface)
-        [OldStyleObjC] XPathExpression createExpression(in [Optional=CallWithDefaultValue] DOMString expression,
-                                                        in [Optional=CallWithDefaultValue] XPathNSResolver resolver)
-            raises(DOMException);
-        XPathNSResolver    createNSResolver(in Node nodeResolver);
-        [OldStyleObjC, V8Custom] XPathResult evaluate(in [Optional=CallWithDefaultValue] DOMString expression,
-                                                      in [Optional=CallWithDefaultValue] Node contextNode,
-                                                      in [Optional=CallWithDefaultValue] XPathNSResolver resolver,
-                                                      in [Optional=CallWithDefaultValue] unsigned short type,
-                                                      in [Optional=CallWithDefaultValue] XPathResult inResult)
-            raises(DOMException);
-
-        // Common extensions
-
-        boolean            execCommand(in [Optional=CallWithDefaultValue] DOMString command,
-                                       in [Optional=CallWithDefaultValue] boolean userInterface,
-                                       in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString,Optional=CallWithDefaultValue] DOMString value);
+[
+    Constructor,
+    ConstructorCallWith=ScriptExecutionContext,
+    CustomToJSObject,
+    JSCustomHeader,
+    JSGenerateToNativeObject,
+] interface Document : Node {
+
+    // DOM Level 1 Core
+    readonly attribute DocumentType doctype;
+    readonly attribute DOMImplementation implementation;
+    readonly attribute Element documentElement;
+
+    [ReturnNewObject, RaisesException] Element createElement([TreatNullAs=NullString,Default=Undefined] optional DOMString tagName);
+    DocumentFragment   createDocumentFragment();
+    [ReturnNewObject] Text createTextNode([Default=Undefined] optional DOMString data);
+    [ReturnNewObject] Comment createComment([Default=Undefined] optional DOMString data);
+    [ReturnNewObject, RaisesException] CDATASection createCDATASection([Default=Undefined] optional DOMString data);
+    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] ProcessingInstruction createProcessingInstruction([Default=Undefined] optional DOMString target,
+                                                                                 [Default=Undefined] optional DOMString data);
+    [ReturnNewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);
+    [ReturnNewObject, RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
+    NodeList getElementsByTagName([Default=Undefined] optional DOMString tagname);
+
+    // Introduced in DOM Level 2:
+
+    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Node importNode([Default=Undefined] optional Node importedNode,
+                    optional boolean deep);
+    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Element createElementNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+                            [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
+    [ObjCLegacyUnnamedParameters, ReturnNewObject, RaisesException] Attr createAttributeNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+                                                                          [TreatNullAs=NullString,Default=Undefined] optional DOMString qualifiedName);
+    [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS([TreatNullAs=NullString,Default=Undefined] optional DOMString namespaceURI,
+                                                   [Default=Undefined] optional DOMString localName);
+    Element getElementById([Default=Undefined,ObjCExplicitAtomicString,RequiresExistingAtomicString] optional DOMString elementId);
+
+    // DOM Level 3 Core
+
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString inputEncoding;
+
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString xmlEncoding;
+    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlVersion;
+    [SetterRaisesException] attribute boolean xmlStandalone;
+
+    [RaisesException] Node               adoptNode([Default=Undefined] optional Node source);
+
+#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
+    // document.documentURI was writable in DOM3 Core, but is read-only in DOM4
+    // (see http://www.w3.org/TR/2011/WD-dom-20110915/#document). We need to keep
+    // the writable version around for Objective C clients, but are moving to
+    // read-only for other clients.
+             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString documentURI;
+#else
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI;
+#endif
+
+    // DOM Level 2 Events (DocumentEvents interface)
+
+    [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);
+
+    // DOM Level 2 Tranversal and Range (DocumentRange interface)
+
+    Range              createRange();
+
+    // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
+
+    [ObjCLegacyUnnamedParameters, RaisesException] NodeIterator createNodeIterator([Default=Undefined] optional Node root,
+                                                   [Default=Undefined] optional unsigned long whatToShow,
+                                                   [Default=Undefined] optional NodeFilter filter,
+                                                   [Default=Undefined] optional boolean expandEntityReferences);
+    [ObjCLegacyUnnamedParameters, RaisesException] TreeWalker createTreeWalker([Default=Undefined] optional Node root,
+                                               [Default=Undefined] optional unsigned long whatToShow,
+                                               [Default=Undefined] optional NodeFilter filter,
+                                               [Default=Undefined] optional boolean expandEntityReferences);
+
+    // DOM Level 2 Abstract Views (DocumentView interface)
+
+    readonly attribute DOMWindow defaultView;
+
+    // DOM Level 2 Style (DocumentStyle interface)
+
+    readonly attribute StyleSheetList styleSheets;
+
+    // DOM Level 2 Style (DocumentCSS interface)
+
+    [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
+                                                        [Default=Undefined] optional DOMString pseudoElement);
+
+    readonly attribute DOMString contentType;
+
+    // DOM Level 3 XPath (XPathEvaluator interface)
+    [ObjCLegacyUnnamedParameters, RaisesException] XPathExpression createExpression([Default=Undefined] optional DOMString expression,
+                                                    [Default=Undefined] optional XPathNSResolver resolver);
+    XPathNSResolver    createNSResolver(Node nodeResolver);
+    [ObjCLegacyUnnamedParameters, RaisesException] XPathResult evaluate([Default=Undefined] optional DOMString expression,
+                                                  [Default=Undefined] optional Node contextNode,
+                                                  [Default=Undefined] optional XPathNSResolver resolver,
+                                                  [Default=Undefined] optional unsigned short type,
+                                                  [Default=Undefined] optional XPathResult inResult);
+
+    // Common extensions
+    boolean            execCommand([Default=Undefined] optional DOMString command,
+                                   [Default=Undefined] optional boolean userInterface,
+                                   [TreatNullAs=NullString, TreatUndefinedAs=NullString, Default=Undefined] optional DOMString value);
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-        // FIXME: remove the these two versions once [Optional] is implemented for Objective-C.
-        boolean            execCommand(in DOMString command,
-                                       in boolean userInterface);
-        boolean            execCommand(in DOMString command);
+    // FIXME: remove the these two versions once optional is implemented for Objective-C.
+    boolean            execCommand(DOMString command,
+                                   boolean userInterface);
+    boolean            execCommand(DOMString command);
 #endif
 
-        boolean            queryCommandEnabled(in [Optional=CallWithDefaultValue] DOMString command);
-        boolean            queryCommandIndeterm(in [Optional=CallWithDefaultValue] DOMString command);
-        boolean            queryCommandState(in [Optional=CallWithDefaultValue] DOMString command);
-        boolean            queryCommandSupported(in [Optional=CallWithDefaultValue] DOMString command);
-        [ConvertNullStringTo=False] DOMString queryCommandValue(in [Optional=CallWithDefaultValue] DOMString command);
+    boolean            queryCommandEnabled([Default=Undefined] optional DOMString command);
+    boolean            queryCommandIndeterm([Default=Undefined] optional DOMString command);
+    boolean            queryCommandState([Default=Undefined] optional DOMString command);
+    boolean            queryCommandSupported([Default=Undefined] optional DOMString command);
+    DOMString          queryCommandValue([Default=Undefined] optional DOMString command);
 
-        // Moved down from HTMLDocument
+    // Moved down from HTMLDocument
 
-                 attribute [TreatNullAs=EmptyString] DOMString title;
-        readonly attribute DOMString referrer;
+             [TreatNullAs=NullString] attribute DOMString title;
+    readonly attribute DOMString referrer;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-                 attribute [TreatNullAs=EmptyString] DOMString domain
-                     setter raises (DOMException);
+    [TreatNullAs=NullString, SetterRaisesException] attribute DOMString domain;
 #else
-        readonly attribute DOMString domain;
+    readonly attribute DOMString domain;
 #endif
-        readonly attribute DOMString URL;
+    readonly attribute DOMString URL;
 
-                 attribute [TreatNullAs=EmptyString] DOMString cookie
-                     setter raises (DOMException),
-                     getter raises (DOMException);
+    [TreatNullAs=NullString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;
 
-        // FIXME: the DOM spec does NOT have this attribute
-        // raising an exception.
-                 attribute HTMLElement body
-                     setter raises (DOMException);
+    [SetterRaisesException, ImplementedAs=bodyOrFrameset] attribute HTMLElement body;
 
-        readonly attribute HTMLHeadElement head;
-        readonly attribute HTMLCollection images;
-        readonly attribute HTMLCollection applets;
-        readonly attribute HTMLCollection links;
-        readonly attribute HTMLCollection forms;
-        readonly attribute HTMLCollection anchors;
-        readonly attribute DOMString lastModified;
+    readonly attribute HTMLHeadElement head;
+    readonly attribute HTMLCollection images;
+    readonly attribute HTMLCollection applets;
+    readonly attribute HTMLCollection links;
+    readonly attribute HTMLCollection forms;
+    readonly attribute HTMLCollection anchors;
+    readonly attribute DOMString lastModified;
 
-        NodeList getElementsByName(in [Optional=CallWithDefaultValue] DOMString elementName);
-
-#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
-        NodeList getItems(in [TreatNullAs=EmptyString, TreatUndefinedAs=EmptyString, Optional=CallWithDefaultValue] DOMString typeNames);
-#endif
+    NodeList getElementsByName([Default=Undefined,AtomicString] optional DOMString elementName);
 
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-                 attribute [Custom] Location location;
+             [Custom] attribute Location location;
 #endif
 
-        // IE extensions
+    // IE extensions
 
-                 attribute [ConvertNullStringTo=Undefined, TreatNullAs=EmptyString] DOMString charset;
-        readonly attribute [ConvertNullStringTo=Undefined] DOMString defaultCharset;
-        readonly attribute [ConvertNullStringTo=Undefined] DOMString readyState;
+             [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] attribute DOMString charset;
+    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString defaultCharset;
+    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString readyState;
 
-        Element            elementFromPoint(in [Optional=CallWithDefaultValue] long x, 
-                                            in [Optional=CallWithDefaultValue] long y);
-        Range              caretRangeFromPoint(in [Optional=CallWithDefaultValue] long x, 
-                                               in [Optional=CallWithDefaultValue] long y);
+    Element            elementFromPoint([Default=Undefined] optional long x, 
+                                        [Default=Undefined] optional long y);
+    Range              caretRangeFromPoint([Default=Undefined] optional long x, 
+                                           [Default=Undefined] optional long y);
 
-        // Mozilla extensions
+    // Mozilla extensions
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-        DOMSelection       getSelection();
+    DOMSelection       getSelection();
 #endif
-        readonly attribute [ConvertNullStringTo=Null] DOMString characterSet;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet;
 
-        // WebKit extensions
+    // WebKit extensions
 
-        readonly attribute [ConvertNullStringTo=Null] DOMString preferredStylesheetSet;
-                 attribute [ConvertNullStringTo=Null, TreatNullAs=EmptyString] DOMString selectedStylesheetSet;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
+             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;
 
 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
-        CSSStyleDeclaration createCSSStyleDeclaration();
+    CSSStyleDeclaration createCSSStyleDeclaration();
 #endif
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-        // DOM Level 2 Style Interface
-        [OldStyleObjC, UsesView] CSSStyleDeclaration getComputedStyle(in Element element,
-                                                                      in DOMString pseudoElement);
-
-        // WebKit extension
-        // FIXME: remove the first version once [Optional] is implemented for Objective-C.
-        [UsesView] CSSRuleList getMatchedCSSRules(in Element element,
-                                                  in DOMString pseudoElement);
-        [UsesView] CSSRuleList getMatchedCSSRules(in Element element,
-                                                  in DOMString pseudoElement,
-                                                  in [Optional] boolean authorOnly);
-                                                  
+    // DOM Level 2 Style Interface
+    [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(Element element,
+                                                                  DOMString pseudoElement);
+
+    // WebKit extension
+    // FIXME: remove the first version once optional is implemented for Objective-C.
+    [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,
+                                              DOMString pseudoElement);
+    [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(Element element,
+                                              DOMString pseudoElement,
+                                              optional boolean authorOnly);
+                                              
 #endif
 
-#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
-        [V8Custom] DOMObject getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
-#endif
+    CanvasRenderingContext getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
 #endif
 
-        // HTML 5
-        NodeList getElementsByClassName(in [Optional=CallWithDefaultValue] DOMString tagname);
+    // HTML 5
+    NodeList getElementsByClassName([Default=Undefined] optional DOMString classNames);
+
+    readonly attribute Element activeElement;
+    boolean hasFocus();
 
-        readonly attribute DOMString compatMode;
+    readonly attribute DOMString compatMode;
 
-        // NodeSelector - Selector API
-        Element querySelector(in DOMString selectors)
-            raises(DOMException);
-        NodeList querySelectorAll(in DOMString selectors)
-            raises(DOMException);
+    // NodeSelector - Selector API
+    [RaisesException] Element querySelector(DOMString selectors);
+    [RaisesException] NodeList querySelectorAll(DOMString selectors);
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
-        readonly attribute [EnabledAtRuntime] boolean webkitIsFullScreen;
-        readonly attribute [EnabledAtRuntime] boolean webkitFullScreenKeyboardInputAllowed;
-        readonly attribute [EnabledAtRuntime] Element webkitCurrentFullScreenElement;
-        [EnabledAtRuntime] void webkitCancelFullScreen();
+    // Mozilla version
+    readonly attribute boolean webkitIsFullScreen;
+    readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
+    readonly attribute Element webkitCurrentFullScreenElement;
+    void webkitCancelFullScreen();
+
+    // W3C version
+    readonly attribute boolean webkitFullscreenEnabled;
+    readonly attribute Element webkitFullscreenElement;
+    void webkitExitFullscreen();
 #endif
 
-        WebKitNamedFlow webkitGetFlowByName(in DOMString name);
+    [Conditional=POINTER_LOCK] void exitPointerLock();
+    [Conditional=POINTER_LOCK] readonly attribute Element pointerLockElement;
 
-#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
-        // Event handler DOM attributes
-        attribute [DontEnum] EventListener onabort;
-        attribute [DontEnum] EventListener onblur;
-        attribute [DontEnum] EventListener onchange;
-        attribute [DontEnum] EventListener onclick;
-        attribute [DontEnum] EventListener oncontextmenu;
-        attribute [DontEnum] EventListener ondblclick;
-        attribute [DontEnum] EventListener ondrag;
-        attribute [DontEnum] EventListener ondragend;
-        attribute [DontEnum] EventListener ondragenter;
-        attribute [DontEnum] EventListener ondragleave;
-        attribute [DontEnum] EventListener ondragover;
-        attribute [DontEnum] EventListener ondragstart;
-        attribute [DontEnum] EventListener ondrop;
-        attribute [DontEnum] EventListener onerror;
-        attribute [DontEnum] EventListener onfocus;
-        attribute [DontEnum] EventListener oninput;
-        attribute [DontEnum] EventListener oninvalid;
-        attribute [DontEnum] EventListener onkeydown;
-        attribute [DontEnum] EventListener onkeypress;
-        attribute [DontEnum] EventListener onkeyup;
-        attribute [DontEnum] EventListener onload;
-        attribute [DontEnum] EventListener onmousedown;
-        attribute [DontEnum] EventListener onmousemove;
-        attribute [DontEnum] EventListener onmouseout;
-        attribute [DontEnum] EventListener onmouseover;
-        attribute [DontEnum] EventListener onmouseup;
-        attribute [DontEnum] EventListener onmousewheel;
-        attribute [DontEnum] EventListener onreadystatechange;
-        attribute [DontEnum] EventListener onscroll;
-        attribute [DontEnum] EventListener onselect;
-        attribute [DontEnum] EventListener onsubmit;
-
-        // attribute [DontEnum] EventListener oncanplay;
-        // attribute [DontEnum] EventListener oncanplaythrough;
-        // attribute [DontEnum] EventListener ondurationchange;
-        // attribute [DontEnum] EventListener onemptied;
-        // attribute [DontEnum] EventListener onended;
-        // attribute [DontEnum] EventListener onloadeddata;
-        // attribute [DontEnum] EventListener onloadedmetadata;
-        // attribute [DontEnum] EventListener onloadstart;
-        // attribute [DontEnum] EventListener onpause;
-        // attribute [DontEnum] EventListener onplay;
-        // attribute [DontEnum] EventListener onplaying;
-        // attribute [DontEnum] EventListener onprogress;
-        // attribute [DontEnum] EventListener onratechange;
-        // attribute [DontEnum] EventListener onseeked;
-        // attribute [DontEnum] EventListener onseeking;
-        // attribute [DontEnum] EventListener onshow;
-        // attribute [DontEnum] EventListener onstalled;
-        // attribute [DontEnum] EventListener onsuspend;
-        // attribute [DontEnum] EventListener ontimeupdate;
-        // attribute [DontEnum] EventListener onvolumechange;
-        // attribute [DontEnum] EventListener onwaiting;
-
-        // WebKit extensions
-        attribute [DontEnum] EventListener onbeforecut;
-        attribute [DontEnum] EventListener oncut;
-        attribute [DontEnum] EventListener onbeforecopy;
-        attribute [DontEnum] EventListener oncopy;
-        attribute [DontEnum] EventListener onbeforepaste;
-        attribute [DontEnum] EventListener onpaste;
-        attribute [DontEnum] EventListener onreset;
-        attribute [DontEnum] EventListener onsearch;
-        attribute [DontEnum] EventListener onselectstart;
-        attribute [DontEnum] EventListener onselectionchange;
-        attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart;
-        attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove;
-        attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
-        attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
-        attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange;
-        attribute [DontEnum, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenerror;
-#endif
+    [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
 
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        [ReturnsNew, EnabledAtRuntime] Touch createTouch(in [Optional=CallWithDefaultValue] DOMWindow window,
-                                                         in [Optional=CallWithDefaultValue] EventTarget target,
-                                                         in [Optional=CallWithDefaultValue] long identifier,
-                                                         in [Optional=CallWithDefaultValue] long pageX,
-                                                         in [Optional=CallWithDefaultValue] long pageY,
-                                                         in [Optional=CallWithDefaultValue] long screenX,
-                                                         in [Optional=CallWithDefaultValue] long screenY,
-                                                         in [Optional=CallWithDefaultValue] long webkitRadiusX,
-                                                         in [Optional=CallWithDefaultValue] long webkitRadiusY,
-                                                         in [Optional=CallWithDefaultValue] float webkitRotationAngle,
-                                                         in [Optional=CallWithDefaultValue] float webkitForce)
-            raises (DOMException);
-        [ReturnsNew, EnabledAtRuntime, Custom] TouchList createTouchList()
-            raises (DOMException);
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+    [Conditional=FONT_LOAD_EVENTS] readonly attribute FontLoader fonts;
 #endif
 
-#if defined(LANGUAGE_CPP) && LANGUAGE_CPP
-        // Extra WebCore methods exposed to allow compile-time casting in C++
-        boolean isHTMLDocument();
+    [NotEnumerable] attribute EventHandler onabort;
+    [NotEnumerable] attribute EventHandler onbeforecopy;
+    [NotEnumerable] attribute EventHandler onbeforecut;
+    [NotEnumerable] attribute EventHandler onbeforepaste;
+    [NotEnumerable] attribute EventHandler onblur;
+    [NotEnumerable] attribute EventHandler onchange;
+    [NotEnumerable] attribute EventHandler onclick;
+    [NotEnumerable] attribute EventHandler oncontextmenu;
+    [NotEnumerable] attribute EventHandler oncopy;
+    [NotEnumerable] attribute EventHandler oncut;
+    [NotEnumerable] attribute EventHandler ondblclick;
+    [NotEnumerable] attribute EventHandler ondrag;
+    [NotEnumerable] attribute EventHandler ondragend;
+    [NotEnumerable] attribute EventHandler ondragenter;
+    [NotEnumerable] attribute EventHandler ondragleave;
+    [NotEnumerable] attribute EventHandler ondragover;
+    [NotEnumerable] attribute EventHandler ondragstart;
+    [NotEnumerable] attribute EventHandler ondrop;
+    [NotEnumerable] attribute EventHandler onerror;
+    [NotEnumerable] attribute EventHandler onfocus;
+    [NotEnumerable] attribute EventHandler oninput;
+    [NotEnumerable] attribute EventHandler oninvalid;
+    [NotEnumerable] attribute EventHandler onkeydown;
+    [NotEnumerable] attribute EventHandler onkeypress;
+    [NotEnumerable] attribute EventHandler onkeyup;
+    [NotEnumerable] attribute EventHandler onload;
+    [NotEnumerable] attribute EventHandler onmousedown;
+    [NotEnumerable] attribute EventHandler onmouseenter;
+    [NotEnumerable] attribute EventHandler onmouseleave;
+    [NotEnumerable] attribute EventHandler onmousemove;
+    [NotEnumerable] attribute EventHandler onmouseout;
+    [NotEnumerable] attribute EventHandler onmouseover;
+    [NotEnumerable] attribute EventHandler onmouseup;
+    [NotEnumerable] attribute EventHandler onmousewheel;
+    [NotEnumerable] attribute EventHandler onpaste;
+    [NotEnumerable] attribute EventHandler onreadystatechange;
+    [NotEnumerable] attribute EventHandler onreset;
+    [NotEnumerable] attribute EventHandler onscroll;
+    [NotEnumerable] attribute EventHandler onsearch;
+    [NotEnumerable] attribute EventHandler onselect;
+    [NotEnumerable] attribute EventHandler onselectionchange;
+    [NotEnumerable] attribute EventHandler onselectstart;
+    [NotEnumerable] attribute EventHandler onsubmit;
+    [NotEnumerable] attribute EventHandler onwheel;
+
+    [NotEnumerable, Conditional=CSP_NEXT] attribute EventHandler onsecuritypolicyviolation;
+
+    [NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchcancel;
+    [NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchend;
+    [NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchmove;
+    [NotEnumerable, Conditional=TOUCH_EVENTS] attribute EventHandler ontouchstart;
+
+    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealbottom;
+    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealleft;
+    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealright;
+    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
+
+    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
+    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
+    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
+    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
+
+    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenchange;
+    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventHandler onwebkitfullscreenerror;
+
+    [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockchange;
+    [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockerror;
+
+#if defined(ENABLE_IOS_TOUCH_EVENTS) && ENABLE_IOS_TOUCH_EVENTS
+#include <WebKitAdditions/DocumentIOS.idl>
+#elif defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
+    [ReturnNewObject, RaisesException] Touch createTouch([Default=Undefined] optional DOMWindow window,
+                                                     [Default=Undefined] optional EventTarget target,
+                                                     [Default=Undefined] optional long identifier,
+                                                     [Default=Undefined] optional long pageX,
+                                                     [Default=Undefined] optional long pageY,
+                                                     [Default=Undefined] optional long screenX,
+                                                     [Default=Undefined] optional long screenY,
+                                                     [Default=Undefined] optional long webkitRadiusX,
+                                                     [Default=Undefined] optional long webkitRadiusY,
+                                                     [Default=Undefined] optional unrestricted float webkitRotationAngle,
+                                                     [Default=Undefined] optional unrestricted float webkitForce);
+    [ReturnNewObject, Custom, RaisesException] TouchList createTouchList();
 #endif
 
-        // Page visibility API.
-        readonly attribute [Conditional=PAGE_VISIBILITY_API] DOMString webkitVisibilityState;
-        readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitHidden;
+    // Page visibility API.
+    readonly attribute DOMString visibilityState;
+    readonly attribute boolean hidden;
+
+    // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces
+    [Conditional=CSP_NEXT] readonly attribute DOMSecurityPolicy securityPolicy;
+
+    // currentscript API: http://www.whatwg.org/specs/web-apps/current-work/multipage/dom.html#dom-document-currentscript
+    readonly attribute HTMLScriptElement currentScript;
+
+    // http://www.w3.org/TR/2014/WD-dom-20140204/#dom-document-origin
+    readonly attribute DOMString origin;
+
+    // http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement
+    readonly attribute Element scrollingElement;
 
-    };
+    // From the ParentNode interface - https://dom.spec.whatwg.org/#interface-parentnode
+    // FIXME: Move this to a seperate ParentNode IDL file when one exists.
+    readonly attribute Element firstElementChild;
+    readonly attribute Element lastElementChild;
+    readonly attribute unsigned long childElementCount;
+};
 
-}