Element Traversal is not just Elements anymore
[WebKit-https.git] / Source / WebCore / dom / Document.idl
index 2e39765..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 [
-        CustomToJSObject,
-        JSGenerateToNativeObject,
-        JSInlineGetOwnPropertySlot
-    ] Document : Node {
-
-        // DOM Level 1 Core
-        readonly attribute DocumentType doctype;
-        readonly attribute DOMImplementation implementation;
-        readonly attribute Element documentElement;
-
-        [ReturnNewObject] Element createElement(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString tagName)
-            raises (DOMException);
-        DocumentFragment   createDocumentFragment();
-        [ReturnNewObject] Text createTextNode(in [Optional=DefaultIsUndefined] DOMString data);
-        [ReturnNewObject] Comment createComment(in [Optional=DefaultIsUndefined] DOMString data);
-        [ReturnNewObject] CDATASection createCDATASection(in [Optional=DefaultIsUndefined] DOMString data)
-            raises(DOMException);
-        [ObjCLegacyUnnamedParameters, ReturnNewObject] ProcessingInstruction createProcessingInstruction(in [Optional=DefaultIsUndefined] DOMString target,
-                                                                                     in [Optional=DefaultIsUndefined] DOMString data)
-            raises (DOMException);
-        [ReturnNewObject] Attr createAttribute(in [Optional=DefaultIsUndefined] DOMString name)
-            raises (DOMException);
-        [ReturnNewObject] EntityReference createEntityReference(in [Optional=DefaultIsUndefined] DOMString name)
-            raises(DOMException);
-        NodeList           getElementsByTagName(in [Optional=DefaultIsUndefined] DOMString tagname);
-
-        // Introduced in DOM Level 2:
-
-        [ObjCLegacyUnnamedParameters, ReturnNewObject] Node importNode(in [Optional=DefaultIsUndefined] Node importedNode,
-                                                   in [Optional] boolean deep)
-            raises (DOMException);
-        [ObjCLegacyUnnamedParameters, ReturnNewObject] Element createElementNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
-                                                           in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName)
-            raises (DOMException);
-        [ObjCLegacyUnnamedParameters, ReturnNewObject] Attr createAttributeNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
-                                                          in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString qualifiedName)
-            raises (DOMException);
-        [ObjCLegacyUnnamedParameters] NodeList getElementsByTagNameNS(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString namespaceURI,
-                                                       in [Optional=DefaultIsUndefined] DOMString localName);
-        Element            getElementById(in [Optional=DefaultIsUndefined] DOMString elementId);
-
-        // DOM Level 3 Core
-
-        readonly attribute [TreatReturnedNullStringAs=Null] DOMString inputEncoding;
-
-        readonly attribute [TreatReturnedNullStringAs=Null] DOMString xmlEncoding;
-                 attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString xmlVersion
-                    setter raises (DOMException);
-                 attribute boolean xmlStandalone
-                    setter raises (DOMException);
-
-        Node               adoptNode(in [Optional=DefaultIsUndefined] Node source)
-            raises (DOMException);
+[
+    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.
-                 attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString documentURI;
+    // 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
-        readonly attribute [TreatReturnedNullStringAs=Null] DOMString documentURI;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString documentURI;
 #endif
 
-        // DOM Level 2 Events (DocumentEvents interface)
+    // DOM Level 2 Events (DocumentEvents interface)
 
-        Event              createEvent(in [Optional=DefaultIsUndefined] DOMString eventType)
-            raises(DOMException);
+    [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);
 
-        // DOM Level 2 Tranversal and Range (DocumentRange interface)
+    // DOM Level 2 Tranversal and Range (DocumentRange interface)
 
-        Range              createRange();
+    Range              createRange();
 
-        // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
+    // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
 
-        [ObjCLegacyUnnamedParameters] NodeIterator createNodeIterator(in [Optional=DefaultIsUndefined] Node root,
-                                                       in [Optional=DefaultIsUndefined] unsigned long whatToShow,
-                                                       in [Optional=DefaultIsUndefined] NodeFilter filter,
-                                                       in [Optional=DefaultIsUndefined] boolean expandEntityReferences)
-            raises(DOMException);
-        [ObjCLegacyUnnamedParameters] TreeWalker createTreeWalker(in [Optional=DefaultIsUndefined] Node root,
-                                                   in [Optional=DefaultIsUndefined] unsigned long whatToShow,
-                                                   in [Optional=DefaultIsUndefined] NodeFilter filter,
-                                                   in [Optional=DefaultIsUndefined] boolean expandEntityReferences)
-            raises(DOMException);
+    [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)
+    // DOM Level 2 Abstract Views (DocumentView interface)
 
-        readonly attribute DOMWindow defaultView;
+    readonly attribute DOMWindow defaultView;
 
-        // DOM Level 2 Style (DocumentStyle interface)
+    // DOM Level 2 Style (DocumentStyle interface)
 
-        readonly attribute StyleSheetList styleSheets;
+    readonly attribute StyleSheetList styleSheets;
 
-        // DOM Level 2 Style (DocumentCSS interface)
+    // DOM Level 2 Style (DocumentCSS interface)
 
-        [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle(in [Optional=DefaultIsUndefined] Element element,
-                                                            in [Optional=DefaultIsUndefined] DOMString pseudoElement);
+    [ObjCLegacyUnnamedParameters] CSSStyleDeclaration getOverrideStyle([Default=Undefined] optional Element element,
+                                                        [Default=Undefined] optional DOMString pseudoElement);
 
-        // DOM Level 3 XPath (XPathEvaluator interface)
-        [ObjCLegacyUnnamedParameters] XPathExpression createExpression(in [Optional=DefaultIsUndefined] DOMString expression,
-                                                        in [Optional=DefaultIsUndefined] XPathNSResolver resolver)
-            raises(DOMException);
-        XPathNSResolver    createNSResolver(in Node nodeResolver);
-        [ObjCLegacyUnnamedParameters, V8Custom] XPathResult evaluate(in [Optional=DefaultIsUndefined] DOMString expression,
-                                                      in [Optional=DefaultIsUndefined] Node contextNode,
-                                                      in [Optional=DefaultIsUndefined] XPathNSResolver resolver,
-                                                      in [Optional=DefaultIsUndefined] unsigned short type,
-                                                      in [Optional=DefaultIsUndefined] XPathResult inResult)
-            raises(DOMException);
+    readonly attribute DOMString contentType;
 
-        // Common extensions
+    // 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);
 
-        boolean            execCommand(in [Optional=DefaultIsUndefined] DOMString command,
-                                       in [Optional=DefaultIsUndefined] boolean userInterface,
-                                       in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString value);
+    // 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=DefaultIsUndefined] DOMString command);
-        boolean            queryCommandIndeterm(in [Optional=DefaultIsUndefined] DOMString command);
-        boolean            queryCommandState(in [Optional=DefaultIsUndefined] DOMString command);
-        boolean            queryCommandSupported(in [Optional=DefaultIsUndefined] DOMString command);
-        DOMString          queryCommandValue(in [Optional=DefaultIsUndefined] 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=NullString] DOMString title;
-        readonly attribute DOMString referrer;
+             [TreatNullAs=NullString] attribute DOMString title;
+    readonly attribute DOMString referrer;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-                 attribute [TreatNullAs=NullString] 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=NullString] DOMString cookie
-                     setter raises (DOMException),
-                     getter raises (DOMException);
+    [TreatNullAs=NullString, GetterRaisesException, SetterRaisesException] attribute DOMString cookie;
 
-                 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=DefaultIsUndefined] DOMString elementName);
-
-#if defined(ENABLE_MICRODATA) && ENABLE_MICRODATA
-        NodeList getItems(in [TreatNullAs=NullString, TreatUndefinedAs=NullString, Optional=DefaultIsUndefined] 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 [TreatReturnedNullStringAs=Undefined, TreatNullAs=NullString] DOMString charset;
-        readonly attribute [TreatReturnedNullStringAs=Undefined] DOMString defaultCharset;
-        readonly attribute [TreatReturnedNullStringAs=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=DefaultIsUndefined] long x, 
-                                            in [Optional=DefaultIsUndefined] long y);
-        Range              caretRangeFromPoint(in [Optional=DefaultIsUndefined] long x, 
-                                               in [Optional=DefaultIsUndefined] 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 [TreatReturnedNullStringAs=Null] DOMString characterSet;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString characterSet;
 
-        // WebKit extensions
+    // WebKit extensions
 
-        readonly attribute [TreatReturnedNullStringAs=Null] DOMString preferredStylesheetSet;
-                 attribute [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] DOMString selectedStylesheetSet;
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString preferredStylesheetSet;
+             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString selectedStylesheetSet;
 
 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
-        CSSStyleDeclaration createCSSStyleDeclaration();
-#endif
-
-#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-        readonly attribute [Conditional=UNDO_MANAGER] UndoManager undoManager;
+    CSSStyleDeclaration createCSSStyleDeclaration();
 #endif
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
-        // DOM Level 2 Style Interface
-        [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(in Element element,
-                                                                      in DOMString pseudoElement);
-
-        // WebKit extension
-        // FIXME: remove the first version once [Optional] is implemented for Objective-C.
-        [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element,
-                                                  in DOMString pseudoElement);
-        [ObjCUseDefaultView] 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
-        CanvasRenderingContext 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=DefaultIsUndefined] DOMString tagname);
+    // HTML 5
+    NodeList getElementsByClassName([Default=Undefined] optional DOMString classNames);
 
