Element Traversal is not just Elements anymore
[WebKit-https.git] / Source / WebCore / dom / Document.idl
index b44ba1d..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
  */
 
 [
+    Constructor,
+    ConstructorCallWith=ScriptExecutionContext,
     CustomToJSObject,
+    JSCustomHeader,
     JSGenerateToNativeObject,
-    JSInlineGetOwnPropertySlot
 ] interface Document : Node {
 
     // DOM Level 1 Core
     readonly attribute DOMImplementation implementation;
     readonly attribute Element documentElement;
 
-    [ReturnNewObject] Element createElement(in [TreatNullAs=NullString,Optional=DefaultIsUndefined] DOMString tagName)
-        raises (DOMException);
+    [ReturnNewObject, RaisesException] Element createElement([TreatNullAs=NullString,Default=Undefined] optional DOMString tagName);
     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);
+    [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] 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);
+    [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] attribute DOMString xmlVersion
-                setter raises (DOMException);
-             attribute boolean xmlStandalone
-                setter raises (DOMException);
+    [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlVersion;
+    [SetterRaisesException] attribute boolean xmlStandalone;
 
-    Node               adoptNode(in [Optional=DefaultIsUndefined] Node source)
-        raises (DOMException);
+    [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
@@ -85,8 +76,7 @@
 
     // 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 (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 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);
+
+    readonly attribute DOMString contentType;
 
     // 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);
+    [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(in [Optional=DefaultIsUndefined] DOMString command,
-                                   in [Optional=DefaultIsUndefined] boolean userInterface,
-                                   in [TreatNullAs=NullString, TreatUndefinedAs=NullString,Optional=DefaultIsUndefined] DOMString value);
+    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
 
              [TreatNullAs=NullString] attribute DOMString title;
     readonly attribute DOMString referrer;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-             [TreatNullAs=NullString] attribute DOMString domain
-                 setter raises (DOMException);
+    [TreatNullAs=NullString, SetterRaisesException] attribute DOMString domain;
 #else
     readonly attribute DOMString domain;
 #endif
     readonly attribute DOMString URL;
 
-             [TreatNullAs=NullString] attribute 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 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
              [Custom] attribute Location location;
     [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
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
 
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
     // DOM Level 2 Style Interface
-    [ObjCLegacyUnnamedParameters, ObjCUseDefaultView] CSSStyleDeclaration getComputedStyle(in Element element,
-                                                                  in DOMString pseudoElement);
+    [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(in Element element,
-                                              in DOMString pseudoElement);
-    [ObjCUseDefaultView] CSSRuleList getMatchedCSSRules(in Element element,
-                                              in DOMString pseudoElement,
-                                              in [Optional] boolean authorOnly);
+    // 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);
+    NodeList getElementsByClassName([Default=Undefined] optional DOMString classNames);
+
+    readonly attribute Element activeElement;
+    boolean hasFocus();
 
     readonly attribute DOMString compatMode;
 
     // NodeSelector - Selector API
-    Element querySelector(in DOMString selectors)
-        raises(DOMException);
-    NodeList querySelectorAll(in DOMString selectors)
-        raises(DOMException);
+    [RaisesException] Element querySelector(DOMString selectors);
+    [RaisesException] NodeList querySelectorAll(DOMString selectors);
 
 #if defined(ENABLE_FULLSCREEN_API) && ENABLE_FULLSCREEN_API
     // Mozilla version
-    [V8EnabledAtRuntime] readonly attribute boolean webkitIsFullScreen;
-    [V8EnabledAtRuntime] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
-    [V8EnabledAtRuntime] readonly attribute Element webkitCurrentFullScreenElement;
-    [V8EnabledAtRuntime] void webkitCancelFullScreen();
+    readonly attribute boolean webkitIsFullScreen;
+    readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
+    readonly attribute Element webkitCurrentFullScreenElement;
+    void webkitCancelFullScreen();
 
     // W3C version
-    [V8EnabledAtRuntime] readonly attribute boolean webkitFullscreenEnabled;
-    [V8EnabledAtRuntime] readonly attribute Element webkitFullscreenElement;
-    [V8EnabledAtRuntime] void webkitExitFullscreen();
+    readonly attribute boolean webkitFullscreenEnabled;
+    readonly attribute Element webkitFullscreenElement;
+    void webkitExitFullscreen();
 #endif
 
-    [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] void webkitExitPointerLock();
-    [Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] readonly attribute Element webkitPointerLockElement;
+    [Conditional=POINTER_LOCK] void exitPointerLock();
+    [Conditional=POINTER_LOCK] readonly attribute Element pointerLockElement;
 
     [Conditional=CSS_REGIONS] DOMNamedFlowCollection webkitGetNamedFlows();
 
-#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
-    // Event handler DOM attributes
-    [NotEnumerable] attribute EventListener onabort;
-    [NotEnumerable] attribute EventListener onblur;
-    [NotEnumerable] attribute EventListener onchange;
-    [NotEnumerable] attribute EventListener onclick;
-    [NotEnumerable] attribute EventListener oncontextmenu;
-    [NotEnumerable] attribute EventListener ondblclick;
-    [NotEnumerable] attribute EventListener ondrag;
-    [NotEnumerable] attribute EventListener ondragend;
-    [NotEnumerable] attribute EventListener ondragenter;
-    [NotEnumerable] attribute EventListener ondragleave;
-    [NotEnumerable] attribute EventListener ondragover;
-    [NotEnumerable] attribute EventListener ondragstart;
-    [NotEnumerable] attribute EventListener ondrop;
-    [NotEnumerable] attribute EventListener onerror;
-    [NotEnumerable] attribute EventListener onfocus;
-    [NotEnumerable] attribute EventListener oninput;
-    [NotEnumerable] attribute EventListener oninvalid;
-    [NotEnumerable] attribute EventListener onkeydown;
-    [NotEnumerable] attribute EventListener onkeypress;
-    [NotEnumerable] attribute EventListener onkeyup;
-    [NotEnumerable] attribute EventListener onload;
-    [NotEnumerable] attribute EventListener onmousedown;
-    [NotEnumerable] attribute EventListener onmousemove;
-    [NotEnumerable] attribute EventListener onmouseout;
-    [NotEnumerable] attribute EventListener onmouseover;
-    [NotEnumerable] attribute EventListener onmouseup;
-    [NotEnumerable] attribute EventListener onmousewheel;
-    [NotEnumerable] attribute EventListener onreadystatechange;
-    [NotEnumerable] attribute EventListener onscroll;
-    [NotEnumerable] attribute EventListener onselect;
-    [NotEnumerable] attribute 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
-    [NotEnumerable] attribute EventListener onbeforecut;
-    [NotEnumerable] attribute EventListener oncut;
-    [NotEnumerable] attribute EventListener onbeforecopy;
-    [NotEnumerable] attribute EventListener oncopy;
-    [NotEnumerable] attribute EventListener onbeforepaste;
-    [NotEnumerable] attribute EventListener onpaste;
-    [NotEnumerable] attribute EventListener onreset;
-    [NotEnumerable] attribute EventListener onsearch;
-    [NotEnumerable] attribute EventListener onselectstart;
-    [NotEnumerable] attribute EventListener onselectionchange;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchstart;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchmove;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchend;
-    [NotEnumerable,Conditional=TOUCH_EVENTS,V8EnabledAtRuntime] attribute EventListener ontouchcancel;
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenchange;
-    [NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror;
-    [NotEnumerable, Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] attribute EventListener onwebkitpointerlockchange;
-    [NotEnumerable, Conditional=POINTER_LOCK, V8EnabledAtRuntime=pointerLock] attribute EventListener onwebkitpointerlockerror;
-#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);
+#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.
-    [Conditional=PAGE_VISIBILITY_API] readonly attribute DOMString webkitVisibilityState;
-    [Conditional=PAGE_VISIBILITY_API] readonly attribute boolean webkitHidden;
+    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;
 };