-        readonly attribute DOMString compatMode;
+    readonly attribute Element activeElement;
+    boolean hasFocus();
 
-        // NodeSelector - Selector API
-        Element querySelector(in DOMString selectors)
-            raises(DOMException);
-        NodeList querySelectorAll(in DOMString selectors)
-            raises(DOMException);
+    readonly attribute DOMString compatMode;
+
+    // NodeSelector - Selector API
+    [RaisesException] Element querySelector(DOMString selectors);
+    [RaisesException] NodeList querySelectorAll(DOMString selectors);
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
-        // Mozilla version
-        readonly attribute [V8EnabledAtRuntime] boolean webkitIsFullScreen;
-        readonly attribute [V8EnabledAtRuntime] boolean webkitFullScreenKeyboardInputAllowed;
-        readonly attribute [V8EnabledAtRuntime] Element webkitCurrentFullScreenElement;
-        [V8EnabledAtRuntime] void webkitCancelFullScreen();
-
-        // W3C version
-        readonly attribute [V8EnabledAtRuntime] boolean webkitFullscreenEnabled;
-        readonly attribute [V8EnabledAtRuntime] Element webkitFullscreenElement;
-        [V8EnabledAtRuntime] void webkitExitFullscreen();
+    // 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
 
-        [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] void webkitExitPointerLock();
-        readonly attribute [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] Element webkitPointerLockElement;
+    [Conditional=POINTER_LOCK] void exitPointerLock();
+    [Conditional=POINTER_LOCK] readonly attribute Element pointerLockElement;
 
-        [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
+    [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
 
-#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
-        // Event handler DOM attributes
-        attribute [NotEnumerable] EventListener onabort;
-        attribute [NotEnumerable] EventListener onblur;
-        attribute [NotEnumerable] EventListener onchange;
-        attribute [NotEnumerable] EventListener onclick;
-        attribute [NotEnumerable] EventListener oncontextmenu;
-        attribute [NotEnumerable] EventListener ondblclick;
-        attribute [NotEnumerable] EventListener ondrag;
-        attribute [NotEnumerable] EventListener ondragend;
-        attribute [NotEnumerable] EventListener ondragenter;
-        attribute [NotEnumerable] EventListener ondragleave;
-        attribute [NotEnumerable] EventListener ondragover;
-        attribute [NotEnumerable] EventListener ondragstart;
-        attribute [NotEnumerable] EventListener ondrop;
-        attribute [NotEnumerable] EventListener onerror;
-        attribute [NotEnumerable] EventListener onfocus;
-        attribute [NotEnumerable] EventListener oninput;
-        attribute [NotEnumerable] EventListener oninvalid;
-        attribute [NotEnumerable] EventListener onkeydown;
-        attribute [NotEnumerable] EventListener onkeypress;
-        attribute [NotEnumerable] EventListener onkeyup;
-        attribute [NotEnumerable] EventListener onload;
-        attribute [NotEnumerable] EventListener onmousedown;
-        attribute [NotEnumerable] EventListener onmousemove;
-        attribute [NotEnumerable] EventListener onmouseout;
-        attribute [NotEnumerable] EventListener onmouseover;
-        attribute [NotEnumerable] EventListener onmouseup;
-        attribute [NotEnumerable] EventListener onmousewheel;
-        attribute [NotEnumerable] EventListener onreadystatechange;
-        attribute [NotEnumerable] EventListener onscroll;
-        attribute [NotEnumerable] EventListener onselect;
-        attribute [NotEnumerable] EventListener onsubmit;
-
-        // attribute [NotEnumerable] EventListener oncanplay;
-        // attribute [NotEnumerable] EventListener oncanplaythrough;
-        // attribute [NotEnumerable] EventListener ondurationchange;
-        // attribute [NotEnumerable] EventListener onemptied;
-        // attribute [NotEnumerable] EventListener onended;
-        // attribute [NotEnumerable] EventListener onloadeddata;
-        // attribute [NotEnumerable] EventListener onloadedmetadata;
-        // attribute [NotEnumerable] EventListener onloadstart;
-        // attribute [NotEnumerable] EventListener onpause;
-        // attribute [NotEnumerable] EventListener onplay;
-        // attribute [NotEnumerable] EventListener onplaying;
-        // attribute [NotEnumerable] EventListener onprogress;
-        // attribute [NotEnumerable] EventListener onratechange;
-        // attribute [NotEnumerable] EventListener onseeked;
-        // attribute [NotEnumerable] EventListener onseeking;
-        // attribute [NotEnumerable] EventListener onshow;
-        // attribute [NotEnumerable] EventListener onstalled;
-        // attribute [NotEnumerable] EventListener onsuspend;
-        // attribute [NotEnumerable] EventListener ontimeupdate;
-        // attribute [NotEnumerable] EventListener onvolumechange;
-        // attribute [NotEnumerable] EventListener onwaiting;
-
-        // WebKit extensions
-        attribute [NotEnumerable] EventListener onbeforecut;
-        attribute [NotEnumerable] EventListener oncut;
-        attribute [NotEnumerable] EventListener onbeforecopy;
-        attribute [NotEnumerable] EventListener oncopy;
-        attribute [NotEnumerable] EventListener onbeforepaste;
-        attribute [NotEnumerable] EventListener onpaste;
-        attribute [NotEnumerable] EventListener onreset;
-        attribute [NotEnumerable] EventListener onsearch;
-        attribute [NotEnumerable] EventListener onselectstart;
-        attribute [NotEnumerable] EventListener onselectionchange;
-        attribute [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchstart;
-        attribute [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchmove;
-        attribute [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchend;
-        attribute [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] EventListener ontouchcancel;
-        attribute [NotEnumerable, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenchange;
-        attribute [NotEnumerable, Conditional=FULLSCREEN_API] EventListener onwebkitfullscreenerror;
-        attribute [NotEnumerable, Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] EventListener onwebkitpointerlockchange;
-        attribute [NotEnumerable, Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] EventListener onwebkitpointerlockerror;
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+    [Conditional=FONT_LOAD_EVENTS] readonly attribute FontLoader fonts;
 #endif
 
-#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
-        [ReturnNewObject, V8EnabledAtRuntime] Touch createTouch(in [Optional=DefaultIsUndefined] DOMWindow window,
-                                                         in [Optional=DefaultIsUndefined] EventTarget target,
-                                                         in [Optional=DefaultIsUndefined] long identifier,
-                                                         in [Optional=DefaultIsUndefined] long pageX,
-                                                         in [Optional=DefaultIsUndefined] long pageY,
-                                                         in [Optional=DefaultIsUndefined] long screenX,
-                                                         in [Optional=DefaultIsUndefined] long screenY,
-                                                         in [Optional=DefaultIsUndefined] long webkitRadiusX,
-                                                         in [Optional=DefaultIsUndefined] long webkitRadiusY,
-                                                         in [Optional=DefaultIsUndefined] float webkitRotationAngle,
-                                                         in [Optional=DefaultIsUndefined] float webkitForce)
-            raises (DOMException);
-        [ReturnNewObject, V8EnabledAtRuntime, Custom] TouchList createTouchList()
-            raises (DOMException);
+    [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
 
-#if defined(LANGUAGE_CPP) && LANGUAGE_CPP
-        // Extra WebCore methods exposed to allow compile-time casting in C++
-        boolean isHTMLDocument();
-#endif
+    // 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;
 
-        // Page visibility API.
-        readonly attribute [Conditional=PAGE_VISIBILITY_API] DOMString webkitVisibilityState;
-        readonly attribute [Conditional=PAGE_VISIBILITY_API] boolean webkitHidden;
+    // http://www.w3.org/TR/2014/WD-dom-20140204/#dom-document-origin
+    readonly attribute DOMString origin;
 
-        // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces
-        readonly attribute [Conditional=CSP_NEXT] DOMSecurityPolicy SecurityPolicy;
+    // 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;
+};
 
-}