Roll IDL to multivm@1316

TBR=efortuna@google.com

Review URL: https://codereview.chromium.org//19605006

git-svn-id: http://dart.googlecode.com/svn/third_party/WebCore@25433 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/core/README b/core/README
index 1001454..b922618 100644
--- a/core/README
+++ b/core/README
@@ -6,4 +6,4 @@
 
 The current version corresponds to:
 URL: http://src.chromium.org/multivm/trunk/webkit
-Current revision: 1281
+Current revision: 1316
diff --git a/core/css/CSSRule.idl b/core/css/CSSRule.idl
index 983a464..a1a19de 100644
--- a/core/css/CSSRule.idl
+++ b/core/css/CSSRule.idl
@@ -36,16 +36,14 @@
     const unsigned short WEBKIT_KEYFRAMES_RULE = 7;
     const unsigned short WEBKIT_KEYFRAME_RULE = 8;
     const unsigned short SUPPORTS_RULE = 12;
-#if defined(ENABLE_CSS_DEVICE_ADAPTATION) && ENABLE_CSS_DEVICE_ADAPTATION
-    const unsigned short WEBKIT_VIEWPORT_RULE = 15;
-#endif
+    [EnabledAtRuntime=cssViewport] const unsigned short VIEWPORT_RULE = 15;
     [EnabledAtRuntime=cssRegions] const unsigned short WEBKIT_REGION_RULE = 16;
     const unsigned short WEBKIT_FILTER_RULE = 17;
     const unsigned short HOST_RULE = 1001;
 
     readonly attribute unsigned short   type;
 
-             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString, SetterRaisesException] attribute DOMString        cssText;
+             [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString        cssText;
 
     readonly attribute CSSStyleSheet    parentStyleSheet;
     readonly attribute CSSRule          parentRule;
diff --git a/core/css/CSSViewportRule.idl b/core/css/CSSViewportRule.idl
index c4e69e1..5dbb2e4 100644
--- a/core/css/CSSViewportRule.idl
+++ b/core/css/CSSViewportRule.idl
@@ -27,9 +27,6 @@
  * SUCH DAMAGE.
  */
 
-[
-    Conditional=CSS_DEVICE_ADAPTATION,
-    InterfaceName=WebKitCSSViewportRule
-] interface CSSViewportRule : CSSRule {
+interface CSSViewportRule : CSSRule {
     readonly attribute CSSStyleDeclaration style;
 };
diff --git a/core/css/CSSFilterRule.idl b/core/css/WebKitCSSFilterRule.idl
similarity index 95%
rename from core/css/CSSFilterRule.idl
rename to core/css/WebKitCSSFilterRule.idl
index 8c87e90..09a3176 100644
--- a/core/css/CSSFilterRule.idl
+++ b/core/css/WebKitCSSFilterRule.idl
@@ -28,8 +28,8 @@
  */
 
 [
-    InterfaceName=WebKitCSSFilterRule
-] interface CSSFilterRule : CSSRule {
+    ImplementedAs=CSSFilterRule
+] interface WebKitCSSFilterRule : CSSRule {
     readonly attribute CSSStyleDeclaration style;
 
     // FIXME: We should expose the filter name once the CSSOM for the @filter rule is specified.
diff --git a/core/css/CSSFilterValue.idl b/core/css/WebKitCSSFilterValue.idl
similarity index 96%
rename from core/css/CSSFilterValue.idl
rename to core/css/WebKitCSSFilterValue.idl
index 035b859..52500df 100644
--- a/core/css/CSSFilterValue.idl
+++ b/core/css/WebKitCSSFilterValue.idl
@@ -25,8 +25,8 @@
 
 [
     DoNotCheckConstants,
-    InterfaceName=WebKitCSSFilterValue
-] interface CSSFilterValue : CSSValueList {
+    ImplementedAs=CSSFilterValue
+] interface WebKitCSSFilterValue : CSSValueList {
 
     // OperationTypes
 
diff --git a/core/css/CSSKeyframeRule.idl b/core/css/WebKitCSSKeyframeRule.idl
similarity index 95%
rename from core/css/CSSKeyframeRule.idl
rename to core/css/WebKitCSSKeyframeRule.idl
index 2c51a47..c82351f 100644
--- a/core/css/CSSKeyframeRule.idl
+++ b/core/css/WebKitCSSKeyframeRule.idl
@@ -28,9 +28,8 @@
 
 // Introduced in DOM Level ?:
 [
-    InterfaceName=WebKitCSSKeyframeRule
-]
-interface CSSKeyframeRule : CSSRule {
+    ImplementedAs=CSSKeyframeRule
+] interface WebKitCSSKeyframeRule : CSSRule {
 
     attribute DOMString keyText;
     readonly attribute CSSStyleDeclaration style;
diff --git a/core/css/CSSKeyframesRule.idl b/core/css/WebKitCSSKeyframesRule.idl
similarity index 88%
rename from core/css/CSSKeyframesRule.idl
rename to core/css/WebKitCSSKeyframesRule.idl
index 873e756..5fdc800 100644
--- a/core/css/CSSKeyframesRule.idl
+++ b/core/css/WebKitCSSKeyframesRule.idl
@@ -28,15 +28,15 @@
 
 // Introduced in DOM Level ?:
 [
-    InterfaceName=WebKitCSSKeyframesRule
-] interface CSSKeyframesRule : CSSRule {
+    ImplementedAs=CSSKeyframesRule
+] interface WebKitCSSKeyframesRule : CSSRule {
 
     [TreatReturnedNullStringAs=Null, TreatNullAs=NullString] attribute DOMString name;
     readonly attribute CSSRuleList cssRules;
     
-    [ImplementedAs=item, NotEnumerable] getter CSSKeyframeRule(unsigned long index);
+    [ImplementedAs=item, NotEnumerable] getter WebKitCSSKeyframeRule(unsigned long index);
     void insertRule([Default=Undefined] optional DOMString rule);
     void deleteRule([Default=Undefined] optional DOMString key);
-    CSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
+    WebKitCSSKeyframeRule findRule([Default=Undefined] optional DOMString key);
 };
 
diff --git a/core/css/CSSMatrix.idl b/core/css/WebKitCSSMatrix.idl
similarity index 85%
rename from core/css/CSSMatrix.idl
rename to core/css/WebKitCSSMatrix.idl
index 8f2e2bb..fa581b4 100644
--- a/core/css/CSSMatrix.idl
+++ b/core/css/WebKitCSSMatrix.idl
@@ -26,9 +26,9 @@
 // Introduced in DOM Level ?:
 [
     Constructor([Default=NullString] optional DOMString cssValue),
-    InterfaceName=WebKitCSSMatrix,
-    RaisesException
-] interface CSSMatrix {
+    ImplementedAs=CSSMatrix,
+    ConstructorRaisesException
+] interface WebKitCSSMatrix {
 
     // These attributes are simple aliases for certain elements of the 4x4 matrix
     attribute double a; // alias for m11
@@ -58,46 +58,46 @@
     [RaisesException] void setMatrixValue([Default=Undefined] optional DOMString string);
     
     // Multiply this matrix by secondMatrix, on the right (result = this * secondMatrix)
-    [Immutable] CSSMatrix multiply([Default=Undefined] optional CSSMatrix secondMatrix);
+    [Immutable] WebKitCSSMatrix multiply([Default=Undefined] optional WebKitCSSMatrix secondMatrix);
     
     // Return the inverse of this matrix. Throw an exception if the matrix is not invertible
-    [Immutable, RaisesException] CSSMatrix inverse();
+    [Immutable, RaisesException] WebKitCSSMatrix inverse();
     
     // Return this matrix translated by the passed values.
     // Passing a NaN will use a value of 0. This allows the 3D form to used for 2D operations    
-    [Immutable] CSSMatrix translate([Default=Undefined] optional double x, 
+    [Immutable] WebKitCSSMatrix translate([Default=Undefined] optional double x, 
                                           [Default=Undefined] optional double y, 
                                           [Default=Undefined] optional double z);
     
     // Returns this matrix scaled by the passed values.
     // Passing scaleX or scaleZ as NaN uses a value of 1, but passing scaleY of NaN 
     // makes it the same as scaleX. This allows the 3D form to used for 2D operations
-    [Immutable] CSSMatrix scale([Default=Undefined] optional double scaleX, 
+    [Immutable] WebKitCSSMatrix scale([Default=Undefined] optional double scaleX, 
                                       [Default=Undefined] optional double scaleY, 
                                       [Default=Undefined] optional double scaleZ);
     
     // Returns this matrix rotated by the passed values.
     // If rotY and rotZ are NaN, rotate about Z (rotX=0, rotateY=0, rotateZ=rotX).
     // Otherwise use a rotation value of 0 for any passed NaN.    
-    [Immutable] CSSMatrix rotate([Default=Undefined] optional double rotX, 
+    [Immutable] WebKitCSSMatrix rotate([Default=Undefined] optional double rotX, 
                                        [Default=Undefined] optional double rotY, 
                                        [Default=Undefined] optional double rotZ);
     
     // Returns this matrix rotated about the passed axis by the passed angle.
     // Passing a NaN will use a value of 0. If the axis is (0,0,0) use a value
     // of (0,0,1).
-    [Immutable] CSSMatrix rotateAxisAngle([Default=Undefined] optional double x, 
+    [Immutable] WebKitCSSMatrix rotateAxisAngle([Default=Undefined] optional double x, 
                                                 [Default=Undefined] optional double y, 
                                                 [Default=Undefined] optional double z, 
                                                 [Default=Undefined] optional double angle);
 
     // Returns this matrix skewed along the X axis by the passed values.
     // Passing a NaN will use a value of 0.
-    [Immutable] CSSMatrix skewX([Default=Undefined] optional double angle);
+    [Immutable] WebKitCSSMatrix skewX([Default=Undefined] optional double angle);
 
     // Returns this matrix skewed along the Y axis by the passed values.
     // Passing a NaN will use a value of 0.
-    [Immutable] CSSMatrix skewY([Default=Undefined] optional double angle);
+    [Immutable] WebKitCSSMatrix skewY([Default=Undefined] optional double angle);
 
     [NotEnumerable] DOMString toString();
 };
diff --git a/core/css/CSSMixFunctionValue.idl b/core/css/WebKitCSSMixFunctionValue.idl
similarity index 93%
rename from core/css/CSSMixFunctionValue.idl
rename to core/css/WebKitCSSMixFunctionValue.idl
index 3519f33..57f3125 100644
--- a/core/css/CSSMixFunctionValue.idl
+++ b/core/css/WebKitCSSMixFunctionValue.idl
@@ -28,7 +28,7 @@
  */
 
 [
-    InterfaceName=WebKitCSSMixFunctionValue
-] interface CSSMixFunctionValue : CSSValueList {
+    ImplementedAs=CSSMixFunctionValue
+] interface WebKitCSSMixFunctionValue : CSSValueList {
 };
 
diff --git a/core/css/CSSRegionRule.idl b/core/css/WebKitCSSRegionRule.idl
similarity index 94%
rename from core/css/CSSRegionRule.idl
rename to core/css/WebKitCSSRegionRule.idl
index 0b264a3..5835319 100644
--- a/core/css/CSSRegionRule.idl
+++ b/core/css/WebKitCSSRegionRule.idl
@@ -29,8 +29,8 @@
 
 [
     EnabledAtRuntime=cssRegions,
-    InterfaceName=WebKitCSSRegionRule
-] interface CSSRegionRule : CSSRule {
+    ImplementedAs=CSSRegionRule
+] interface WebKitCSSRegionRule : CSSRule {
     readonly attribute CSSRuleList cssRules;
 };
 
diff --git a/core/css/CSSTransformValue.idl b/core/css/WebKitCSSTransformValue.idl
similarity index 95%
rename from core/css/CSSTransformValue.idl
rename to core/css/WebKitCSSTransformValue.idl
index f6a3942..8b59a43 100644
--- a/core/css/CSSTransformValue.idl
+++ b/core/css/WebKitCSSTransformValue.idl
@@ -27,9 +27,9 @@
  */
 
 [
-        DoNotCheckConstants,
-        InterfaceName=WebKitCSSTransformValue
-] interface CSSTransformValue : CSSValueList {
+    DoNotCheckConstants,
+    ImplementedAs=CSSTransformValue
+] interface WebKitCSSTransformValue : CSSValueList {
 
     // OperationTypes
 
diff --git a/core/dom/CharacterData.idl b/core/dom/CharacterData.idl
index 6491b8e..2e3262c 100644
--- a/core/dom/CharacterData.idl
+++ b/core/dom/CharacterData.idl
@@ -19,13 +19,13 @@
 
 interface CharacterData : Node {
 
-    [TreatNullAs=NullString, SetterRaisesException] attribute DOMString data;
+    [TreatNullAs=NullString] attribute DOMString data;
 
     readonly attribute unsigned long length;
     
     [TreatReturnedNullStringAs=Null, RaisesException] DOMString substringData([IsIndex,Default=Undefined] optional unsigned long offset, [IsIndex,Default=Undefined] optional unsigned long length);
 
-    [RaisesException] void appendData([Default=Undefined] optional DOMString data);
+    void appendData([Default=Undefined] optional DOMString data);
 
      [RaisesException] void insertData([IsIndex,Default=Undefined] optional unsigned long offset, 
                                    [Default=Undefined] optional DOMString data);
@@ -36,10 +36,7 @@
      [RaisesException] void replaceData([IsIndex,Default=Undefined] optional unsigned long offset, 
                                     [IsIndex,Default=Undefined] optional unsigned long length,
                                     [Default=Undefined] optional DOMString data);
-
-    // ChildNode interface API
-    readonly attribute Element previousElementSibling;
-    readonly attribute Element nextElementSibling;
-    [RaisesException] void remove();
 };
 
+CharacterData implements ChildNode;
+
diff --git a/core/dom/ChildNode.idl b/core/dom/ChildNode.idl
new file mode 100644
index 0000000..b37f05f
--- /dev/null
+++ b/core/dom/ChildNode.idl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
+ * 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+[NoInterfaceObject]
+interface ChildNode {
+    [PerWorldBindings] readonly attribute Element previousElementSibling;
+    [PerWorldBindings] readonly attribute Element nextElementSibling;
+    [RaisesException] void remove();
+};
+
diff --git a/core/dom/Comment.idl b/core/dom/Comment.idl
index 3a46dd7..d928c6e 100644
--- a/core/dom/Comment.idl
+++ b/core/dom/Comment.idl
@@ -19,7 +19,7 @@
 
 [
     Constructor([Default=NullString] optional DOMString data),
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface Comment : CharacterData {
 };
 
diff --git a/core/dom/CompositionEvent.idl b/core/dom/CompositionEvent.idl
index 61bfad0..4f1a5b0 100644
--- a/core/dom/CompositionEvent.idl
+++ b/core/dom/CompositionEvent.idl
@@ -32,7 +32,7 @@
     void initCompositionEvent([Default=Undefined] optional DOMString typeArg, 
                               [Default=Undefined] optional boolean canBubbleArg, 
                               [Default=Undefined] optional boolean cancelableArg, 
-                              [Default=Undefined] optional DOMWindow viewArg, 
+                              [Default=Undefined] optional Window viewArg, 
                               [Default=Undefined] optional DOMString dataArg);
 
 };
diff --git a/core/dom/CustomElementConstructor.idl b/core/dom/CustomElementConstructor.idl
deleted file mode 100644
index 4b6d84f..0000000
--- a/core/dom/CustomElementConstructor.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2012, Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    NoInterfaceObject,
-    EnabledAtRuntime=customDOMElements,
-    WrapAsFunction,
-    CustomLegacyCall
-] interface CustomElementConstructor {
-};
diff --git a/core/dom/DOMError.idl b/core/dom/DOMError.idl
index 5cded18..83522fa 100644
--- a/core/dom/DOMError.idl
+++ b/core/dom/DOMError.idl
@@ -29,5 +29,6 @@
     NoInterfaceObject
 ] interface  DOMError {
     readonly attribute DOMString name;
+    readonly attribute DOMString message;
   };
 
diff --git a/core/dom/DOMCoreException.idl b/core/dom/DOMException.idl
similarity index 98%
rename from core/dom/DOMCoreException.idl
rename to core/dom/DOMException.idl
index 3df6046..d4e9520 100644
--- a/core/dom/DOMCoreException.idl
+++ b/core/dom/DOMException.idl
@@ -28,8 +28,8 @@
 
 [
     DoNotCheckConstants,
-    InterfaceName=DOMException
-] exception DOMCoreException {
+    ImplementedAs=DOMCoreException
+] exception DOMException {
 
     readonly attribute unsigned short   code;
     readonly attribute DOMString        name;
diff --git a/core/dom/Document.idl b/core/dom/Document.idl
index abee356..7afd390 100644
--- a/core/dom/Document.idl
+++ b/core/dom/Document.idl
@@ -18,6 +18,8 @@
  * Boston, MA 02110-1301, USA.
  */
 
+callback CustomElementConstructor = Element ();
+
 [
     CustomToV8
 ] interface Document : Node {
@@ -65,24 +67,26 @@
 
     [RaisesException] Event              createEvent([Default=Undefined] optional DOMString eventType);
 
-    // DOM Level 2 Tranversal and Range (DocumentRange interface)
+    // DOM Level 2 Traversal and Range (DocumentRange interface)
 
     Range              createRange();
 
-    // DOM Level 2 Tranversal and Range (DocumentTraversal interface)
-
-     [RaisesException] NodeIterator createNodeIterator([Default=Undefined] optional Node root,
-                                                   [Default=Undefined] optional unsigned long whatToShow,
-                                                   [Default=Undefined] optional NodeFilter filter,
-                                                   [Default=Undefined] optional boolean expandEntityReferences);
-     [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 Traversal and Range (DocumentTraversal interface)
+    // In DOM4, the fourth argument |expandEntityReferences| is removed.
+    // Historically, this argument was never implemented and has been ignored.
+    // We still receive the argument to keep compatibility, but don't do anything if it's specified.
+    [RaisesException] NodeIterator createNodeIterator(Node root,
+                                                      optional unsigned long whatToShow,
+                                                      optional NodeFilter filter,
+                                                      optional boolean expandEntityReferences);
+    [RaisesException] TreeWalker createTreeWalker(Node root,
+                                                  optional unsigned long whatToShow,
+                                                  optional NodeFilter filter,
+                                                  optional boolean expandEntityReferences);
 
     // DOM Level 2 Abstract Views (DocumentView interface)
 
-    readonly attribute DOMWindow defaultView;
+    readonly attribute Window defaultView;
 
     // DOM Level 2 Style (DocumentStyle interface)
 
@@ -169,21 +173,10 @@
     [RaisesException] Element querySelector(DOMString selectors);
     [RaisesException] NodeList querySelectorAll(DOMString selectors);
 
-    // Mozilla version
-    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitIsFullScreen;
-    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
-    [EnabledAtRuntime=fullscreen] readonly attribute Element webkitCurrentFullScreenElement;
-    [EnabledAtRuntime=fullscreen] void webkitCancelFullScreen();
-
-    // W3C version
-    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullscreenEnabled;
-    [EnabledAtRuntime=fullscreen] readonly attribute Element webkitFullscreenElement;
-    [EnabledAtRuntime=fullscreen] void webkitExitFullscreen();
-
     void webkitExitPointerLock();
     readonly attribute Element webkitPointerLockElement;
 
-    [EnabledAtRuntime=cssRegions] DOMNamedFlowCollection webkitGetNamedFlows();
+    [EnabledAtRuntime=cssRegions] WebKitNamedFlowCollection webkitGetNamedFlows();
 
     [EnabledAtRuntime=fontLoadEvents] readonly attribute FontLoader fontloader;
 
@@ -263,7 +256,7 @@
     [NotEnumerable] attribute EventListener onwebkitpointerlockerror;
     [NotEnumerable, EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute EventListener onsecuritypolicyviolation;
 
-    [EnabledAtRuntime=touch] Touch createTouch([Default=Undefined] optional DOMWindow window,
+    [EnabledAtRuntime=touch] Touch createTouch([Default=Undefined] optional Window window,
                                                [Default=Undefined] optional EventTarget target,
                                                [Default=Undefined] optional long identifier,
                                                [Default=Undefined] optional long pageX,
@@ -276,7 +269,8 @@
                                                [Default=Undefined] optional float webkitForce);
     [EnabledAtRuntime=touch, Custom, RaisesException] TouchList createTouchList();
 
-    [EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, DeliverCustomElementCallbacks, RaisesException] CustomElementConstructor webkitRegister(DOMString name, optional Dictionary options);
+    [DeprecateAs=PrefixedDocumentRegister, EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, DeliverCustomElementCallbacks, RaisesException] CustomElementConstructor webkitRegister(DOMString name, optional Dictionary options);
+    [EnabledAtRuntime=customDOMElements, ImplementedAs=registerElement, CallWith=ScriptState, DeliverCustomElementCallbacks, RaisesException] CustomElementConstructor register(DOMString name, optional Dictionary options);
     [DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension);
     [DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Element createElementNS([TreatNullAs=NullString] DOMString namespaceURI, DOMString qualifiedName,
                             [TreatNullAs=NullString] DOMString typeExtension);
@@ -288,10 +282,8 @@
     // Security Policy API: http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#script-interfaces
     [EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] readonly attribute SecurityPolicy securityPolicy;
 
-    // ParentNode interface API
-    readonly attribute HTMLCollection children;
-    readonly attribute Element firstElementChild;
-    readonly attribute Element lastElementChild;
-    readonly attribute unsigned long childElementCount;
+    readonly attribute HTMLScriptElement currentScript;
 };
 
+Document implements ParentNode;
+
diff --git a/core/dom/DocumentFragment.idl b/core/dom/DocumentFragment.idl
index f02cf18..076c949 100644
--- a/core/dom/DocumentFragment.idl
+++ b/core/dom/DocumentFragment.idl
@@ -19,16 +19,12 @@
 
 [
     Constructor,
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface DocumentFragment : Node {
     // NodeSelector - Selector API
     [RaisesException] Element querySelector(DOMString selectors);
     [RaisesException] NodeList querySelectorAll(DOMString selectors);
-
-    // ParentNode interface API
-    readonly attribute HTMLCollection children;
-    readonly attribute Element firstElementChild;
-    readonly attribute Element lastElementChild;
-    readonly attribute unsigned long childElementCount;
 };
 
+DocumentFragment implements ParentNode;
+
diff --git a/core/dom/DocumentFullscreen.idl b/core/dom/DocumentFullscreen.idl
new file mode 100644
index 0000000..854492e
--- /dev/null
+++ b/core/dom/DocumentFullscreen.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+partial interface Document {
+    // Mozilla version
+    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitIsFullScreen;
+    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullScreenKeyboardInputAllowed;
+    [EnabledAtRuntime=fullscreen] readonly attribute Element webkitCurrentFullScreenElement;
+    [EnabledAtRuntime=fullscreen] void webkitCancelFullScreen();
+
+    // W3C version
+    [EnabledAtRuntime=fullscreen] readonly attribute boolean webkitFullscreenEnabled;
+    [EnabledAtRuntime=fullscreen] readonly attribute Element webkitFullscreenElement;
+    [EnabledAtRuntime=fullscreen] void webkitExitFullscreen();
+};
diff --git a/core/dom/DocumentType.idl b/core/dom/DocumentType.idl
index 352da12..8f192f3 100644
--- a/core/dom/DocumentType.idl
+++ b/core/dom/DocumentType.idl
@@ -29,11 +29,7 @@
 
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString publicId;
     [TreatReturnedNullStringAs=Null] readonly attribute DOMString systemId;
-    [TreatReturnedNullStringAs=Null] readonly attribute DOMString internalSubset;        
-
-    // ChildNode interface API
-    readonly attribute Element previousElementSibling;
-    readonly attribute Element nextElementSibling;
-    [RaisesException] void remove();
+    [TreatReturnedNullStringAs=Null] readonly attribute DOMString internalSubset;
 };
 
+DocumentType implements ChildNode;
diff --git a/core/dom/Element.idl b/core/dom/Element.idl
index bec455c..543a8a1 100644
--- a/core/dom/Element.idl
+++ b/core/dom/Element.idl
@@ -100,22 +100,11 @@
     // WebKit extension, pending specification.
     [RaisesException] boolean webkitMatchesSelector([Default=Undefined] optional DOMString selectors);
 
-    // ParentNode interface API
-    [PerWorldBindings] readonly attribute HTMLCollection children;
-    [PerWorldBindings] readonly attribute Element firstElementChild;
-    [PerWorldBindings] readonly attribute Element lastElementChild;
-    [PerWorldBindings] readonly attribute unsigned long childElementCount;
-
     // ShadowAware API
     [Reflect=pseudo, ImplementedAs=pseudo, PerWorldBindings] attribute DOMString webkitPseudo;
     [ImplementedAs=createShadowRoot, RaisesException] ShadowRoot webkitCreateShadowRoot();
     [ImplementedAs=shadowRoot, PerWorldBindings] readonly attribute ShadowRoot webkitShadowRoot;
 
-    // ChildNode interface API
-    [PerWorldBindings] readonly attribute Element previousElementSibling;
-    [PerWorldBindings] readonly attribute Element nextElementSibling;
-    [RaisesException] void remove();
-
     // CSSOM View Module API
     ClientRectList getClientRects();
     ClientRect getBoundingClientRect();
@@ -205,3 +194,7 @@
     [NotEnumerable, PerWorldBindings] attribute EventListener onwebkitfullscreenchange;
     [NotEnumerable, PerWorldBindings] attribute EventListener onwebkitfullscreenerror;
 };
+
+Element implements ParentNode;
+Element implements ChildNode;
+
diff --git a/core/dom/EventException.idl b/core/dom/EventException.idl
deleted file mode 100644
index 7d05830..0000000
--- a/core/dom/EventException.idl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// Introduced in DOM Level 2:
-[
-    DoNotCheckConstants
-] exception EventException {
-
-    readonly attribute unsigned short   code;
-    readonly attribute DOMString        name;
-    readonly attribute DOMString        message;
-
-    // Override in a Mozilla compatible format
-    [NotEnumerable] DOMString toString();
-
-    // EventExceptionCode
-    const unsigned short UNSPECIFIED_EVENT_TYPE_ERR = 0;
-    const unsigned short DISPATCH_REQUEST_ERR = 1;
-};
-
diff --git a/core/dom/KeyboardEvent.idl b/core/dom/KeyboardEvent.idl
index 6eefd3a..134cb59 100644
--- a/core/dom/KeyboardEvent.idl
+++ b/core/dom/KeyboardEvent.idl
@@ -34,7 +34,7 @@
     void initKeyboardEvent([Default=Undefined] optional DOMString type, 
                            [Default=Undefined] optional boolean canBubble, 
                            [Default=Undefined] optional boolean cancelable, 
-                           [Default=Undefined] optional DOMWindow view, 
+                           [Default=Undefined] optional Window view, 
                            [Default=Undefined] optional DOMString keyIdentifier,
                            [Default=Undefined] optional unsigned long keyLocation,
                            [Default=Undefined] optional boolean ctrlKey,
diff --git a/core/dom/MessageChannel.idl b/core/dom/MessageChannel.idl
index f83d729..ca0e39f 100644
--- a/core/dom/MessageChannel.idl
+++ b/core/dom/MessageChannel.idl
@@ -27,7 +27,7 @@
 [
     GlobalContext=WindowAndWorker,
     Constructor,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     CustomConstructor
 ] interface MessageChannel {
 
diff --git a/core/dom/MessageEvent.idl b/core/dom/MessageEvent.idl
index 66adad2..540b17d 100644
--- a/core/dom/MessageEvent.idl
+++ b/core/dom/MessageEvent.idl
@@ -31,7 +31,7 @@
 ] interface MessageEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString origin;
     [InitializedByEventConstructor] readonly attribute DOMString lastEventId;
-    [InitializedByEventConstructor] readonly attribute DOMWindow source;
+    [InitializedByEventConstructor] readonly attribute Window source;
     [InitializedByEventConstructor, CustomGetter] readonly attribute any data;
     [InitializedByEventConstructor] readonly attribute MessagePort[] ports;
 
@@ -41,7 +41,7 @@
                                    [Default=Undefined] optional any dataArg, 
                                    [Default=Undefined] optional DOMString originArg, 
                                    [Default=Undefined] optional DOMString lastEventIdArg, 
-                                   [Default=Undefined] optional DOMWindow sourceArg, 
+                                   [Default=Undefined] optional Window sourceArg, 
                                    [Default=Undefined] optional Array messagePorts);
 
     [Custom] void webkitInitMessageEvent([Default=Undefined] optional DOMString typeArg,
@@ -50,7 +50,7 @@
                                          [Default=Undefined] optional any dataArg,
                                          [Default=Undefined] optional DOMString originArg,
                                          [Default=Undefined] optional DOMString lastEventIdArg,
-                                         [Default=Undefined] optional DOMWindow sourceArg,
+                                         [Default=Undefined] optional Window sourceArg,
                                          [Default=Undefined] optional Array transferables);
 };
 
diff --git a/core/dom/MouseEvent.idl b/core/dom/MouseEvent.idl
index 5465735..516cb1e 100644
--- a/core/dom/MouseEvent.idl
+++ b/core/dom/MouseEvent.idl
@@ -36,7 +36,7 @@
      void initMouseEvent([Default=Undefined] optional DOMString type, 
                                        [Default=Undefined] optional boolean canBubble, 
                                        [Default=Undefined] optional boolean cancelable, 
-                                       [Default=Undefined] optional DOMWindow view, 
+                                       [Default=Undefined] optional Window view, 
                                        [Default=Undefined] optional long detail, 
                                        [Default=Undefined] optional long screenX, 
                                        [Default=Undefined] optional long screenY, 
diff --git a/core/dom/ParentNode.idl b/core/dom/ParentNode.idl
new file mode 100644
index 0000000..10b418e
--- /dev/null
+++ b/core/dom/ParentNode.idl
@@ -0,0 +1,9 @@
+[
+    NoInterfaceObject
+] interface ParentNode {
+    [PerWorldBindings] readonly attribute HTMLCollection children;
+    [PerWorldBindings] readonly attribute Element firstElementChild;
+    [PerWorldBindings] readonly attribute Element lastElementChild;
+    [PerWorldBindings] readonly attribute unsigned long childElementCount;
+};
+
diff --git a/core/page/DOMWindowPagePopup.idl b/core/dom/Promise.idl
similarity index 87%
copy from core/page/DOMWindowPagePopup.idl
copy to core/dom/Promise.idl
index 2ce0bec..893b8ee 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/core/dom/Promise.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,7 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+   CustomConstructor(any init),
+   EnabledAtRuntime=promise
+] interface Promise {
 };
diff --git a/core/page/DOMWindowPagePopup.idl b/core/dom/PromiseResolver.idl
similarity index 87%
copy from core/page/DOMWindowPagePopup.idl
copy to core/dom/PromiseResolver.idl
index 2ce0bec..86fe307 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/core/dom/PromiseResolver.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,6 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+   EnabledAtRuntime=promise
+] interface PromiseResolver {
 };
diff --git a/core/dom/Range.idl b/core/dom/Range.idl
index f816069..8418229 100644
--- a/core/dom/Range.idl
+++ b/core/dom/Range.idl
@@ -21,7 +21,7 @@
 // Introduced in DOM Level 2:
 [
     Constructor,
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface Range {
 
     [GetterRaisesException] readonly attribute Node startContainer;
diff --git a/core/dom/SecurityPolicyViolationEvent.idl b/core/dom/SecurityPolicyViolationEvent.idl
index b214e6f..528b0cc 100644
--- a/core/dom/SecurityPolicyViolationEvent.idl
+++ b/core/dom/SecurityPolicyViolationEvent.idl
@@ -23,7 +23,7 @@
  */
 
 [
-    NoInterfaceObject,
+    EnabledAtRuntime=experimentalContentSecurityPolicyFeatures,
     ConstructorTemplate=Event
 ] interface SecurityPolicyViolationEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString documentURI;
diff --git a/core/dom/Text.idl b/core/dom/Text.idl
index f8b1a15..a770f78 100644
--- a/core/dom/Text.idl
+++ b/core/dom/Text.idl
@@ -18,7 +18,7 @@
  */
 [
     Constructor([Default=NullString] optional DOMString data),
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     CustomToV8
 ] interface Text : CharacterData {
 
diff --git a/core/dom/TextEvent.idl b/core/dom/TextEvent.idl
index 4af1a6f..10ec19a 100644
--- a/core/dom/TextEvent.idl
+++ b/core/dom/TextEvent.idl
@@ -31,7 +31,7 @@
     void initTextEvent([Default=Undefined] optional DOMString typeArg, 
                        [Default=Undefined] optional boolean canBubbleArg, 
                        [Default=Undefined] optional boolean cancelableArg, 
-                       [Default=Undefined] optional DOMWindow viewArg, 
+                       [Default=Undefined] optional Window viewArg, 
                        [Default=Undefined] optional DOMString dataArg);
 
 };
diff --git a/core/dom/Touch.idl b/core/dom/Touch.idl
index 2d89c3b..c748ec8 100644
--- a/core/dom/Touch.idl
+++ b/core/dom/Touch.idl
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    NoInterfaceObject
-] interface Touch {
+interface Touch {
     readonly attribute long             clientX;
     readonly attribute long             clientY;
     readonly attribute long             screenX;
diff --git a/core/dom/TouchEvent.idl b/core/dom/TouchEvent.idl
index c0838a8..6348e68 100644
--- a/core/dom/TouchEvent.idl
+++ b/core/dom/TouchEvent.idl
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    NoInterfaceObject
-] interface TouchEvent : UIEvent {
+interface TouchEvent : UIEvent {
     readonly attribute TouchList touches;
     readonly attribute TouchList targetTouches;
     readonly attribute TouchList changedTouches;
@@ -38,7 +36,7 @@
                         [Default=Undefined] optional TouchList targetTouches,
                         [Default=Undefined] optional TouchList changedTouches,
                         [Default=Undefined] optional DOMString type,
-                        [Default=Undefined] optional DOMWindow view,
+                        [Default=Undefined] optional Window view,
                         [Default=Undefined] optional long screenX, 
                         [Default=Undefined] optional long screenY, 
                         [Default=Undefined] optional long clientX, 
diff --git a/core/dom/TouchList.idl b/core/dom/TouchList.idl
index 19900ac..351a59c 100644
--- a/core/dom/TouchList.idl
+++ b/core/dom/TouchList.idl
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    NoInterfaceObject
-] interface TouchList {
+interface TouchList {
     readonly attribute unsigned long length;
 
     getter Touch item(unsigned long index);
diff --git a/core/dom/TreeWalker.idl b/core/dom/TreeWalker.idl
index 2188bef..3a844b7 100644
--- a/core/dom/TreeWalker.idl
+++ b/core/dom/TreeWalker.idl
@@ -19,9 +19,7 @@
  */
 
 // Introduced in DOM Level 2:
-[
-    NoInterfaceObject
-] interface TreeWalker {
+interface TreeWalker {
     readonly attribute Node root;
     readonly attribute unsigned long whatToShow;
     readonly attribute NodeFilter filter;
diff --git a/core/dom/UIEvent.idl b/core/dom/UIEvent.idl
index 415078a..09960d7 100644
--- a/core/dom/UIEvent.idl
+++ b/core/dom/UIEvent.idl
@@ -20,13 +20,13 @@
 [
     ConstructorTemplate=Event
 ] interface UIEvent : Event {
-    [InitializedByEventConstructor] readonly attribute DOMWindow view;
+    [InitializedByEventConstructor] readonly attribute Window view;
     [InitializedByEventConstructor] readonly attribute long detail;
     
      void initUIEvent([Default=Undefined] optional DOMString type, 
                                     [Default=Undefined] optional boolean canBubble, 
                                     [Default=Undefined] optional boolean cancelable, 
-                                    [Default=Undefined] optional DOMWindow view, 
+                                    [Default=Undefined] optional Window view, 
                                     [Default=Undefined] optional long detail);
 
     // extensions
diff --git a/core/dom/AnimationEvent.idl b/core/dom/WebKitAnimationEvent.idl
similarity index 95%
rename from core/dom/AnimationEvent.idl
rename to core/dom/WebKitAnimationEvent.idl
index 46ff164..e53b4e7 100644
--- a/core/dom/AnimationEvent.idl
+++ b/core/dom/WebKitAnimationEvent.idl
@@ -25,8 +25,8 @@
 
 [
     ConstructorTemplate=Event,
-    InterfaceName=WebKitAnimationEvent
-] interface AnimationEvent : Event {
+    ImplementedAs=AnimationEvent
+] interface WebKitAnimationEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString animationName;
     [InitializedByEventConstructor] readonly attribute double elapsedTime;
 };
diff --git a/core/dom/NamedFlow.idl b/core/dom/WebKitNamedFlow.idl
similarity index 97%
rename from core/dom/NamedFlow.idl
rename to core/dom/WebKitNamedFlow.idl
index ae2cfeb..5a008bd 100644
--- a/core/dom/NamedFlow.idl
+++ b/core/dom/WebKitNamedFlow.idl
@@ -31,9 +31,9 @@
     NoInterfaceObject,
     EnabledAtRuntime=cssRegions,
     EventTarget,
-    InterfaceName=WebKitNamedFlow,
+    ImplementedAs=NamedFlow,
     GenerateIsReachable=ownerNode
-] interface NamedFlow {
+] interface WebKitNamedFlow {
     readonly attribute DOMString name;
     readonly attribute boolean overset;
     readonly attribute long firstEmptyRegionIndex;
diff --git a/core/dom/DOMNamedFlowCollection.idl b/core/dom/WebKitNamedFlowCollection.idl
similarity index 84%
rename from core/dom/DOMNamedFlowCollection.idl
rename to core/dom/WebKitNamedFlowCollection.idl
index 1ec92f4..65aa56d 100644
--- a/core/dom/DOMNamedFlowCollection.idl
+++ b/core/dom/WebKitNamedFlowCollection.idl
@@ -30,10 +30,10 @@
 [
     NoInterfaceObject,
     EnabledAtRuntime=cssRegions,
-    InterfaceName=WebKitNamedFlowCollection
-] interface DOMNamedFlowCollection {
+    ImplementedAs=DOMNamedFlowCollection
+] interface WebKitNamedFlowCollection {
     readonly attribute unsigned long length;
-    getter NamedFlow item(unsigned long index);
-    NamedFlow namedItem(DOMString name);
-    [NotEnumerable, ImplementedAs=namedItem] getter NamedFlow (DOMString name);
+    getter WebKitNamedFlow item(unsigned long index);
+    WebKitNamedFlow namedItem(DOMString name);
+    [NotEnumerable, ImplementedAs=namedItem] getter WebKitNamedFlow (DOMString name);
 };
diff --git a/core/dom/WheelEvent.idl b/core/dom/WheelEvent.idl
index ec923b3..6c8dad4 100644
--- a/core/dom/WheelEvent.idl
+++ b/core/dom/WheelEvent.idl
@@ -36,7 +36,7 @@
 
     void initWebKitWheelEvent([Default=Undefined] optional long wheelDeltaX,
                               [Default=Undefined] optional long wheelDeltaY, 
-                              [Default=Undefined] optional DOMWindow view, 
+                              [Default=Undefined] optional Window view, 
                               [Default=Undefined] optional long screenX,
                               [Default=Undefined] optional long screenY,
                               [Default=Undefined] optional long clientX,
diff --git a/core/dom/shadow/ShadowRoot.idl b/core/dom/shadow/ShadowRoot.idl
index 39488df..6a6e07e 100644
--- a/core/dom/shadow/ShadowRoot.idl
+++ b/core/dom/shadow/ShadowRoot.idl
@@ -30,6 +30,7 @@
     readonly attribute Element activeElement;
     attribute boolean applyAuthorStyles;
     attribute boolean resetStyleInheritance;
+    [EnabledAtRuntime=experimentalShadowDOM, ImplementedAs=bindingsOlderShadowRoot] readonly attribute ShadowRoot olderShadowRoot;
 
     [TreatNullAs=NullString, DeliverCustomElementCallbacks, PerWorldBindings, ActivityLog=SetterForIsolatedWorlds, SetterRaisesException] attribute DOMString innerHTML;
 
diff --git a/core/fileapi/FileReader.idl b/core/fileapi/FileReader.idl
index f7da1cc..a9bf2e5 100644
--- a/core/fileapi/FileReader.idl
+++ b/core/fileapi/FileReader.idl
@@ -33,7 +33,7 @@
     GlobalContext=WindowAndWorker,
     ActiveDOMObject,
     Constructor,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface FileReader {
     // ready states
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/core/fileapi/Stream.idl
similarity index 79%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to core/fileapi/Stream.idl
index 20a0215..7caf013 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/core/fileapi/Stream.idl
@@ -27,8 +27,17 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+
+// FIXME: close() method which is necessary for Stream building feature
+// is omitted for now. Add it when necessary.
+//
+// FIXME: Add a flag to indicate if this stream frees memory when read or not
+// (e.g. boolean isReadOnce()).
+//
+// FIXME: Make the Blob a subclass of the Stream.
+
+[
+    EnabledAtRuntime=stream
+] interface Stream {
+    readonly attribute DOMString type;
+};
diff --git a/core/html/HTMLFrameElement.idl b/core/html/HTMLFrameElement.idl
index ec98564..c702fd6 100644
--- a/core/html/HTMLFrameElement.idl
+++ b/core/html/HTMLFrameElement.idl
@@ -33,7 +33,7 @@
     [CheckSecurityForNode] readonly attribute Document contentDocument;
 
     // Extensions
-    readonly attribute DOMWindow contentWindow;
+    readonly attribute Window contentWindow;
 
     [CheckSecurityForNode, RaisesException] SVGDocument getSVGDocument();
 
diff --git a/core/html/HTMLFrameSetElement.idl b/core/html/HTMLFrameSetElement.idl
index 8781d36..09c262c 100644
--- a/core/html/HTMLFrameSetElement.idl
+++ b/core/html/HTMLFrameSetElement.idl
@@ -19,7 +19,7 @@
  */
 
 interface HTMLFrameSetElement : HTMLElement {
-    [ImplementedAs=anonymousNamedGetter, OverrideBuiltins, NotEnumerable] getter DOMWindow (DOMString name);
+    [ImplementedAs=anonymousNamedGetter, OverrideBuiltins, NotEnumerable] getter Window (DOMString name);
     [Reflect] attribute DOMString cols;
     [Reflect] attribute DOMString rows;
 
diff --git a/core/html/HTMLIFrameElement.idl b/core/html/HTMLIFrameElement.idl
index b73c764..bc93aa3 100644
--- a/core/html/HTMLIFrameElement.idl
+++ b/core/html/HTMLIFrameElement.idl
@@ -37,7 +37,7 @@
     [CheckSecurityForNode] readonly attribute Document contentDocument;
 
     // Extensions
-    readonly attribute DOMWindow contentWindow;
+    readonly attribute Window contentWindow;
 
     [CheckSecurityForNode, RaisesException] SVGDocument getSVGDocument();
 };
diff --git a/core/html/HTMLLinkElement.idl b/core/html/HTMLLinkElement.idl
index d5db95d..0d5ee7d 100644
--- a/core/html/HTMLLinkElement.idl
+++ b/core/html/HTMLLinkElement.idl
@@ -34,6 +34,6 @@
     // DOM Level 2 Style
     readonly attribute StyleSheet sheet;
 
-    [EnabledAtRuntime=htmlImports] readonly attribute DocumentFragment import;
+    [EnabledAtRuntime=htmlImports] readonly attribute Document import;
 };
 
diff --git a/core/html/HTMLMediaElement.idl b/core/html/HTMLMediaElement.idl
index 5db5f75..10ebf8a 100644
--- a/core/html/HTMLMediaElement.idl
+++ b/core/html/HTMLMediaElement.idl
@@ -97,9 +97,7 @@
 [EnabledAtRuntime=legacyEncryptedMedia] attribute EventListener onwebkitkeymessage;
 [EnabledAtRuntime=legacyEncryptedMedia] attribute EventListener onwebkitneedkey;
 
-#if defined(ENABLE_ENCRYPTED_MEDIA_V2) && ENABLE_ENCRYPTED_MEDIA_V2
-[EnabledAtRuntime=encryptedMedia] attribute MediaKeys mediaKeys;
-#endif
+[EnabledAtRuntime=encryptedMedia, Conditional=ENCRYPTED_MEDIA_V2] attribute MediaKeys mediaKeys;
 
 [EnabledAtRuntime=videoTrack, RaisesException] TextTrack addTextTrack(DOMString kind, optional DOMString label, optional DOMString language);
 [EnabledAtRuntime=videoTrack] readonly attribute TextTrackList textTracks;
diff --git a/core/html/HTMLOptionElement.idl b/core/html/HTMLOptionElement.idl
index e47ca9f..d315551 100644
--- a/core/html/HTMLOptionElement.idl
+++ b/core/html/HTMLOptionElement.idl
@@ -20,7 +20,7 @@
 
 [
     NamedConstructor=Option([Default=NullString] optional DOMString data, [Default=NullString] optional DOMString value, [Default=Undefined] optional boolean defaultSelected, [Default=Undefined] optional boolean selected),
-    RaisesException
+    ConstructorRaisesException
 ] interface HTMLOptionElement : HTMLElement {
     [Reflect] attribute boolean disabled;
     readonly attribute HTMLFormElement form;
diff --git a/core/html/HTMLSourceElement.idl b/core/html/HTMLSourceElement.idl
index 763a084..4502f86 100644
--- a/core/html/HTMLSourceElement.idl
+++ b/core/html/HTMLSourceElement.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    NoInterfaceObject
+    EnabledAtRuntime=media
 ] interface HTMLSourceElement : HTMLElement {
 [Reflect, URL] attribute DOMString src;
     attribute DOMString type;
diff --git a/core/html/MediaController.idl b/core/html/MediaController.idl
index cedb4c3..54c4153 100644
--- a/core/html/MediaController.idl
+++ b/core/html/MediaController.idl
@@ -24,9 +24,9 @@
  */
 
 [
-    NoInterfaceObject,
+    EnabledAtRuntime=media,
     Constructor,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface MediaController {
     readonly attribute TimeRanges buffered;
diff --git a/core/html/MediaError.idl b/core/html/MediaError.idl
index 0e12164..16d339f 100644
--- a/core/html/MediaError.idl
+++ b/core/html/MediaError.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    NoInterfaceObject
+    EnabledAtRuntime=media
 ] interface MediaError {
       const unsigned short MEDIA_ERR_ABORTED = 1;
       const unsigned short MEDIA_ERR_NETWORK = 2;
diff --git a/core/html/TimeRanges.idl b/core/html/TimeRanges.idl
index eba7735..c6ad136 100644
--- a/core/html/TimeRanges.idl
+++ b/core/html/TimeRanges.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    NoInterfaceObject
+    EnabledAtRuntime=media
 ] interface TimeRanges {
     readonly attribute unsigned long length;
     [RaisesException] double start(unsigned long index);
diff --git a/core/html/URL.idl b/core/html/URL.idl
index 7e5e300..b631c4c 100644
--- a/core/html/URL.idl
+++ b/core/html/URL.idl
@@ -29,6 +29,7 @@
     Constructor,
     ImplementedAs=DOMURL
 ] interface URL {
+    [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaSource? source);
     [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(WebKitMediaSource? source);
     [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(MediaStream? stream);
     [CallWith=ScriptExecutionContext,TreatReturnedNullStringAs=Null] static DOMString createObjectURL(Blob? blob);
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/core/html/canvas/ANGLEInstancedArrays.idl
similarity index 74%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to core/html/canvas/ANGLEInstancedArrays.idl
index 20a0215..487b8cd 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/core/html/canvas/ANGLEInstancedArrays.idl
@@ -27,8 +27,14 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+
+[
+    NoInterfaceObject,
+    DoNotCheckConstants
+] interface ANGLEInstancedArrays {
+    const unsigned long VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+
+    [StrictTypeChecking] void drawArraysInstancedANGLE(unsigned long mode, long first, long count, long primcount);
+    [StrictTypeChecking] void drawElementsInstancedANGLE(unsigned long mode, long count, unsigned long type, long long offset, long primcount);
+    [StrictTypeChecking] void vertexAttribDivisorANGLE(unsigned long index, long divisor); 
+};
diff --git a/core/html/canvas/CanvasGradient.idl b/core/html/canvas/CanvasGradient.idl
index 0e07d5e..4d06b83 100644
--- a/core/html/canvas/CanvasGradient.idl
+++ b/core/html/canvas/CanvasGradient.idl
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,8 +26,7 @@
 [
 ] interface CanvasGradient {
 
-    [RaisesException] void addColorStop([Default=Undefined] optional float offset, 
-                      [Default=Undefined] optional DOMString color);
+    [RaisesException] void addColorStop(float offset, DOMString color);
 
 };
 
diff --git a/core/html/canvas/DataView.idl b/core/html/canvas/DataView.idl
index c814a6b..5ff575d 100644
--- a/core/html/canvas/DataView.idl
+++ b/core/html/canvas/DataView.idl
@@ -30,11 +30,8 @@
 ] interface DataView : ArrayBufferView {
     // All these methods raise an exception if they would read or write beyond the end of the view.
 
-    // We have to use custom code because our code generator does not support int8_t type.
-    // int8_t getInt8(unsigned long byteOffset);
-    // uint8_t getUint8(unsigned long byteOffset);
-    [Custom, RaisesException] any getInt8();
-    [Custom, RaisesException] any getUint8();
+    [RaisesException] byte getInt8(unsigned long byteOffset);
+    [RaisesException] octet getUint8(unsigned long byteOffset);
 
     [StrictTypeChecking, RaisesException] short getInt16(unsigned long byteOffset, optional boolean littleEndian);
     [StrictTypeChecking, RaisesException] unsigned short getUint16(unsigned long byteOffset, optional boolean littleEndian);
@@ -45,11 +42,8 @@
     [StrictTypeChecking, RaisesException] float getFloat32(unsigned long byteOffset, optional boolean littleEndian);
     [StrictTypeChecking, RaisesException] double getFloat64(unsigned long byteOffset, optional boolean littleEndian);
 
-    // We have to use custom code because our code generator does not support uint8_t type.
-    // void setInt8(unsigned long byteOffset, int8_t value);
-    // void setUint8(unsigned long byteOffset, uint8_t value);
-    [Custom, RaisesException] void setInt8();
-    [Custom, RaisesException] void setUint8();
+    [RaisesException] void setInt8(unsigned long byteOffset, byte value);
+    [RaisesException] void setUint8(unsigned long byteOffset, octet value);
 
     [StrictTypeChecking, RaisesException] void setInt16(unsigned long byteOffset, short value, optional boolean littleEndian);
     [StrictTypeChecking, RaisesException] void setUint16(unsigned long byteOffset, unsigned short value, optional boolean littleEndian);
diff --git a/core/html/canvas/EXTDrawBuffers.idl b/core/html/canvas/EXTDrawBuffers.idl
deleted file mode 100644
index f292642..0000000
--- a/core/html/canvas/EXTDrawBuffers.idl
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-typedef unsigned long GLenum;
-
-[
-    NoInterfaceObject,
-    DoNotCheckConstants
-] interface EXTDrawBuffers {
-    const GLenum COLOR_ATTACHMENT0_EXT = 0x8CE0;
-    const GLenum COLOR_ATTACHMENT1_EXT = 0x8CE1;
-    const GLenum COLOR_ATTACHMENT2_EXT = 0x8CE2;
-    const GLenum COLOR_ATTACHMENT3_EXT = 0x8CE3;
-    const GLenum COLOR_ATTACHMENT4_EXT = 0x8CE4;
-    const GLenum COLOR_ATTACHMENT5_EXT = 0x8CE5;
-    const GLenum COLOR_ATTACHMENT6_EXT = 0x8CE6;
-    const GLenum COLOR_ATTACHMENT7_EXT = 0x8CE7;
-    const GLenum COLOR_ATTACHMENT8_EXT = 0x8CE8;
-    const GLenum COLOR_ATTACHMENT9_EXT = 0x8CE9;
-    const GLenum COLOR_ATTACHMENT10_EXT = 0x8CEA;
-    const GLenum COLOR_ATTACHMENT11_EXT = 0x8CEB;
-    const GLenum COLOR_ATTACHMENT12_EXT = 0x8CEC;
-    const GLenum COLOR_ATTACHMENT13_EXT = 0x8CED;
-    const GLenum COLOR_ATTACHMENT14_EXT = 0x8CEE;
-    const GLenum COLOR_ATTACHMENT15_EXT = 0x8CEF;
-
-    const GLenum DRAW_BUFFER0_EXT = 0x8825;
-    const GLenum DRAW_BUFFER1_EXT = 0x8826;
-    const GLenum DRAW_BUFFER2_EXT = 0x8827;
-    const GLenum DRAW_BUFFER3_EXT = 0x8828;
-    const GLenum DRAW_BUFFER4_EXT = 0x8829;
-    const GLenum DRAW_BUFFER5_EXT = 0x882A;
-    const GLenum DRAW_BUFFER6_EXT = 0x882B;
-    const GLenum DRAW_BUFFER7_EXT = 0x882C;
-    const GLenum DRAW_BUFFER8_EXT = 0x882D;
-    const GLenum DRAW_BUFFER9_EXT = 0x882E;
-    const GLenum DRAW_BUFFER10_EXT = 0x882F;
-    const GLenum DRAW_BUFFER11_EXT = 0x8830;
-    const GLenum DRAW_BUFFER12_EXT = 0x8831;
-    const GLenum DRAW_BUFFER13_EXT = 0x8832;
-    const GLenum DRAW_BUFFER14_EXT = 0x8833;
-    const GLenum DRAW_BUFFER15_EXT = 0x8834;
-
-    const GLenum MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF;
-    const GLenum MAX_DRAW_BUFFERS_EXT = 0x8824;
-
-    void drawBuffersEXT(sequence<GLenum> buffers);
-};
diff --git a/core/html/canvas/WebGLCompressedTextureS3TC.idl b/core/html/canvas/WebGLCompressedTextureS3TC.idl
index e7c18a1..6f1973d 100644
--- a/core/html/canvas/WebGLCompressedTextureS3TC.idl
+++ b/core/html/canvas/WebGLCompressedTextureS3TC.idl
@@ -28,8 +28,8 @@
     DoNotCheckConstants
 ] interface WebGLCompressedTextureS3TC {
     /* Compressed Texture Formats */
-    const unsigned int COMPRESSED_RGB_S3TC_DXT1_EXT        = 0x83F0;
-    const unsigned int COMPRESSED_RGBA_S3TC_DXT1_EXT       = 0x83F1;
-    const unsigned int COMPRESSED_RGBA_S3TC_DXT3_EXT       = 0x83F2;
-    const unsigned int COMPRESSED_RGBA_S3TC_DXT5_EXT       = 0x83F3;
+    const unsigned long COMPRESSED_RGB_S3TC_DXT1_EXT        = 0x83F0;
+    const unsigned long COMPRESSED_RGBA_S3TC_DXT1_EXT       = 0x83F1;
+    const unsigned long COMPRESSED_RGBA_S3TC_DXT3_EXT       = 0x83F2;
+    const unsigned long COMPRESSED_RGBA_S3TC_DXT5_EXT       = 0x83F3;
 };
diff --git a/core/html/canvas/WebGLDrawBuffers.idl b/core/html/canvas/WebGLDrawBuffers.idl
new file mode 100644
index 0000000..d1a0f5f
--- /dev/null
+++ b/core/html/canvas/WebGLDrawBuffers.idl
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef unsigned long GLenum;
+
+[
+    NoInterfaceObject,
+    DoNotCheckConstants
+] interface WebGLDrawBuffers {
+    const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
+    const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
+    const GLenum COLOR_ATTACHMENT2_WEBGL = 0x8CE2;
+    const GLenum COLOR_ATTACHMENT3_WEBGL = 0x8CE3;
+    const GLenum COLOR_ATTACHMENT4_WEBGL = 0x8CE4;
+    const GLenum COLOR_ATTACHMENT5_WEBGL = 0x8CE5;
+    const GLenum COLOR_ATTACHMENT6_WEBGL = 0x8CE6;
+    const GLenum COLOR_ATTACHMENT7_WEBGL = 0x8CE7;
+    const GLenum COLOR_ATTACHMENT8_WEBGL = 0x8CE8;
+    const GLenum COLOR_ATTACHMENT9_WEBGL = 0x8CE9;
+    const GLenum COLOR_ATTACHMENT10_WEBGL = 0x8CEA;
+    const GLenum COLOR_ATTACHMENT11_WEBGL = 0x8CEB;
+    const GLenum COLOR_ATTACHMENT12_WEBGL = 0x8CEC;
+    const GLenum COLOR_ATTACHMENT13_WEBGL = 0x8CED;
+    const GLenum COLOR_ATTACHMENT14_WEBGL = 0x8CEE;
+    const GLenum COLOR_ATTACHMENT15_WEBGL = 0x8CEF;
+
+    const GLenum DRAW_BUFFER0_WEBGL = 0x8825;
+    const GLenum DRAW_BUFFER1_WEBGL = 0x8826;
+    const GLenum DRAW_BUFFER2_WEBGL = 0x8827;
+    const GLenum DRAW_BUFFER3_WEBGL = 0x8828;
+    const GLenum DRAW_BUFFER4_WEBGL = 0x8829;
+    const GLenum DRAW_BUFFER5_WEBGL = 0x882A;
+    const GLenum DRAW_BUFFER6_WEBGL = 0x882B;
+    const GLenum DRAW_BUFFER7_WEBGL = 0x882C;
+    const GLenum DRAW_BUFFER8_WEBGL = 0x882D;
+    const GLenum DRAW_BUFFER9_WEBGL = 0x882E;
+    const GLenum DRAW_BUFFER10_WEBGL = 0x882F;
+    const GLenum DRAW_BUFFER11_WEBGL = 0x8830;
+    const GLenum DRAW_BUFFER12_WEBGL = 0x8831;
+    const GLenum DRAW_BUFFER13_WEBGL = 0x8832;
+    const GLenum DRAW_BUFFER14_WEBGL = 0x8833;
+    const GLenum DRAW_BUFFER15_WEBGL = 0x8834;
+
+    const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
+    const GLenum MAX_DRAW_BUFFERS_WEBGL = 0x8824;
+
+    void drawBuffersWEBGL(sequence<GLenum> buffers);
+};
diff --git a/core/html/shadow/HTMLShadowElement.idl b/core/html/shadow/HTMLShadowElement.idl
index a252e14..3b6351b 100644
--- a/core/html/shadow/HTMLShadowElement.idl
+++ b/core/html/shadow/HTMLShadowElement.idl
@@ -30,5 +30,5 @@
 
 interface HTMLShadowElement : HTMLElement {
     attribute boolean resetStyleInheritance;
-    readonly attribute ShadowRoot olderShadowRoot;
+    [DeprecateAs=HTMLShadowElementOlderShadowRoot] readonly attribute ShadowRoot olderShadowRoot;
 };
diff --git a/core/html/track/TextTrack.idl b/core/html/track/TextTrack.idl
index 00a44a8..c1b39ff 100644
--- a/core/html/track/TextTrack.idl
+++ b/core/html/track/TextTrack.idl
@@ -40,11 +40,9 @@
     void addCue(TextTrackCue cue);
     [RaisesException] void removeCue(TextTrackCue cue);
 
-#if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
-    readonly attribute TextTrackRegionList regions;
-    void addRegion(TextTrackRegion region);
-    [RaisesException] void removeRegion(TextTrackRegion region);
-#endif
+    [Conditional=WEBVTT_REGIONS] readonly attribute TextTrackRegionList regions;
+    [Conditional=WEBVTT_REGIONS] void addRegion(TextTrackRegion region);
+    [RaisesException, Conditional=WEBVTT_REGIONS] void removeRegion(TextTrackRegion region);
 
     // EventTarget interface
     void addEventListener(DOMString type,
diff --git a/core/html/track/TextTrackCue.idl b/core/html/track/TextTrackCue.idl
index 88725a4..962f695 100644
--- a/core/html/track/TextTrackCue.idl
+++ b/core/html/track/TextTrackCue.idl
@@ -26,7 +26,7 @@
 [
     EnabledAtRuntime=videoTrack,
     Constructor(double startTime, double endTime, DOMString text),
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface TextTrackCue {
     readonly attribute TextTrack track;
@@ -58,8 +58,6 @@
                              optional boolean useCapture);
     [RaisesException] boolean dispatchEvent(Event evt);
 
-#if defined(ENABLE_WEBVTT_REGIONS) && ENABLE_WEBVTT_REGIONS
-    attribute DOMString regionId;
-#endif
+    [Conditional=WEBVTT_REGIONS] attribute DOMString regionId;
 };
 
diff --git a/core/html/track/TextTrackRegion.idl b/core/html/track/TextTrackRegion.idl
index 54421aa..104abba 100644
--- a/core/html/track/TextTrackRegion.idl
+++ b/core/html/track/TextTrackRegion.idl
@@ -27,7 +27,7 @@
     Conditional=WEBVTT_REGIONS,
     Constructor(),
     EnabledAtRuntime=videoTrack,
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface TextTrackRegion {
     readonly attribute TextTrack track;
 
diff --git a/core/inspector/CodeGeneratorInspector.py b/core/inspector/CodeGeneratorInspector.py
index 481682b..4c81796 100755
--- a/core/inspector/CodeGeneratorInspector.py
+++ b/core/inspector/CodeGeneratorInspector.py
@@ -226,7 +226,11 @@
 
         @classmethod
         def get_raw_validator_call_text(cls):
-            return "RuntimeCastHelper::assertType<InspectorValue::Type%s>" % cls.get_validate_method_params().template_type
+            return "RuntimeCastHelper::assertType<JSONValue::Type%s>" % cls.get_validate_method_params().template_type
+
+        @staticmethod
+        def get_validate_method_params():
+            raise Exception("Abstract method")
 
     class String(BaseType):
         @staticmethod
@@ -236,6 +240,10 @@
         get_setter_name = get_getter_name
 
         @staticmethod
+        def get_constructor_pattern():
+            return "InspectorString::create(%s)"
+
+        @staticmethod
         def get_c_initializer():
             return "\"\""
 
@@ -271,6 +279,10 @@
             return "Number"
 
         @staticmethod
+        def get_constructor_pattern():
+            return "InspectorBasicValue::create(%s)"
+
+        @staticmethod
         def get_c_initializer():
             return "0"
 
@@ -304,6 +316,10 @@
             return "Number"
 
         @staticmethod
+        def get_constructor_pattern():
+            return "InspectorBasicValue::create(%s)"
+
+        @staticmethod
         def get_c_initializer():
             return "0"
 
@@ -337,6 +353,10 @@
         get_setter_name = get_getter_name
 
         @staticmethod
+        def get_constructor_pattern():
+            return "InspectorBasicValue::create(%s)"
+
+        @staticmethod
         def get_c_initializer():
             return "false"
 
@@ -372,8 +392,12 @@
             return "Value"
 
         @staticmethod
+        def get_constructor_pattern():
+            return "%s"
+
+        @staticmethod
         def get_c_initializer():
-            return "InspectorObject::create()"
+            return "JSONObject::create()"
 
         @staticmethod
         def get_output_argument_prefix():
@@ -395,7 +419,7 @@
 
         @staticmethod
         def get_array_item_raw_c_type_text():
-            return "InspectorObject"
+            return "JSONObject"
 
         @staticmethod
         def get_raw_type_model():
@@ -413,6 +437,10 @@
             raise Exception("Unsupported")
 
         @staticmethod
+        def get_constructor_pattern():
+            raise Exception("Unsupported")
+
+        @staticmethod
         def get_raw_validator_call_text():
             return "RuntimeCastHelper::assertAny"
 
@@ -426,7 +454,7 @@
 
         @staticmethod
         def get_array_item_raw_c_type_text():
-            return "InspectorValue"
+            return "JSONValue"
 
         @staticmethod
         def get_raw_type_model():
@@ -442,8 +470,12 @@
             return "Value"
 
         @staticmethod
+        def get_constructor_pattern():
+            return "%s"
+
+        @staticmethod
         def get_c_initializer():
-            return "InspectorArray::create()"
+            return "JSONArray::create()"
 
         @staticmethod
         def get_output_argument_prefix():
@@ -465,7 +497,7 @@
 
         @staticmethod
         def get_array_item_raw_c_type_text():
-            return "InspectorArray"
+            return "JSONArray"
 
         @staticmethod
         def get_raw_type_model():
@@ -662,14 +694,14 @@
             cls.Int = cls.ValueType("int", False)
         cls.Number = cls.ValueType("double", False)
         cls.String = cls.ValueType("String", True,)
-        cls.Object = cls.RefPtrBased("InspectorObject")
-        cls.Array = cls.RefPtrBased("InspectorArray")
-        cls.Any = cls.RefPtrBased("InspectorValue")
+        cls.Object = cls.RefPtrBased("JSONObject")
+        cls.Array = cls.RefPtrBased("JSONArray")
+        cls.Any = cls.RefPtrBased("JSONValue")
 
 TypeModel.init_class()
 
 
-# Collection of InspectorObject class methods that are likely to be overloaded in generated class.
+# Collection of JSONObject class methods that are likely to be overloaded in generated class.
 # We must explicitly import all overloaded methods or they won't be available to user.
 INSPECTOR_OBJECT_SETTER_NAMES = frozenset(["setValue", "setBoolean", "setNumber", "setString", "setValue", "setObject", "setArray"])
 
@@ -865,14 +897,14 @@
 
                                 if enum_binding_cls.need_internal_runtime_cast_:
                                     writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
-                                    writer.newline("    static void assertCorrectValue(InspectorValue* value);\n")
+                                    writer.newline("    static void assertCorrectValue(JSONValue* value);\n")
                                     writer.append("#endif  // %s\n" % VALIDATOR_IFDEF_NAME)
 
                                     validator_writer = generate_context.validator_writer
 
                                     domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
 
-                                    validator_writer.newline("void %s%s::assertCorrectValue(InspectorValue* value)\n" % (helper.full_name_prefix_for_impl, enum_name))
+                                    validator_writer.newline("void %s%s::assertCorrectValue(JSONValue* value)\n" % (helper.full_name_prefix_for_impl, enum_name))
                                     validator_writer.newline("{\n")
                                     validator_writer.newline("    WTF::String s;\n")
                                     validator_writer.newline("    bool cast_res = value->asString(&s);\n")
@@ -1018,7 +1050,7 @@
 
                         @classmethod
                         def get_array_item_c_type_text(cls):
-                            return "const %s%s&" % (helper.full_name_prefix_for_use, fixed_type_name.class_name)
+                            return "%s%s" % (helper.full_name_prefix_for_use, fixed_type_name.class_name)
 
                     return TypedefString
 
@@ -1103,9 +1135,9 @@
                                 writer.append(class_name)
                                 writer.append(" : public ")
                                 if is_open_type:
-                                    writer.append("InspectorObject")
+                                    writer.append("JSONObject")
                                 else:
-                                    writer.append("InspectorObjectBase")
+                                    writer.append("JSONObjectBase")
                                 writer.append(" {\n")
                                 writer.newline("public:\n")
                                 ad_hoc_type_writer = writer.insert_writer("    ")
@@ -1182,25 +1214,25 @@
 
 
                                     if setter_name in INSPECTOR_OBJECT_SETTER_NAMES:
-                                        writer.newline("    using InspectorObjectBase::%s;\n\n" % setter_name)
+                                        writer.newline("    using JSONObjectBase::%s;\n\n" % setter_name)
 
                                 if class_binding_cls.need_user_runtime_cast_:
-                                    writer.newline("    static PassRefPtr<%s> runtimeCast(PassRefPtr<InspectorValue> value)\n" % class_name)
+                                    writer.newline("    static PassRefPtr<%s> runtimeCast(PassRefPtr<JSONValue> value)\n" % class_name)
                                     writer.newline("    {\n")
-                                    writer.newline("        RefPtr<InspectorObject> object;\n")
+                                    writer.newline("        RefPtr<JSONObject> object;\n")
                                     writer.newline("        bool castRes = value->asObject(&object);\n")
                                     writer.newline("        ASSERT_UNUSED(castRes, castRes);\n")
                                     writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
                                     writer.newline("        assertCorrectValue(object.get());\n")
                                     writer.append("#endif  // %s\n" % VALIDATOR_IFDEF_NAME)
-                                    writer.newline("        COMPILE_ASSERT(sizeof(%s) == sizeof(InspectorObjectBase), type_cast_problem);\n" % class_name)
-                                    writer.newline("        return static_cast<%s*>(static_cast<InspectorObjectBase*>(object.get()));\n" % class_name)
+                                    writer.newline("        COMPILE_ASSERT(sizeof(%s) == sizeof(JSONObjectBase), type_cast_problem);\n" % class_name)
+                                    writer.newline("        return static_cast<%s*>(static_cast<JSONObjectBase*>(object.get()));\n" % class_name)
                                     writer.newline("    }\n")
                                     writer.append("\n")
 
                                 if class_binding_cls.need_internal_runtime_cast_:
                                     writer.append("#if %s\n" % VALIDATOR_IFDEF_NAME)
-                                    writer.newline("    static void assertCorrectValue(InspectorValue* value);\n")
+                                    writer.newline("    static void assertCorrectValue(JSONValue* value);\n")
                                     writer.append("#endif  // %s\n" % VALIDATOR_IFDEF_NAME)
 
                                     closed_field_set = (context_domain_name + "." + class_name) not in TYPES_WITH_OPEN_FIELD_LIST_SET
@@ -1209,15 +1241,15 @@
 
                                     domain_fixes = DomainNameFixes.get_fixed_data(context_domain_name)
 
-                                    validator_writer.newline("void %s%s::assertCorrectValue(InspectorValue* value)\n" % (helper.full_name_prefix_for_impl, class_name))
+                                    validator_writer.newline("void %s%s::assertCorrectValue(JSONValue* value)\n" % (helper.full_name_prefix_for_impl, class_name))
                                     validator_writer.newline("{\n")
-                                    validator_writer.newline("    RefPtr<InspectorObject> object;\n")
+                                    validator_writer.newline("    RefPtr<JSONObject> object;\n")
                                     validator_writer.newline("    bool castRes = value->asObject(&object);\n")
                                     validator_writer.newline("    ASSERT_UNUSED(castRes, castRes);\n")
                                     for prop_data in resolve_data.main_properties:
                                         validator_writer.newline("    {\n")
                                         it_name = "%sPos" % prop_data.p["name"]
-                                        validator_writer.newline("        InspectorObject::iterator %s;\n" % it_name)
+                                        validator_writer.newline("        JSONObject::iterator %s;\n" % it_name)
                                         validator_writer.newline("        %s = object->find(\"%s\");\n" % (it_name, prop_data.p["name"]))
                                         validator_writer.newline("        ASSERT(%s != object->end());\n" % it_name)
                                         validator_writer.newline("        %s(%s->value.get());\n" % (prop_data.param_type_binding.get_validator_call_text(), it_name))
@@ -1229,7 +1261,7 @@
                                     for prop_data in resolve_data.optional_properties:
                                         validator_writer.newline("    {\n")
                                         it_name = "%sPos" % prop_data.p["name"]
-                                        validator_writer.newline("        InspectorObject::iterator %s;\n" % it_name)
+                                        validator_writer.newline("        JSONObject::iterator %s;\n" % it_name)
                                         validator_writer.newline("        %s = object->find(\"%s\");\n" % (it_name, prop_data.p["name"]))
                                         validator_writer.newline("        if (%s != object->end()) {\n" % it_name)
                                         validator_writer.newline("            %s(%s->value.get());\n" % (prop_data.param_type_binding.get_validator_call_text(), it_name))
@@ -1340,7 +1372,7 @@
 
                     @staticmethod
                     def get_validator_call_text():
-                        return "RuntimeCastHelper::assertType<InspectorValue::TypeObject>"
+                        return "RuntimeCastHelper::assertType<JSONValue::TypeObject>"
 
                     @classmethod
                     def get_array_item_c_type_text(cls):
@@ -1650,7 +1682,8 @@
     frontend_domain_class = string.Template(CodeGeneratorInspectorStrings.frontend_domain_class)
     backend_method = string.Template(CodeGeneratorInspectorStrings.backend_method)
     frontend_method = string.Template(CodeGeneratorInspectorStrings.frontend_method)
-    callback_method = string.Template(CodeGeneratorInspectorStrings.callback_method)
+    callback_main_methods = string.Template(CodeGeneratorInspectorStrings.callback_main_methods)
+    callback_failure_method = string.Template(CodeGeneratorInspectorStrings.callback_failure_method)
     frontend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.frontend_h)
     backend_h = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_h)
     backend_cpp = string.Template(file_header_ + CodeGeneratorInspectorStrings.backend_cpp)
@@ -1839,7 +1872,7 @@
     class EventMethodStructTemplate:
         @staticmethod
         def append_prolog(line_list):
-            line_list.append("    RefPtr<InspectorObject> paramsObject = InspectorObject::create();\n")
+            line_list.append("    RefPtr<JSONObject> paramsObject = JSONObject::create();\n")
 
         @staticmethod
         def append_epilog(line_list):
@@ -1855,7 +1888,7 @@
 
         Generator.method_name_enum_list.append("        %s," % cmd_enum_name)
         Generator.method_handler_list.append("            &InspectorBackendDispatcherImpl::%s_%s," % (domain_name, json_command_name))
-        Generator.backend_method_declaration_list.append("    void %s_%s(long callId, InspectorObject* requestMessageObject);" % (domain_name, json_command_name))
+        Generator.backend_method_declaration_list.append("    void %s_%s(long callId, JSONObject* requestMessageObject);" % (domain_name, json_command_name))
 
         ad_hoc_type_output = []
         Generator.backend_agent_interface_list.append(ad_hoc_type_output)
@@ -1866,13 +1899,34 @@
         method_in_code = ""
         method_out_code = ""
         agent_call_param_list = []
-        response_cook_list = []
         request_message_param = ""
+        normal_response_cook_text = ""
+        error_response_cook_text = ""
+        error_type_binding = None
+        if "error" in json_command:
+            json_error = json_command["error"]
+            error_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_error, json_command_name + "Error", json_command_name, domain_name, ad_hoc_type_writer, agent_interface_name + "::")
+            error_type_model = error_type_binding.get_type_model().get_optional()
+            error_annotated_type = error_type_model.get_command_return_pass_model().get_output_parameter_type()
+            agent_call_param_list.append(", %serrorData" % error_type_model.get_command_return_pass_model().get_output_argument_prefix())
+            Generator.backend_agent_interface_list.append(", %s errorData" % error_annotated_type)
+            method_in_code += "    %s errorData;\n" % error_type_model.get_command_return_pass_model().get_return_var_type()
+
+            setter_argument = error_type_model.get_command_return_pass_model().get_output_to_raw_expression() % "errorData"
+            if error_type_binding.get_setter_value_expression_pattern():
+                setter_argument = error_type_binding.get_setter_value_expression_pattern() % setter_argument
+            error_assigment_value = error_type_binding.reduce_to_raw_type().get_constructor_pattern() % setter_argument
+
+            cook = "            resultErrorData = %s;\n" % error_assigment_value
+
+            error_condition_pattern = error_type_model.get_command_return_pass_model().get_set_return_condition()
+            cook = ("            if (%s)\n    " % (error_condition_pattern % "errorData")) + cook
+            error_response_cook_text = "        if (error.length()) {\n" + cook + "        }\n"
+
         if "parameters" in json_command:
             json_params = json_command["parameters"]
             method_in_code += Templates.param_container_access_code
             request_message_param = " requestMessageObject"
-            js_param_list = []
 
             for json_parameter in json_params:
                 json_param_name = json_parameter["name"]
@@ -1909,7 +1963,6 @@
                 agent_call_param_list.append(param)
                 Generator.backend_agent_interface_list.append(", %s in_%s" % (formal_param_type_pattern % non_optional_type_model.get_command_return_pass_model().get_return_var_type(), json_param_name))
 
-        response_cook_text = ""
         if json_command.get("async") == True:
             callback_name = Capitalizer.lower_camel_case_to_upper(json_command_name) + "Callback"
 
@@ -1920,33 +1973,51 @@
             Generator.generate_send_method(json_command.get("returns"), json_command_name, domain_name, ad_hoc_type_writer,
                                            decl_parameter_list,
                                            Generator.CallbackMethodStructTemplate,
-                                           Generator.backend_method_implementation_list, Templates.callback_method,
+                                           Generator.backend_method_implementation_list, Templates.callback_main_methods,
                                            {"callbackName": callback_name, "agentName": agent_interface_name})
 
             callback_writer.newline("class " + callback_name + " : public CallbackBase {\n")
             callback_writer.newline("public:\n")
             callback_writer.newline("    " + callback_name + "(PassRefPtr<InspectorBackendDispatcherImpl>, int id);\n")
             callback_writer.newline("    void sendSuccess(" + ", ".join(decl_parameter_list) + ");\n")
+            error_part_writer = callback_writer.insert_writer("")
             callback_writer.newline("};\n")
 
+            if error_type_binding:
+                annotated_type = error_type_model.get_input_param_type_text()
+                error_part_writer.newline("    void sendFailure(const ErrorString&, %s);\n" % annotated_type)
+                error_part_writer.newline("    using CallbackBase::sendFailure;\n")
+
+                assigment_value = error_type_model.get_event_setter_expression_pattern() % "errorData"
+                assigment_value = error_type_binding.reduce_to_raw_type().get_constructor_pattern() % assigment_value
+
+                Generator.backend_method_implementation_list.append(Templates.callback_failure_method.substitute(None,
+                    agentName=agent_interface_name,
+                    callbackName=callback_name,
+                    parameter=annotated_type + " errorData",
+                    argument=assigment_value))
+
+
+
             ad_hoc_type_output.append(callback_output)
 
             method_out_code += "    RefPtr<" + agent_interface_name + "::" + callback_name + "> callback = adoptRef(new " + agent_interface_name + "::" + callback_name + "(this, callId));\n"
             agent_call_param_list.append(", callback")
-            response_cook_text += "        if (!error.length()) \n"
-            response_cook_text += "            return;\n"
-            response_cook_text += "        callback->disable();\n"
+            normal_response_cook_text += "        if (!error.length()) \n"
+            normal_response_cook_text += "            return;\n"
+            normal_response_cook_text += "        callback->disable();\n"
             Generator.backend_agent_interface_list.append(", PassRefPtr<%s> callback" % callback_name)
         else:
             if "returns" in json_command:
                 method_out_code += "\n"
+                response_cook_list = []
                 for json_return in json_command["returns"]:
 
                     json_return_name = json_return["name"]
 
                     optional = bool(json_return.get("optional"))
 
-                    return_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_return, json_command_name, domain_name, ad_hoc_type_writer, agent_interface_name + "::")
+                    return_type_binding = Generator.resolve_param_type_and_generate_ad_hoc(json_return, json_command_name, domain_name, ad_hoc_type_writer, agent_interface_name + "::")
 
                     raw_type = return_type_binding.reduce_to_raw_type()
                     setter_type = raw_type.get_setter_name()
@@ -1971,7 +2042,7 @@
                         cook = ("            if (%s)\n    " % (set_condition_pattern % var_name)) + cook
                     annotated_type = type_model.get_command_return_pass_model().get_output_parameter_type()
 
-                    param_name = "out_%s" % json_return_name
+                    param_name = var_name
                     if optional:
                         param_name = "opt_" + param_name
 
@@ -1981,10 +2052,10 @@
                     method_out_code += code
                     agent_call_param_list.append(param)
 
-                response_cook_text = "".join(response_cook_list)
+                normal_response_cook_text += "".join(response_cook_list)
 
-                if len(response_cook_text) != 0:
-                    response_cook_text = "        if (!error.length()) {\n" + response_cook_text + "        }"
+                if len(normal_response_cook_text) != 0:
+                    normal_response_cook_text = "        if (!error.length()) {\n" + normal_response_cook_text + "        }"
 
         Generator.backend_method_implementation_list.append(Templates.backend_method.substitute(None,
             domainName=domain_name, methodName=json_command_name,
@@ -1993,7 +2064,8 @@
             methodOutCode=method_out_code,
             agentCallParams="".join(agent_call_param_list),
             requestMessageObject=request_message_param,
-            responseCook=response_cook_text,
+            responseCook=normal_response_cook_text,
+            errorCook=error_response_cook_text,
             commandNameIndex=cmd_enum_name))
         Generator.backend_method_name_declaration_list.append("    \"%s.%s\"," % (domain_name, json_command_name))
 
@@ -2021,7 +2093,7 @@
             for json_parameter in parameters:
                 parameter_name = json_parameter["name"]
 
-                param_type_binding = Generator.resolve_type_and_generate_ad_hoc(json_parameter, event_name, domain_name, ad_hoc_type_writer, "")
+                param_type_binding = Generator.resolve_param_type_and_generate_ad_hoc(json_parameter, event_name, domain_name, ad_hoc_type_writer, "")
 
                 raw_type = param_type_binding.reduce_to_raw_type()
                 raw_type_binding = RawTypeBinding(raw_type)
@@ -2057,9 +2129,13 @@
             parameters=", ".join(decl_parameter_list),
             code="".join(method_line_list), **template_params))
 
-    @staticmethod
-    def resolve_type_and_generate_ad_hoc(json_param, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param):
+    @classmethod
+    def resolve_param_type_and_generate_ad_hoc(cls, json_param, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param):
         param_name = json_param["name"]
+        return cls.resolve_type_and_generate_ad_hoc(json_param, param_name, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param)
+
+    @staticmethod
+    def resolve_type_and_generate_ad_hoc(typable_element, element_name, method_name, domain_name, ad_hoc_type_writer, container_relative_name_prefix_param):
         ad_hoc_type_list = []
 
         class AdHocTypeContext:
@@ -2069,11 +2145,11 @@
             @staticmethod
             def get_type_name_fix():
                 class NameFix:
-                    class_name = Capitalizer.lower_camel_case_to_upper(param_name)
+                    class_name = Capitalizer.lower_camel_case_to_upper(element_name)
 
                     @staticmethod
                     def output_comment(writer):
-                        writer.newline("// Named after parameter '%s' while generating command/event %s.\n" % (param_name, method_name))
+                        writer.newline("// Named after parameter '%s' while generating command/event %s.\n" % (element_name, method_name))
 
                 return NameFix
 
@@ -2081,7 +2157,7 @@
             def add_type(binding):
                 ad_hoc_type_list.append(binding)
 
-        type_binding = resolve_param_type(json_param, domain_name, AdHocTypeContext)
+        type_binding = resolve_param_type(typable_element, domain_name, AdHocTypeContext)
 
         class InterfaceForwardListener:
             @staticmethod
diff --git a/core/inspector/CodeGeneratorInspectorStrings.py b/core/inspector/CodeGeneratorInspectorStrings.py
index 6c3fe05..8759b2f 100644
--- a/core/inspector/CodeGeneratorInspectorStrings.py
+++ b/core/inspector/CodeGeneratorInspectorStrings.py
@@ -44,52 +44,66 @@
 """)
 
 backend_method = (
-"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(long callId, InspectorObject*$requestMessageObject)
+"""void InspectorBackendDispatcherImpl::${domainName}_$methodName(long callId, JSONObject*$requestMessageObject)
 {
-    RefPtr<InspectorArray> protocolErrors = InspectorArray::create();
+    RefPtr<JSONArray> protocolErrors = JSONArray::create();
 
     if (!$agentField)
         protocolErrors->pushString("${domainName} handler is not available.");
 $methodOutCode
 $methodInCode
-    RefPtr<InspectorObject> result = InspectorObject::create();
+    RefPtr<JSONObject> result = JSONObject::create();
+    RefPtr<JSONValue> resultErrorData;
     ErrorString error;
     if (!protocolErrors->length()) {
         $agentField->$methodName(&error$agentCallParams);
 
-${responseCook}
+$errorCook${responseCook}
     }
-    sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors, error);
+    sendResponse(callId, result, commandNames[$commandNameIndex], protocolErrors, error, resultErrorData);
 }
 """)
 
 frontend_method = ("""void InspectorFrontend::$domainName::$eventName($parameters)
 {
-    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
+    RefPtr<JSONObject> jsonMessage = JSONObject::create();
     jsonMessage->setString("method", "$domainName.$eventName");
 $code    if (m_inspectorFrontendChannel)
         m_inspectorFrontendChannel->sendMessageToFrontend(jsonMessage->toJSONString());
 }
 """)
 
-callback_method = (
+callback_main_methods = (
 """InspectorBackendDispatcher::$agentName::$callbackName::$callbackName(PassRefPtr<InspectorBackendDispatcherImpl> backendImpl, int id) : CallbackBase(backendImpl, id) {}
 
 void InspectorBackendDispatcher::$agentName::$callbackName::sendSuccess($parameters)
 {
-    RefPtr<InspectorObject> jsonMessage = InspectorObject::create();
-$code    sendIfActive(jsonMessage, ErrorString());
+    RefPtr<JSONObject> jsonMessage = JSONObject::create();
+$code    sendIfActive(jsonMessage, ErrorString(), PassRefPtr<JSONValue>());
 }
 """)
 
+callback_failure_method = (
+"""void InspectorBackendDispatcher::$agentName::$callbackName::sendFailure(const ErrorString& error, $parameter)
+{
+    ASSERT(error.length());
+    RefPtr<JSONValue> errorDataValue;
+    if (error) {
+        errorDataValue = $argument;
+    }
+    sendIfActive(0, error, errorDataValue.release());
+}
+""")
+
+
 frontend_h = (
 """#ifndef InspectorFrontend_h
 #define InspectorFrontend_h
 
 #include "InspectorTypeBuilder.h"
-#include "core/inspector/InspectorValues.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/text/WTFString.h>
+#include "core/platform/JSONValues.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
@@ -123,8 +137,8 @@
 namespace WebCore {
 
 class InspectorAgent;
-class InspectorObject;
-class InspectorArray;
+class JSONObject;
+class JSONArray;
 class InspectorFrontendChannel;
 
 typedef String ErrorString;
@@ -144,7 +158,7 @@
         bool isActive();
 
     protected:
-        void sendIfActive(PassRefPtr<InspectorObject> partialMessage, const ErrorString& invocationError);
+        void sendIfActive(PassRefPtr<JSONObject> partialMessage, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData);
 
     private:
         void disable() { m_alreadySent = true; }
@@ -172,7 +186,7 @@
     };
 
     void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage) const;
-    virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<InspectorArray> data) const = 0;
+    virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const = 0;
     virtual void dispatch(const String& message) = 0;
     static bool getCommandName(const String& message, String* result);
 
@@ -197,12 +211,12 @@
 #include "config.h"
 #include "InspectorBackendDispatcher.h"
 
-
 #include "core/inspector/InspectorAgent.h"
 #include "core/inspector/InspectorFrontendChannel.h"
-#include "core/inspector/InspectorValues.h"
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
+#include "core/inspector/JSONParser.h"
+#include "core/platform/JSONValues.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
@@ -220,10 +234,10 @@
 
     virtual void clearFrontend() { m_inspectorFrontendChannel = 0; }
     virtual void dispatch(const String& message);
-    virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<InspectorArray> data) const;
+    virtual void reportProtocolError(const long* const callId, CommonErrorCode, const String& errorMessage, PassRefPtr<JSONValue> data) const;
     using InspectorBackendDispatcher::reportProtocolError;
 
-    void sendResponse(long callId, PassRefPtr<InspectorObject> result, const ErrorString& invocationError);
+    void sendResponse(long callId, PassRefPtr<JSONObject> result, const ErrorString&invocationError, PassRefPtr<JSONValue> errorData);
     bool isActive() { return m_inspectorFrontendChannel; }
 
 $setters
@@ -234,16 +248,16 @@
 $fieldDeclarations
 
     template<typename R, typename V, typename V0>
-    static R getPropertyValueImpl(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors, V0 initial_value, bool (*as_method)(InspectorValue*, V*), const char* type_name);
+    static R getPropertyValueImpl(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors, V0 initial_value, bool (*as_method)(JSONValue*, V*), const char* type_name);
 
-    static int getInt(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
-    static double getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
-    static String getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
-    static bool getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
-    static PassRefPtr<InspectorObject> getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
-    static PassRefPtr<InspectorArray> getArray(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors);
+    static int getInt(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
+    static double getDouble(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
+    static String getString(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
+    static bool getBoolean(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
+    static PassRefPtr<JSONObject> getObject(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
+    static PassRefPtr<JSONArray> getArray(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors);
 
-    void sendResponse(long callId, PassRefPtr<InspectorObject> result, const char* commandName, PassRefPtr<InspectorArray> protocolErrors, ErrorString invocationError);
+    void sendResponse(long callId, PassRefPtr<JSONObject> result, const char* commandName, PassRefPtr<JSONArray> protocolErrors, ErrorString invocationError, PassRefPtr<JSONValue> errorData);
 
 };
 
@@ -258,7 +272,7 @@
 void InspectorBackendDispatcherImpl::dispatch(const String& message)
 {
     RefPtr<InspectorBackendDispatcher> protect = this;
-    typedef void (InspectorBackendDispatcherImpl::*CallHandler)(long callId, InspectorObject* messageObject);
+    typedef void (InspectorBackendDispatcherImpl::*CallHandler)(long callId, JSONObject* messageObject);
     typedef HashMap<String, CallHandler> DispatchMap;
     DEFINE_STATIC_LOCAL(DispatchMap, dispatchMap, );
     long callId = 0;
@@ -272,19 +286,19 @@
             dispatchMap.add(commandNames[i], handlers[i]);
     }
 
-    RefPtr<InspectorValue> parsedMessage = InspectorValue::parseJSON(message);
+    RefPtr<JSONValue> parsedMessage = parseJSON(message);
     if (!parsedMessage) {
         reportProtocolError(0, ParseError, "Message must be in JSON format");
         return;
     }
 
-    RefPtr<InspectorObject> messageObject = parsedMessage->asObject();
+    RefPtr<JSONObject> messageObject = parsedMessage->asObject();
     if (!messageObject) {
         reportProtocolError(0, InvalidRequest, "Message must be a JSONified object");
         return;
     }
 
-    RefPtr<InspectorValue> callIdValue = messageObject->get("id");
+    RefPtr<JSONValue> callIdValue = messageObject->get("id");
     if (!callIdValue) {
         reportProtocolError(0, InvalidRequest, "'id' property was not found");
         return;
@@ -295,7 +309,7 @@
         return;
     }
 
-    RefPtr<InspectorValue> methodValue = messageObject->get("method");
+    RefPtr<JSONValue> methodValue = messageObject->get("method");
     if (!methodValue) {
         reportProtocolError(&callId, InvalidRequest, "'method' property wasn't found");
         return;
@@ -316,24 +330,24 @@
     ((*this).*it->value)(callId, messageObject.get());
 }
 
-void InspectorBackendDispatcherImpl::sendResponse(long callId, PassRefPtr<InspectorObject> result, const char* commandName, PassRefPtr<InspectorArray> protocolErrors, ErrorString invocationError)
+void InspectorBackendDispatcherImpl::sendResponse(long callId, PassRefPtr<JSONObject> result, const char* commandName, PassRefPtr<JSONArray> protocolErrors, ErrorString invocationError, PassRefPtr<JSONValue> errorData)
 {
     if (protocolErrors->length()) {
         String errorMessage = String::format("Some arguments of method '%s' can't be processed", commandName);
         reportProtocolError(&callId, InvalidParams, errorMessage, protocolErrors);
         return;
     }
-    sendResponse(callId, result, invocationError);
+    sendResponse(callId, result, invocationError, errorData);
 }
 
-void InspectorBackendDispatcherImpl::sendResponse(long callId, PassRefPtr<InspectorObject> result, const ErrorString& invocationError)
+void InspectorBackendDispatcherImpl::sendResponse(long callId, PassRefPtr<JSONObject> result, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData)
 {
     if (invocationError.length()) {
-        reportProtocolError(&callId, ServerError, invocationError);
+        reportProtocolError(&callId, ServerError, invocationError, errorData);
         return;
     }
 
-    RefPtr<InspectorObject> responseMessage = InspectorObject::create();
+    RefPtr<JSONObject> responseMessage = JSONObject::create();
     responseMessage->setObject("result", result);
     responseMessage->setNumber("id", callId);
     if (m_inspectorFrontendChannel)
@@ -342,10 +356,10 @@
 
 void InspectorBackendDispatcher::reportProtocolError(const long* const callId, CommonErrorCode code, const String& errorMessage) const
 {
-    reportProtocolError(callId, code, errorMessage, 0);
+    reportProtocolError(callId, code, errorMessage, PassRefPtr<JSONValue>());
 }
 
-void InspectorBackendDispatcherImpl::reportProtocolError(const long* const callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<InspectorArray> data) const
+void InspectorBackendDispatcherImpl::reportProtocolError(const long* const callId, CommonErrorCode code, const String& errorMessage, PassRefPtr<JSONValue> data) const
 {
     DEFINE_STATIC_LOCAL(Vector<int>,s_commonErrors,);
     if (!s_commonErrors.size()) {
@@ -359,24 +373,24 @@
     ASSERT(code >=0);
     ASSERT((unsigned)code < s_commonErrors.size());
     ASSERT(s_commonErrors[code]);
-    RefPtr<InspectorObject> error = InspectorObject::create();
+    RefPtr<JSONObject> error = JSONObject::create();
     error->setNumber("code", s_commonErrors[code]);
     error->setString("message", errorMessage);
     ASSERT(error);
     if (data)
-        error->setArray("data", data);
-    RefPtr<InspectorObject> message = InspectorObject::create();
+        error->setValue("data", data);
+    RefPtr<JSONObject> message = JSONObject::create();
     message->setObject("error", error);
     if (callId)
         message->setNumber("id", *callId);
     else
-        message->setValue("id", InspectorValue::null());
+        message->setValue("id", JSONValue::null());
     if (m_inspectorFrontendChannel)
         m_inspectorFrontendChannel->sendMessageToFrontend(message->toJSONString());
 }
 
 template<typename R, typename V, typename V0>
-R InspectorBackendDispatcherImpl::getPropertyValueImpl(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors, V0 initial_value, bool (*as_method)(InspectorValue*, V*), const char* type_name)
+R InspectorBackendDispatcherImpl::getPropertyValueImpl(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors, V0 initial_value, bool (*as_method)(JSONValue*, V*), const char* type_name)
 {
     ASSERT(protocolErrors);
 
@@ -393,8 +407,8 @@
         return value;
     }
 
-    InspectorObject::const_iterator end = object->end();
-    InspectorObject::const_iterator valueIterator = object->find(name);
+    JSONObject::const_iterator end = object->end();
+    JSONObject::const_iterator valueIterator = object->find(name);
 
     if (valueIterator == end) {
         if (!valueFound)
@@ -411,51 +425,51 @@
 }
 
 struct AsMethodBridges {
-    static bool asInt(InspectorValue* value, int* output) { return value->asNumber(output); }
-    static bool asDouble(InspectorValue* value, double* output) { return value->asNumber(output); }
-    static bool asString(InspectorValue* value, String* output) { return value->asString(output); }
-    static bool asBoolean(InspectorValue* value, bool* output) { return value->asBoolean(output); }
-    static bool asObject(InspectorValue* value, RefPtr<InspectorObject>* output) { return value->asObject(output); }
-    static bool asArray(InspectorValue* value, RefPtr<InspectorArray>* output) { return value->asArray(output); }
+    static bool asInt(JSONValue* value, int* output) { return value->asNumber(output); }
+    static bool asDouble(JSONValue* value, double* output) { return value->asNumber(output); }
+    static bool asString(JSONValue* value, String* output) { return value->asString(output); }
+    static bool asBoolean(JSONValue* value, bool* output) { return value->asBoolean(output); }
+    static bool asObject(JSONValue* value, RefPtr<JSONObject>* output) { return value->asObject(output); }
+    static bool asArray(JSONValue* value, RefPtr<JSONArray>* output) { return value->asArray(output); }
 };
 
-int InspectorBackendDispatcherImpl::getInt(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+int InspectorBackendDispatcherImpl::getInt(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
     return getPropertyValueImpl<int, int, int>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asInt, "Number");
 }
 
-double InspectorBackendDispatcherImpl::getDouble(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+double InspectorBackendDispatcherImpl::getDouble(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
     return getPropertyValueImpl<double, double, double>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asDouble, "Number");
 }
 
-String InspectorBackendDispatcherImpl::getString(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+String InspectorBackendDispatcherImpl::getString(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
     return getPropertyValueImpl<String, String, String>(object, name, valueFound, protocolErrors, "", AsMethodBridges::asString, "String");
 }
 
-bool InspectorBackendDispatcherImpl::getBoolean(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+bool InspectorBackendDispatcherImpl::getBoolean(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
     return getPropertyValueImpl<bool, bool, bool>(object, name, valueFound, protocolErrors, false, AsMethodBridges::asBoolean, "Boolean");
 }
 
-PassRefPtr<InspectorObject> InspectorBackendDispatcherImpl::getObject(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+PassRefPtr<JSONObject> InspectorBackendDispatcherImpl::getObject(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
-    return getPropertyValueImpl<PassRefPtr<InspectorObject>, RefPtr<InspectorObject>, InspectorObject*>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asObject, "Object");
+    return getPropertyValueImpl<PassRefPtr<JSONObject>, RefPtr<JSONObject>, JSONObject*>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asObject, "Object");
 }
 
-PassRefPtr<InspectorArray> InspectorBackendDispatcherImpl::getArray(InspectorObject* object, const String& name, bool* valueFound, InspectorArray* protocolErrors)
+PassRefPtr<JSONArray> InspectorBackendDispatcherImpl::getArray(JSONObject* object, const String& name, bool* valueFound, JSONArray* protocolErrors)
 {
-    return getPropertyValueImpl<PassRefPtr<InspectorArray>, RefPtr<InspectorArray>, InspectorArray*>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asArray, "Array");
+    return getPropertyValueImpl<PassRefPtr<JSONArray>, RefPtr<JSONArray>, JSONArray*>(object, name, valueFound, protocolErrors, 0, AsMethodBridges::asArray, "Array");
 }
 
 bool InspectorBackendDispatcher::getCommandName(const String& message, String* result)
 {
-    RefPtr<InspectorValue> value = InspectorValue::parseJSON(message);
+    RefPtr<JSONValue> value = parseJSON(message);
     if (!value)
         return false;
 
-    RefPtr<InspectorObject> object = value->asObject();
+    RefPtr<JSONObject> object = value->asObject();
     if (!object)
         return false;
 
@@ -473,7 +487,7 @@
 void InspectorBackendDispatcher::CallbackBase::sendFailure(const ErrorString& error)
 {
     ASSERT(error.length());
-    sendIfActive(0, error);
+    sendIfActive(0, error, PassRefPtr<JSONValue>());
 }
 
 bool InspectorBackendDispatcher::CallbackBase::isActive()
@@ -481,11 +495,11 @@
     return !m_alreadySent && m_backendImpl->isActive();
 }
 
-void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr<InspectorObject> partialMessage, const ErrorString& invocationError)
+void InspectorBackendDispatcher::CallbackBase::sendIfActive(PassRefPtr<JSONObject> partialMessage, const ErrorString& invocationError, PassRefPtr<JSONValue> errorData)
 {
     if (m_alreadySent)
         return;
-    m_backendImpl->sendResponse(m_id, partialMessage, invocationError);
+    m_backendImpl->sendResponse(m_id, partialMessage, invocationError, errorData);
     m_alreadySent = true;
 }
 
@@ -499,13 +513,12 @@
 """
 
 #include "config.h"
-
 #include "InspectorFrontend.h"
-#include "core/inspector/InspectorFrontendChannel.h"
-#include "core/inspector/InspectorValues.h"
 
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
+#include "core/inspector/InspectorFrontendChannel.h"
+#include "core/platform/JSONValues.h"
+#include "wtf/text/CString.h"
+#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
@@ -524,10 +537,9 @@
 #ifndef InspectorTypeBuilder_h
 #define InspectorTypeBuilder_h
 
-#include "core/inspector/InspectorValues.h"
-
-#include <wtf/Assertions.h>
-#include <wtf/PassRefPtr.h>
+#include "core/platform/JSONValues.h"
+#include "wtf/Assertions.h"
+#include "wtf/PassRefPtr.h"
 
 namespace WebCore {
 
@@ -586,13 +598,13 @@
 class RuntimeCastHelper {
 public:
 #if $validatorIfdefName
-    template<InspectorValue::Type TYPE>
-    static void assertType(InspectorValue* value)
+    template<JSONValue::Type TYPE>
+    static void assertType(JSONValue* value)
     {
         ASSERT(value->type() == TYPE);
     }
-    static void assertAny(InspectorValue*);
-    static void assertInt(InspectorValue* value);
+    static void assertAny(JSONValue*);
+    static void assertInt(JSONValue* value);
 #endif
 };
 
@@ -605,13 +617,13 @@
 };
 
 template<typename T>
-class Array : public InspectorArrayBase {
+class Array : public JSONArrayBase {
 private:
     Array() { }
 
-    InspectorArray* openAccessors() {
-        COMPILE_ASSERT(sizeof(InspectorArray) == sizeof(Array<T>), cannot_cast);
-        return static_cast<InspectorArray*>(static_cast<InspectorArrayBase*>(this));
+    JSONArray* openAccessors() {
+        COMPILE_ASSERT(sizeof(JSONArray) == sizeof(Array<T>), cannot_cast);
+        return static_cast<JSONArray*>(static_cast<JSONArrayBase*>(this));
     }
 
 public:
@@ -630,22 +642,22 @@
         return adoptRef(new Array<T>());
     }
 
-    static PassRefPtr<Array<T> > runtimeCast(PassRefPtr<InspectorValue> value)
+    static PassRefPtr<Array<T> > runtimeCast(PassRefPtr<JSONValue> value)
     {
-        RefPtr<InspectorArray> array;
+        RefPtr<JSONArray> array;
         bool castRes = value->asArray(&array);
         ASSERT_UNUSED(castRes, castRes);
 #if $validatorIfdefName
         assertCorrectValue(array.get());
 #endif  // $validatorIfdefName
-        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(InspectorArray), type_cast_problem);
-        return static_cast<Array<T>*>(static_cast<InspectorArrayBase*>(array.get()));
+        COMPILE_ASSERT(sizeof(Array<T>) == sizeof(JSONArray), type_cast_problem);
+        return static_cast<Array<T>*>(static_cast<JSONArrayBase*>(array.get()));
     }
 
 #if $validatorIfdefName
-    static void assertCorrectValue(InspectorValue* value)
+    static void assertCorrectValue(JSONValue* value)
     {
-        RefPtr<InspectorArray> array;
+        RefPtr<JSONArray> array;
         bool castRes = value->asArray(&array);
         ASSERT_UNUSED(castRes, castRes);
         for (unsigned i = 0; i < array->length(); i++)
@@ -656,14 +668,14 @@
 };
 
 struct StructItemTraits {
-    static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
+    static void pushRefPtr(JSONArray* array, PassRefPtr<JSONValue> value)
     {
         array->pushValue(value);
     }
 
 #if $validatorIfdefName
     template<typename T>
-    static void assertCorrectValue(InspectorValue* value) {
+    static void assertCorrectValue(JSONValue* value) {
         T::assertCorrectValue(value);
     }
 #endif  // $validatorIfdefName
@@ -672,15 +684,15 @@
 template<>
 struct ArrayItemHelper<String> {
     struct Traits {
-        static void pushRaw(InspectorArray* array, const String& value)
+        static void pushRaw(JSONArray* array, const String& value)
         {
             array->pushString(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
-            RuntimeCastHelper::assertType<InspectorValue::TypeString>(value);
+        static void assertCorrectValue(JSONValue* value) {
+            RuntimeCastHelper::assertType<JSONValue::TypeString>(value);
         }
 #endif  // $validatorIfdefName
     };
@@ -689,14 +701,14 @@
 template<>
 struct ArrayItemHelper<int> {
     struct Traits {
-        static void pushRaw(InspectorArray* array, int value)
+        static void pushRaw(JSONArray* array, int value)
         {
             array->pushInt(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
+        static void assertCorrectValue(JSONValue* value) {
             RuntimeCastHelper::assertInt(value);
         }
 #endif  // $validatorIfdefName
@@ -706,15 +718,15 @@
 template<>
 struct ArrayItemHelper<double> {
     struct Traits {
-        static void pushRaw(InspectorArray* array, double value)
+        static void pushRaw(JSONArray* array, double value)
         {
             array->pushNumber(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
-            RuntimeCastHelper::assertType<InspectorValue::TypeNumber>(value);
+        static void assertCorrectValue(JSONValue* value) {
+            RuntimeCastHelper::assertType<JSONValue::TypeNumber>(value);
         }
 #endif  // $validatorIfdefName
     };
@@ -723,31 +735,31 @@
 template<>
 struct ArrayItemHelper<bool> {
     struct Traits {
-        static void pushRaw(InspectorArray* array, bool value)
+        static void pushRaw(JSONArray* array, bool value)
         {
             array->pushBoolean(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
-            RuntimeCastHelper::assertType<InspectorValue::TypeBoolean>(value);
+        static void assertCorrectValue(JSONValue* value) {
+            RuntimeCastHelper::assertType<JSONValue::TypeBoolean>(value);
         }
 #endif  // $validatorIfdefName
     };
 };
 
 template<>
-struct ArrayItemHelper<InspectorValue> {
+struct ArrayItemHelper<JSONValue> {
     struct Traits {
-        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
+        static void pushRefPtr(JSONArray* array, PassRefPtr<JSONValue> value)
         {
             array->pushValue(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
+        static void assertCorrectValue(JSONValue* value) {
             RuntimeCastHelper::assertAny(value);
         }
 #endif  // $validatorIfdefName
@@ -755,34 +767,34 @@
 };
 
 template<>
-struct ArrayItemHelper<InspectorObject> {
+struct ArrayItemHelper<JSONObject> {
     struct Traits {
-        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorValue> value)
+        static void pushRefPtr(JSONArray* array, PassRefPtr<JSONValue> value)
         {
             array->pushValue(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
-            RuntimeCastHelper::assertType<InspectorValue::TypeObject>(value);
+        static void assertCorrectValue(JSONValue* value) {
+            RuntimeCastHelper::assertType<JSONValue::TypeObject>(value);
         }
 #endif  // $validatorIfdefName
     };
 };
 
 template<>
-struct ArrayItemHelper<InspectorArray> {
+struct ArrayItemHelper<JSONArray> {
     struct Traits {
-        static void pushRefPtr(InspectorArray* array, PassRefPtr<InspectorArray> value)
+        static void pushRefPtr(JSONArray* array, PassRefPtr<JSONArray> value)
         {
             array->pushArray(value);
         }
 
 #if $validatorIfdefName
         template<typename T>
-        static void assertCorrectValue(InspectorValue* value) {
-            RuntimeCastHelper::assertType<InspectorValue::TypeArray>(value);
+        static void assertCorrectValue(JSONValue* value) {
+            RuntimeCastHelper::assertType<JSONValue::TypeArray>(value);
         }
 #endif  // $validatorIfdefName
     };
@@ -791,14 +803,14 @@
 template<typename T>
 struct ArrayItemHelper<TypeBuilder::Array<T> > {
     struct Traits {
-        static void pushRefPtr(InspectorArray* array, PassRefPtr<TypeBuilder::Array<T> > value)
+        static void pushRefPtr(JSONArray* array, PassRefPtr<TypeBuilder::Array<T> > value)
         {
             array->pushValue(value);
         }
 
 #if $validatorIfdefName
         template<typename S>
-        static void assertCorrectValue(InspectorValue* value) {
+        static void assertCorrectValue(JSONValue* value) {
             S::assertCorrectValue(value);
         }
 #endif  // $validatorIfdefName
@@ -825,8 +837,7 @@
 #include "config.h"
 
 #include "InspectorTypeBuilder.h"
-
-#include <wtf/text/CString.h>
+#include "wtf/text/CString.h"
 
 namespace WebCore {
 
@@ -845,13 +856,13 @@
 
 #if $validatorIfdefName
 
-void TypeBuilder::RuntimeCastHelper::assertAny(InspectorValue*)
+void TypeBuilder::RuntimeCastHelper::assertAny(JSONValue*)
 {
     // No-op.
 }
 
 
-void TypeBuilder::RuntimeCastHelper::assertInt(InspectorValue* value)
+void TypeBuilder::RuntimeCastHelper::assertInt(JSONValue* value)
 {
     double v;
     bool castRes = value->asNumber(&v);
@@ -868,9 +879,9 @@
 """)
 
 param_container_access_code = """
-    RefPtr<InspectorObject> paramsContainer = requestMessageObject->getObject("params");
-    InspectorObject* paramsContainerPtr = paramsContainer.get();
-    InspectorArray* protocolErrorsPtr = protocolErrors.get();
+    RefPtr<JSONObject> paramsContainer = requestMessageObject->getObject("params");
+    JSONObject* paramsContainerPtr = paramsContainer.get();
+    JSONArray* protocolErrorsPtr = protocolErrors.get();
 """
 
 class_binding_builder_part_1 = (
@@ -880,14 +891,14 @@
     template<int STATE>
     class Builder {
     private:
-        RefPtr<InspectorObject> m_result;
+        RefPtr<JSONObject> m_result;
 
         template<int STEP> Builder<STATE | STEP>& castState()
         {
             return *reinterpret_cast<Builder<STATE | STEP>*>(this);
         }
 
-        Builder(PassRefPtr</*%s*/InspectorObject> ptr)
+        Builder(PassRefPtr</*%s*/JSONObject> ptr)
         {
             COMPILE_ASSERT(STATE == NoFieldsSet, builder_created_in_non_init_state);
             m_result = ptr;
@@ -909,7 +920,7 @@
         operator RefPtr<%s>& ()
         {
             COMPILE_ASSERT(STATE == AllFieldsSet, result_is_not_ready);
-            COMPILE_ASSERT(sizeof(%s) == sizeof(InspectorObject), cannot_cast);
+            COMPILE_ASSERT(sizeof(%s) == sizeof(JSONObject), cannot_cast);
             return *reinterpret_cast<RefPtr<%s>*>(&m_result);
         }
 
@@ -924,6 +935,6 @@
 class_binding_builder_part_4 = (
 """    static Builder<NoFieldsSet> create()
     {
-        return Builder<NoFieldsSet>(InspectorObject::create());
+        return Builder<NoFieldsSet>(JSONObject::create());
     }
 """)
diff --git a/core/inspector/CodeGeneratorInstrumentation.py b/core/inspector/CodeGeneratorInstrumentation.py
index a1744eb..b72cb5d 100644
--- a/core/inspector/CodeGeneratorInstrumentation.py
+++ b/core/inspector/CodeGeneratorInstrumentation.py
@@ -34,26 +34,27 @@
 
 template_h = string.Template("""// Code generated from InspectorInstrumentation.idl
 
-#ifndef InspectorInstrumentationInl_h
-#define InspectorInstrumentationInl_h
+#ifndef ${file_name}_h
+#define ${file_name}_h
+
+${includes}
 
 namespace WebCore {
 
 namespace InspectorInstrumentation {
 
-$impl_declarations
-$inline_methods
+$methods
 } // namespace InspectorInstrumentation
 
 } // namespace WebCore
 
-#endif // !defined(InspectorInstrumentationInl_h)
+#endif // !defined(${file_name}_h)
 """)
 
 template_inline = string.Template("""
 inline void ${name}(${params_public})
 {   ${fast_return}
-    if (InstrumentingAgents* instrumentingAgents = ${agents_getter})
+    if (${condition})
         ${name}Impl(${params_impl});
 }
 """)
@@ -65,20 +66,12 @@
 }
 """)
 
-template_inline_accepts_cookie = string.Template("""
-inline void ${name}(${params_public})
+template_inline_returns_value = string.Template("""
+inline ${return_type} ${name}(${params_public})
 {   ${fast_return}
-    if (${cookie}.isValid())
-        ${name}Impl(${params_impl});
-}
-""")
-
-template_inline_returns_cookie = string.Template("""
-inline InspectorInstrumentationCookie ${name}(${params_public})
-{   ${fast_return}
-    if (InstrumentingAgents* instrumentingAgents = ${agents_getter})
+    if (${condition})
         return ${name}Impl(${params_impl});
-    return InspectorInstrumentationCookie();
+    return ${default_return_value};
 }
 """)
 
@@ -86,36 +79,14 @@
 template_cpp = string.Template("""// Code generated from InspectorInstrumentation.idl
 
 #include "config.h"
-#include "core/inspector/InspectorInstrumentation.h"
 
-#include "core/inspector/InspectorAgent.h"
-#include "core/inspector/InspectorApplicationCacheAgent.h"
-#include "core/inspector/InspectorCSSAgent.h"
-#include "core/inspector/InspectorCanvasAgent.h"
-#include "core/inspector/InspectorConsoleAgent.h"
-#include "core/inspector/InspectorConsoleInstrumentation.h"
-#include "core/inspector/InspectorDOMAgent.h"
-#include "core/inspector/InspectorDOMDebuggerAgent.h"
-#include "core/inspector/InspectorDOMStorageAgent.h"
-#include "core/inspector/InspectorDatabaseAgent.h"
-#include "core/inspector/InspectorDatabaseInstrumentation.h"
-#include "core/inspector/InspectorDebuggerAgent.h"
-#include "core/inspector/InspectorHeapProfilerAgent.h"
-#include "core/inspector/InspectorLayerTreeAgent.h"
-#include "core/inspector/InspectorPageAgent.h"
-#include "core/inspector/InspectorProfilerAgent.h"
-#include "core/inspector/InspectorResourceAgent.h"
-#include "core/inspector/InspectorTimelineAgent.h"
-#include "core/inspector/InspectorWorkerAgent.h"
-#include "core/inspector/InstrumentingAgents.h"
-#include "core/inspector/PageDebuggerAgent.h"
-#include "core/inspector/PageRuntimeAgent.h"
-#include "core/inspector/WorkerRuntimeAgent.h"
+${includes}
 
 namespace WebCore {
+${extra_definitions}
 
 namespace InspectorInstrumentation {
-$out_of_line_methods
+$methods
 
 } // namespace InspectorInstrumentation
 
@@ -123,79 +94,277 @@
 """)
 
 template_outofline = string.Template("""
-void ${name}Impl(${params_impl})
-{${agent_calls}
+${return_type} ${name}Impl(${params_impl})
+{${impl_lines}
 }""")
 
 template_agent_call = string.Template("""
-    if (${agent_class}* ${agent}Agent = ${agent_fetch})
-        ${agent}Agent->${name}(${params_agent});""")
+    if (${agent_class}* agent = ${agent_fetch})
+        ${maybe_return}agent->${name}(${params_agent});""")
 
-template_timeline_agent_call = string.Template("""
+template_agent_call_timeline_returns_cookie = string.Template("""
     int timelineAgentId = 0;
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) {
-        if (timelineAgent->${name}(${params_agent}))
-            timelineAgentId = timelineAgent->id();
+    if (InspectorTimelineAgent* agent = agents->inspectorTimelineAgent()) {
+        if (agent->${name}(${params_agent}))
+            timelineAgentId = agent->id();
     }""")
 
-template_outofline_returns_cookie = string.Template("""
-${return_type} ${name}Impl(${params_impl})
-{${agent_calls}
-    return InspectorInstrumentationCookie(instrumentingAgents, ${timeline_agent_id});
+
+template_instrumenting_agents_h = string.Template("""// Code generated from InspectorInstrumentation.idl
+
+#ifndef InstrumentingAgentsInl_h
+#define InstrumentingAgentsInl_h
+
+#include <wtf/FastAllocBase.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+${forward_list}
+
+class InstrumentingAgents : public RefCounted<InstrumentingAgents> {
+    WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static PassRefPtr<InstrumentingAgents> create()
+    {
+        return adoptRef(new InstrumentingAgents());
+    }
+    ~InstrumentingAgents() { }
+    void reset();
+
+${accessor_list}
+
+private:
+    InstrumentingAgents();
+
+${member_list}
+};
+
+}
+
+#endif // !defined(InstrumentingAgentsInl_h)
+""")
+
+template_instrumenting_agent_accessor = string.Template("""
+    ${class_name}* ${getter_name}() const { return ${member_name}; }
+    void set${class_name}(${class_name}* agent) { ${member_name} = agent; }""")
+
+template_instrumenting_agents_cpp = string.Template("""
+InstrumentingAgents::InstrumentingAgents()
+    : $init_list
+{
+}
+
+void InstrumentingAgents::reset()
+{
+    $reset_list
 }""")
 
 
+
+def match_and_consume(pattern, source):
+    match = re.match(pattern, source)
+    if match:
+        return match, source[len(match.group(0)):].strip()
+    return None, source
+
+
 def load_model_from_idl(source):
-    source = re.sub("//.*\n", "", source)    # Remove line comments
-    source = re.sub("\n", " ", source)       # Remove newlines
-    source = re.sub("/\*.*\*/", "", source)  # Remove block comments
-    source = re.sub("\s\s+", " ", source)    # Collapse whitespace
+    source = re.sub("//.*", "", source)  # Remove line comments
+    source = re.sub("/\*(.|\n)*?\*/", "", source, re.MULTILINE)  # Remove block comments
+    source = re.sub("\]\s*?\n\s*", "] ", source)  # Merge the method annotation with the next line
     source = source.strip()
 
-    match = re.match("interface\s\w*\s?\{(.*)\}", source)
-    if not match:
-        sys.stderr.write("Cannot parse the file")
-        sys.exit(1)
-    lines = match.group(1)
+    model = []
 
-    methods = []
-    for line in map(str.strip, lines.split(";")):
-        if len(line) == 0:
-            continue
-        methods.append(Method(line))
-    return methods
+    while len(source):
+        match, source = match_and_consume("interface\s(\w*)\s?\{([^\{]*)\}", source)
+        if not match:
+            sys.stderr.write("Cannot parse %s\n" % source[:100])
+            sys.exit(1)
+        model.append(File(match.group(1), match.group(2)))
+
+    return model
+
+
+class File:
+    def __init__(self, name, source):
+        self.name = name
+        self.header_name = self.name + "Inl"
+        self.includes = [include_inspector_header("InspectorInstrumentation")]
+        self.declarations = []
+        for line in map(str.strip, source.split("\n")):
+            line = re.sub("\s{2,}", " ", line).strip()  # Collapse whitespace
+            if len(line) == 0:
+                continue
+            if line[0] == "#":
+                self.includes.append(line)
+            else:
+                self.declarations.append(Method(line))
+        self.includes.sort()
+
+    def generate(self, cpp_lines, used_agents):
+        header_lines = []
+        for declaration in self.declarations:
+            for agent in set(declaration.agents):
+                used_agents.add(agent)
+            declaration.generate_header(header_lines)
+            declaration.generate_cpp(cpp_lines)
+
+        return template_h.substitute(None,
+                                     file_name=self.header_name,
+                                     includes="\n".join(self.includes),
+                                     methods="\n".join(header_lines))
 
 
 class Method:
     def __init__(self, source):
-        match = re.match("(\[[\w|,|=|\s]*\])?\s?(\w*) (\w*)\((.*)\)", source)
+        match = re.match("(\[[\w|,|=|\s]*\])?\s?(\w*\*?) (\w*)\((.*)\)\s?;", source)
         if not match:
             sys.stderr.write("Cannot parse %s\n" % source)
             sys.exit(1)
 
-        self.method_options = []
+        self.options = []
         if match.group(1):
-            method_options_str = re.sub("\s", "", match.group(1)[1:-1])
-            if len(method_options_str) != 0:
-                self.method_options = method_options_str.split(",")
+            options_str = re.sub("\s", "", match.group(1)[1:-1])
+            if len(options_str) != 0:
+                self.options = options_str.split(",")
 
         self.return_type = match.group(2)
 
         self.name = match.group(3)
 
-        param_string = match.group(4)
+        # Splitting parameters by a comma, assuming that attribute lists contain no more than one attribute.
+        self.params = map(Parameter, map(str.strip, match.group(4).split(",")))
 
-        self.param_options = []
-        options_match = re.match("\[(.*)\]\s?(.*)", param_string)
-        if options_match:
-            param_string = options_match.group(2)
-            self.param_options = map(str.strip, options_match.group(1).split(","))
+        self.accepts_cookie = len(self.params) and self.params[0].type == "const InspectorInstrumentationCookie&"
+        self.returns_cookie = self.return_type == "InspectorInstrumentationCookie"
 
-        self.params = map(Parameter, map(str.strip, param_string.split(",")))
+        self.returns_value = self.return_type != "void"
+
+        if self.return_type == "bool":
+            self.default_return_value = "false"
+        elif self.return_type == "String":
+            self.default_return_value = "\"\""
+        else:
+            self.default_return_value = self.return_type + "()"
+
+        for param in self.params:
+            if "DefaultReturn" in param.options:
+                self.default_return_value = param.name
+
+        self.params_impl = self.params
+        if not self.accepts_cookie and not "Inline=Forward" in self.options:
+            if not "Keep" in self.params_impl[0].options:
+                self.params_impl = self.params_impl[1:]
+            self.params_impl = [Parameter("InstrumentingAgents* agents")] + self.params_impl
+            self.agents_selector_class = re.match("(\w*)", self.params[0].type).group(1)
+
+        self.agents = filter(lambda option: not "=" in option, self.options)
+
+    def generate_header(self, header_lines):
+        if "Inline=Custom" in self.options:
+            return
+
+        header_lines.append("%s %sImpl(%s);" % (
+            self.return_type, self.name, ", ".join(map(Parameter.to_str_class, self.params_impl))))
+
+        if "Inline=FastReturn" in self.options or "Inline=Forward" in self.options:
+            fast_return = "\n    FAST_RETURN_IF_NO_FRONTENDS(%s);" % self.default_return_value
+        else:
+            fast_return = ""
+
+        for param in self.params:
+            if "FastReturn" in param.options:
+                fast_return += "\n    if (!%s)\n        return %s;" % (param.name, self.default_return_value)
+
+        if self.accepts_cookie:
+            condition = "%s.isValid()" % self.params_impl[0].name
+            template = template_inline
+        elif "Inline=Forward" in self.options:
+            condition = ""
+            template = template_inline_forward
+        else:
+            condition = "InstrumentingAgents* agents = instrumentingAgentsFor%s(%s)" % (
+                self.agents_selector_class, self.params[0].name)
+
+            if self.returns_value:
+                template = template_inline_returns_value
+            else:
+                template = template_inline
+
+        header_lines.append(template.substitute(
+            None,
+            name=self.name,
+            fast_return=fast_return,
+            return_type=self.return_type,
+            default_return_value=self.default_return_value,
+            params_public=", ".join(map(Parameter.to_str_full, self.params)),
+            params_impl=", ".join(map(Parameter.to_str_name, self.params_impl)),
+            condition=condition))
+
+    def generate_cpp(self, cpp_lines):
+        if len(self.agents) == 0:
+            return
+
+        body_lines = map(self.generate_agent_call, self.agents)
+
+        if self.returns_cookie:
+            if "Timeline" in self.agents:
+                timeline_agent_id = "timelineAgentId"
+            else:
+                timeline_agent_id = "0"
+            body_lines.append("\n    return InspectorInstrumentationCookie(agents, %s);" % timeline_agent_id)
+        elif self.returns_value:
+            body_lines.append("\n    return %s;" % self.default_return_value)
+
+        cpp_lines.append(template_outofline.substitute(
+            None,
+            return_type=self.return_type,
+            name=self.name,
+            params_impl=", ".join(map(Parameter.to_str_class_and_name, self.params_impl)),
+            impl_lines="".join(body_lines)))
+
+    def generate_agent_call(self, agent):
+        agent_class, agent_getter = agent_getter_signature(agent)
+
+        leading_param_name = self.params_impl[0].name
+        if not self.accepts_cookie:
+            agent_fetch = "%s->%s()" % (leading_param_name, agent_getter)
+        elif agent == "Timeline":
+            agent_fetch = "retrieveTimelineAgent(%s)" % leading_param_name
+        else:
+            agent_fetch = "%s.instrumentingAgents()->%s()" % (leading_param_name, agent_getter)
+
+        if agent == "Timeline" and self.returns_cookie:
+            template = template_agent_call_timeline_returns_cookie
+        else:
+            template = template_agent_call
+
+        if not self.returns_value or self.returns_cookie:
+            maybe_return = ""
+        else:
+            maybe_return = "return "
+
+        return template.substitute(
+            None,
+            name=self.name,
+            agent_class=agent_class,
+            agent_fetch=agent_fetch,
+            maybe_return=maybe_return,
+            params_agent=", ".join(map(Parameter.to_str_name, self.params_impl)[1:]))
 
 
 class Parameter:
     def __init__(self, source):
+        self.options = []
+        match, source = match_and_consume("\[(\w*)\]", source)
+        if match:
+            self.options.append(match.group(1))
+
         parts = map(str.strip, source.split("="))
         if len(parts) == 1:
             self.default_value = None
@@ -232,45 +401,9 @@
         return self.name
 
 
-# This function is only needed to minimize the diff with the handwritten code.
-# In fact it is sufficient to return a globally unique string.
 def generate_param_name(param_type):
-    base_name = re.match("(const |RefPtr<|PassRefPtr<)?(\w*)", param_type).group(2)
-
-    custom_param_types = {
-        "CharacterData": "characterData",
-        "CSSSelector": "pseudoState",
-        "DocumentStyleSheetCollection": "styleSheetCollection",
-        "EventPath": "eventPath",
-        "FormData": "formData",
-        "InspectorCSSOMWrappers": "inspectorCSSOMWrappers",
-        "InstrumentingAgents": "instrumentingAgents",
-        "NamedFlow": "namedFlow",
-        "RenderObject": "renderer",
-        "RenderLayer": "renderLayer",
-        "ResourceLoader": "resourceLoader",
-        "PseudoElement": "pseudoElement",
-        "ScriptState": "scriptState"}
-    if base_name in custom_param_types:
-        return custom_param_types[base_name]
-
-    match = re.match("(.*)([A-Z][a-z]+)", base_name)
-    if match:
-        return match.group(2).lower()  # CamelCaseWord -> word
-
-    if base_name.lower() == base_name:
-        return base_name + "_"
-    return base_name.lower()
-
-
-# This function is only needed to minimize the diff with the handwritten code.
-# In fact is is sufficient to hardcode a constant string (e.g. "agent") into the template.
-def agent_variable_name(agent):
-    if re.match("DOM", agent):
-        return re.sub("DOM", "dom", agent)
-    if agent.upper() == agent:
-        return agent.lower()
-    return agent[0].lower() + agent[1:]
+    base_name = re.match("(const |PassRefPtr<)?(\w*)", param_type).group(2)
+    return "param" + base_name
 
 
 def agent_class_name(agent):
@@ -280,178 +413,93 @@
     return "Inspector%sAgent" % agent
 
 
-def agent_getter_name(agent):
-    name = agent_class_name(agent)
-    return name[0].lower() + name[1:]
+def agent_getter_signature(agent):
+    agent_class = agent_class_name(agent)
+    return agent_class, agent_class[0].lower() + agent_class[1:]
+
+
+def include_header(name):
+    return "#include \"%s.h\"" % name
+
+
+def include_inspector_header(name):
+    return include_header("core/inspector/" + name)
+
+
+def generate_instrumenting_agents(used_agents):
+    agents = list(used_agents)
+
+    forward_list = []
+    accessor_list = []
+    member_list = []
+    init_list = []
+    reset_list = []
+
+    for agent in agents:
+        class_name, getter_name = agent_getter_signature(agent)
+        member_name = "m_" + getter_name
+
+        forward_list.append("class %s;" % class_name)
+        accessor_list.append(template_instrumenting_agent_accessor.substitute(
+            None,
+            class_name=class_name,
+            getter_name=getter_name,
+            member_name=member_name))
+        member_list.append("    %s* %s;" % (class_name, member_name))
+        init_list.append("%s(0)" % member_name)
+        reset_list.append("%s = 0;" % member_name)
+
+    forward_list.sort()
+    accessor_list.sort()
+    member_list.sort()
+    init_list.sort()
+    reset_list.sort()
+
+    header_lines = template_instrumenting_agents_h.substitute(
+        None,
+        forward_list="\n".join(forward_list),
+        accessor_list="\n".join(accessor_list),
+        member_list="\n".join(member_list))
+
+    cpp_lines = template_instrumenting_agents_cpp.substitute(
+        None,
+        init_list="\n    , ".join(init_list),
+        reset_list="\n    ".join(reset_list))
+
+    return header_lines, cpp_lines
 
 
 def generate(input_path, output_h_dir, output_cpp_dir):
     fin = open(input_path, "r")
-    declarations = load_model_from_idl(fin.read())
+    files = load_model_from_idl(fin.read())
     fin.close()
 
-    impl_declarations = []
-    inline_methods = []
-    out_of_line_methods = []
+    cpp_includes = []
+    cpp_lines = []
+    used_agents = set()
+    for f in files:
+        cpp_includes.append(include_header(f.header_name))
 
-    for declaration in declarations:
-        param_string_public = ", ".join(map(Parameter.to_str_full, declaration.params))
+        fout = open(output_h_dir + "/" + f.header_name + ".h", "w")
+        fout.write(f.generate(cpp_lines, used_agents))
+        fout.close()
 
-        param_list_impl_parsed = declaration.params[:]
+    for agent in used_agents:
+        cpp_includes.append(include_inspector_header(agent_class_name(agent)))
+    cpp_includes.append(include_header("InstrumentingAgentsInl"))
+    cpp_includes.sort()
 
-        accepts_cookie = (declaration.params[0].type == "const InspectorInstrumentationCookie&")
-        if not accepts_cookie and not "Inline=Forward" in declaration.method_options:
-            if not "Keep" in declaration.param_options:
-                param_list_impl_parsed = param_list_impl_parsed[1:]
-            param_list_impl_parsed = [Parameter("InstrumentingAgents*")] + param_list_impl_parsed
+    instrumenting_agents_header, instrumenting_agents_cpp = generate_instrumenting_agents(used_agents)
 
-        generate_inline = not "Inline=Custom" in declaration.method_options
-        if generate_inline:
-            impl_declarations.append("%s %sImpl(%s);" % (
-                declaration.return_type, declaration.name, ", ".join(map(Parameter.to_str_class, param_list_impl_parsed))))
-
-        leading_impl_param_name = param_list_impl_parsed[0].name
-        param_string_impl_full = ", ".join(map(Parameter.to_str_class_and_name, param_list_impl_parsed))
-
-        param_list_impl_names_only = map(Parameter.to_str_name, param_list_impl_parsed)
-        param_string_impl_names_only = ", ".join(param_list_impl_names_only)
-        param_string_agent = ", ".join(param_list_impl_names_only[1:])
-
-        def is_agent_name(name):
-            return not "=" in name
-
-        agents = filter(is_agent_name, declaration.method_options)
-
-        if "Inline=FastReturn" in declaration.method_options or "Inline=Forward" in declaration.method_options:
-            fast_return = "\n    FAST_RETURN_IF_NO_FRONTENDS(%s());" % declaration.return_type
-        else:
-            fast_return = ""
-
-        if accepts_cookie:
-            if generate_inline:
-                inline_methods.append(
-                    template_inline_accepts_cookie.substitute(
-                        None,
-                        name=declaration.name,
-                        fast_return=fast_return,
-                        params_public=param_string_public,
-                        params_impl=param_string_impl_names_only,
-                        cookie=leading_impl_param_name))
-            if len(agents):
-                agent_calls = []
-                for agent in agents:
-                    if agent == "Timeline":
-                        agent_fetch = "retrieveTimelineAgent(%s)" % leading_impl_param_name
-                    else:
-                        agent_fetch = "%s.instrumentingAgents()->%s()" % (leading_impl_param_name, agent_getter_name(agent))
-                    agent_calls.append(
-                        template_agent_call.substitute(
-                            None,
-                            name=declaration.name,
-                            agent_fetch=agent_fetch,
-                            params_agent=param_string_agent,
-                            agent_class=agent_class_name(agent),
-                            agent=agent_variable_name(agent)))
-                out_of_line_methods.append(
-                    template_outofline.substitute(
-                        None,
-                        name=declaration.name,
-                        params_impl=param_string_impl_full,
-                        agent_calls="".join(agent_calls)))
-        else:
-            leading_public_param = declaration.params[0]
-            selector_class = re.match("(\w*)", leading_public_param.type).group(1)
-            agents_getter = "instrumentingAgentsFor%s(%s)" % (selector_class, leading_public_param.name)
-            if declaration.return_type == "void":
-                if generate_inline:
-                    if "Inline=Forward" in declaration.method_options:
-                        inline_methods.append(
-                            template_inline_forward.substitute(
-                                None,
-                                name=declaration.name,
-                                fast_return=fast_return,
-                                params_public=param_string_public,
-                                params_impl=param_string_impl_names_only))
-                    else:
-                        inline_methods.append(
-                            template_inline.substitute(
-                                None,
-                                name=declaration.name,
-                                fast_return=fast_return,
-                                params_public=param_string_public,
-                                params_impl=param_string_impl_names_only,
-                                agents_getter=agents_getter))
-                if len(agents):
-                    agent_calls = []
-                    for agent in agents:
-                        agent_fetch = "%s->%s()" % (leading_impl_param_name, agent_getter_name(agent))
-                        agent_call = template_agent_call.substitute(
-                            None,
-                            name=declaration.name,
-                            agent_fetch=agent_fetch,
-                            params_agent=param_string_agent,
-                            agent_class=agent_class_name(agent),
-                            agent=agent_variable_name(agent))
-                        agent_calls.append(agent_call)
-                    out_of_line_methods.append(
-                        template_outofline.substitute(
-                            None,
-                            name=declaration.name,
-                            params_impl=param_string_impl_full,
-                            agent_calls="".join(agent_calls)))
-            elif declaration.return_type == "InspectorInstrumentationCookie":
-                if generate_inline:
-                    inline_methods.append(
-                        template_inline_returns_cookie.substitute(
-                            None,
-                            name=declaration.name,
-                            fast_return=fast_return,
-                            params_public=param_string_public,
-                            params_impl=param_string_impl_names_only,
-                            agents_getter=agents_getter))
-
-                if len(agents):
-                    timeline_agent_id = "0"
-                    agent_calls = []
-                    for agent in agents:
-                        if agent == "Timeline":
-                            agent_call = template_timeline_agent_call.substitute(
-                                None,
-                                name=declaration.name,
-                                params_agent=param_string_agent)
-                            timeline_agent_id = "timelineAgentId"
-                        else:
-                            agent_fetch = "%s->%s()" % (leading_impl_param_name, agent_getter_name(agent))
-                            agent_call = template_agent_call.substitute(
-                                None,
-                                name=declaration.name,
-                                agent_fetch=agent_fetch,
-                                params_agent=param_string_agent,
-                                agent_class=agent_class_name(agent),
-                                agent=agent_variable_name(agent))
-                        agent_calls.append(agent_call)
-
-                    out_of_line_methods.append(
-                        template_outofline_returns_cookie.substitute(
-                            None,
-                            return_type=declaration.return_type,
-                            name=declaration.name,
-                            params_impl=param_string_impl_full,
-                            agent_calls="".join(agent_calls),
-                            timeline_agent_id=timeline_agent_id))
-            else:
-                sys.stderr.write("Unsupported return type %s" % declaration.return_type)
-                sys.exit(1)
-
-    fout = open(output_h_dir + "/InspectorInstrumentationInl.h", "w")
-    fout.write(template_h.substitute(None,
-                                     impl_declarations="\n".join(impl_declarations),
-                                     inline_methods="".join(inline_methods)))
+    fout = open(output_h_dir + "/" + "InstrumentingAgentsInl.h", "w")
+    fout.write(instrumenting_agents_header)
     fout.close()
 
     fout = open(output_cpp_dir + "/InspectorInstrumentationImpl.cpp", "w")
     fout.write(template_cpp.substitute(None,
-                                       out_of_line_methods="\n".join(out_of_line_methods)))
+                                       includes="\n".join(cpp_includes),
+                                       extra_definitions=instrumenting_agents_cpp,
+                                       methods="\n".join(cpp_lines)))
     fout.close()
 
 
diff --git a/core/inspector/InjectedScriptHost.idl b/core/inspector/InjectedScriptHost.idl
index 9a6de9a..87dc9d8 100644
--- a/core/inspector/InjectedScriptHost.idl
+++ b/core/inspector/InjectedScriptHost.idl
@@ -47,6 +47,10 @@
     [Custom] any evaluate(DOMString text);
     [Custom] DOMString databaseId(any database);
     [Custom] DOMString storageId(any storage);
+    [Custom] void debugFunction(any fn);
+    [Custom] void undebugFunction(any fn);
+    [Custom] void monitorFunction(any fn);
+    [Custom] void unmonitorFunction(any fn);
 
     // Only declarative scope (local, with and catch) is accepted. Returns undefined. 
     [Custom] any setFunctionVariableValue(any functionObject, int scopeIndex, DOMString variableName, any newValue);
diff --git a/core/inspector/InspectorInstrumentation.idl b/core/inspector/InspectorInstrumentation.idl
index 85cb8b6..41e5840 100644
--- a/core/inspector/InspectorInstrumentation.idl
+++ b/core/inspector/InspectorInstrumentation.idl
@@ -36,7 +36,7 @@
 *
 * The syntax for an instrumentation method is as follows:
 *
-*    [methodAttributes] returnValue methodName([paramAttributes] paramList)
+*    [methodAttributes] returnValue methodName([paramAttr1] param1, [paramAttr2] param2, ...)
 *
 * Where:
 *   methodAttributes - optional list of method attributes.
@@ -48,8 +48,9 @@
 *       Attributes without "=" are the names of the agents to be invoked.
 *           Examples: DOM, Page, Debugger.
 *
-*   paramAttributes - options list of attributes controlling the parameters handling.
+*   paramAttr - optional attribute controlling the parameters handling (one attribute per parameter max).
 *       Keep - pass first parameter (used to access the InstrumentingAgents instance) to agents.
+*       FastReturn - return early from the inline method if this parameter is 0/false.
 *
 *   returnValue: C++ return value. Only "void" and "InspectorInstrumentationCookie" are supported.
 *
@@ -114,6 +115,9 @@
     [DOMDebugger, Inline=FastReturn]
     void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
 
+    [DOMDebugger, Inline=FastReturn]
+    void didFireWebGLError(Document*, const String& errorName);
+
     [Timeline, Inline=FastReturn]
     void didScheduleResourceRequest([Keep] Document*, const String& url);
 
@@ -222,8 +226,8 @@
     [CSS, Inline=FastReturn]
     void didMatchRule(const InspectorInstrumentationCookie&, bool matched);
 
-    [CSS, Inline=Custom]
-    InspectorInstrumentationCookie willProcessRule(Document* document, StyleRule* rule, StyleResolver* styleResolver);
+    [CSS, Inline=FastReturn]
+    InspectorInstrumentationCookie willProcessRule(Document* document, [FastReturn] StyleRule* rule, StyleResolver* styleResolver);
 
     [CSS, Inline=FastReturn]
     void didProcessRule(const InspectorInstrumentationCookie&);
@@ -241,7 +245,7 @@
     void applyEmulatedMedia(Frame*, String* media);
 
     [Timeline, Resource]
-    void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
+    void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const CachedResourceInitiatorInfo&);
 
     void continueAfterPingLoader(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
 
@@ -288,7 +292,7 @@
     void didFailXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient* client);
 
     [Console, Resource]
-    void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
+    void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
 
     [Resource]
     void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
@@ -365,36 +369,6 @@
     [Timeline, Inline=FastReturn]
     void didFireAnimationFrame(const InspectorInstrumentationCookie&);
 
-    [Console, Debugger, Inline=Custom]  // FIXME: Drop this once we no longer generate stacks outside of Inspector.
-    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier = 0);
-
-    [Console, Debugger, Inline=Custom]
-    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier = 0);
-
-    [Console, Inline=Custom]
-    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, ScriptState* state = 0, unsigned long requestIdentifier = 0);
-
-    [Console, Inline=Custom]
-    void consoleCount(Page* page, ScriptState* state, PassRefPtr<ScriptArguments> arguments);
-
-    [Timeline, Console, Inline=Custom]
-    void startConsoleTiming([Keep] Frame* frame, const String& title);
-
-    [Console, Timeline, Inline=Custom]
-    void stopConsoleTiming([Keep] Frame* frame, const String& title, PassRefPtr<ScriptCallStack> stack);
-
-    [Timeline, Inline=Custom]
-    void consoleTimeStamp([Keep] Frame* frame, PassRefPtr<ScriptArguments> arguments);
-
-    [Profiler, Inline=Custom]
-    void addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL);
-
-    [Profiler, Inline=Custom]
-    void addProfile(Page* page, PassRefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack);
-
-    [Database, Inline=Custom]
-    void didOpenDatabase(ScriptExecutionContext* context, PassRefPtr<Database> database, const String& domain, const String& name, const String& version);
-
     [DOMStorage, Inline=FastReturn]
     void didDispatchDOMStorageEvent(Page* page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin);
 
@@ -443,3 +417,87 @@
     [LayerTree]
     void pseudoElementDestroyed(Page*, PseudoElement*);
 }
+
+interface InspectorConsoleInstrumentation {
+
+#include "core/inspector/ScriptArguments.h"
+#include "core/inspector/ScriptCallStack.h"
+#include "core/inspector/ScriptProfile.h"
+
+    [Console, Debugger]  // FIXME: Drop this once we no longer generate stacks outside of Inspector.
+    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier = 0);
+
+    [Console, Debugger]
+    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier = 0);
+
+    [Console]
+    void addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, ScriptState* state = 0, unsigned long requestIdentifier = 0);
+
+    // FIXME: Convert to ScriptArguments to match non-worker context.
+    // Use the same implementation as above as a similar method dispatched on Page.
+    void addMessageToConsole(WorkerContext* workerContext, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier = 0);
+
+    // Use the same implementation as above as a similar method dispatched on Page.
+    void addMessageToConsole(WorkerContext* workerContext, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, ScriptState* state, unsigned long requestIdentifier = 0);
+
+    [Console]
+    void consoleCount(Page* page, ScriptState* state, PassRefPtr<ScriptArguments> arguments);
+
+    [Timeline, Console]
+    void startConsoleTiming([Keep] Frame* frame, const String& title);
+
+    [Console, Timeline]
+    void stopConsoleTiming([Keep] Frame* frame, const String& title, PassRefPtr<ScriptCallStack> stack);
+
+    [Timeline, Inline=FastReturn]
+    void consoleTimeStamp([Keep] Frame* frame, PassRefPtr<ScriptArguments> arguments);
+
+    [Profiler]
+    void addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL);
+
+    [Profiler]
+    void addProfile(Page* page, PassRefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack);
+}
+
+interface InspectorDatabaseInstrumentation {
+
+#include "modules/webdatabase/Database.h"
+
+    [Database]
+    void didOpenDatabase(ScriptExecutionContext* context, PassRefPtr<Database> database, const String& domain, const String& name, const String& version);
+}
+
+interface InspectorOverrides {
+    [CSS, Inline=FastReturn]
+    bool forcePseudoState([Keep] Element* element, CSSSelector::PseudoType pseudoState);
+
+    [Page, Inline=FastReturn]
+    bool shouldApplyScreenWidthOverride(Frame* frame);
+
+    [Page, Inline=FastReturn]
+    bool shouldApplyScreenHeightOverride(Frame* frame);
+
+    [Worker, Inline=FastReturn]
+    bool shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext* context);
+
+    [Page, Inline=FastReturn]
+    GeolocationPosition* overrideGeolocationPosition(Page* page, [DefaultReturn] GeolocationPosition* position);
+
+    [Page, Inline=FastReturn]
+    DeviceOrientationData* overrideDeviceOrientation(Page* page, [DefaultReturn] DeviceOrientationData* deviceOrientation);
+
+    [Profiler]
+    String getCurrentUserInitiatedProfileName(Page* page, bool incrementProfileNumber);
+}
+
+
+interface InspectorCanvasInstrumentation {
+
+#include "bindings/v8/ScriptObject.h"
+
+    [Canvas]
+    ScriptObject wrapCanvas2DRenderingContextForInstrumentation(Document*, const ScriptObject&);
+
+    [Canvas]
+    ScriptObject wrapWebGLRenderingContextForInstrumentation(Document*, const ScriptObject&);
+}
diff --git a/core/page/DOMWindowPagePopup.idl b/core/inspector/InspectorOverlayHost.idl
similarity index 87%
copy from core/page/DOMWindowPagePopup.idl
copy to core/inspector/InspectorOverlayHost.idl
index 2ce0bec..2f1978e 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/core/inspector/InspectorOverlayHost.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,8 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+    NoInterfaceObject
+] interface InspectorOverlayHost {
+    void resume();
+    void stepOver();
 };
diff --git a/core/page/EventSource.idl b/core/page/EventSource.idl
index c9ff7b3..b50a876 100644
--- a/core/page/EventSource.idl
+++ b/core/page/EventSource.idl
@@ -33,8 +33,8 @@
     GlobalContext=WindowAndWorker,
     ActiveDOMObject,
     Constructor(DOMString url, optional Dictionary eventSourceInit),
-    CallWith=ScriptExecutionContext,
-    RaisesException,
+    ConstructorCallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
     EventTarget
 ] interface EventSource {
 
diff --git a/core/page/DOMPoint.idl b/core/page/WebKitPoint.idl
similarity index 96%
rename from core/page/DOMPoint.idl
rename to core/page/WebKitPoint.idl
index b5fb534..6ac44cd 100644
--- a/core/page/DOMPoint.idl
+++ b/core/page/WebKitPoint.idl
@@ -26,8 +26,8 @@
 [
     CustomConstructor,
     CustomConstructor(float x, float y),
-    InterfaceName=WebKitPoint
-] interface DOMPoint {
+    ImplementedAs=DOMPoint
+] interface WebKitPoint {
     attribute float x;
     attribute float y;
 };
diff --git a/core/page/DOMWindow.idl b/core/page/Window.idl
similarity index 85%
rename from core/page/DOMWindow.idl
rename to core/page/Window.idl
index 09224c2..d468230 100644
--- a/core/page/DOMWindow.idl
+++ b/core/page/Window.idl
@@ -29,8 +29,8 @@
     EventTarget,
     CustomToV8,
     DoNotGenerateWrap,
-    InterfaceName=Window
-] interface DOMWindow {
+    ImplementedAs=DOMWindow
+] interface Window {
     // DOM Level 0
     [Replaceable] readonly attribute Screen screen;
     [Replaceable] readonly attribute History history;
@@ -42,7 +42,6 @@
     [Replaceable] readonly attribute BarProp toolbar;
     [Replaceable, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] readonly attribute Navigator navigator;
     [Replaceable] readonly attribute Navigator clientInformation;
-    readonly attribute Crypto crypto;
     [DoNotCheckSecurity, CustomSetter, Unforgeable, Replaceable, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds] readonly attribute Location location;
     [MeasureAs=WindowEvent, NotEnumerable, Replaceable, CustomGetter, CustomSetter] readonly attribute Event event;
 
@@ -57,7 +56,7 @@
     void print();
     void stop();
 
-    [Custom] DOMWindow open(DOMString url,
+    [Custom] Window open(DOMString url,
                             DOMString name,
                             optional DOMString options);
 
@@ -113,13 +112,13 @@
     attribute DOMString defaultstatus;
 
     // Self referential attributes
-    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow self;
-    [DoNotCheckSecurity, Unforgeable] readonly attribute DOMWindow window;
-    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute  DOMWindow frames;
+    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute Window self;
+    [DoNotCheckSecurity, Unforgeable] readonly attribute Window window;
+    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute  Window frames;
 
-    [Replaceable, DoNotCheckSecurityOnGetter, CustomSetter] readonly attribute DOMWindow opener;
-    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute DOMWindow parent;
-    [DoNotCheckSecurityOnGetter, Unforgeable] readonly attribute DOMWindow top;
+    [Replaceable, DoNotCheckSecurityOnGetter, CustomSetter] readonly attribute Window opener;
+    [Replaceable, DoNotCheckSecurityOnGetter] readonly attribute Window parent;
+    [DoNotCheckSecurityOnGetter, Unforgeable] readonly attribute Window top;
 
     // DOM Level 2 AbstractView Interface
     readonly attribute Document document;
@@ -140,22 +139,20 @@
 
     [Replaceable] readonly attribute double devicePixelRatio;
 
-    DOMPoint webkitConvertPointFromPageToNode([Default=Undefined] optional Node node,
-                                              [Default=Undefined] optional DOMPoint p);
-    DOMPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional Node node,
-                                              [Default=Undefined] optional DOMPoint p);
+    WebKitPoint webkitConvertPointFromPageToNode([Default=Undefined] optional Node node,
+                                                 [Default=Undefined] optional WebKitPoint p);
+    WebKitPoint webkitConvertPointFromNodeToPage([Default=Undefined] optional Node node,
+                                                 [Default=Undefined] optional WebKitPoint p);
 
     [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] readonly attribute DOMApplicationCache applicationCache;
 
     [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds, GetterRaisesException] readonly attribute Storage sessionStorage;
     [EnabledAtRuntime, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds, GetterRaisesException] readonly attribute Storage localStorage;
 
-#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
     // This is the interface orientation in degrees. Some examples are:
     //  0 is straight up; -90 is when the device is rotated 90 clockwise;
     //  90 is when rotated counter clockwise.
-    readonly attribute long orientation;
-#endif
+    [Conditional=ORIENTATION_EVENTS] readonly attribute long orientation;
 
     [Replaceable] readonly attribute Console console;
 
@@ -164,12 +161,6 @@
 
     [Replaceable] readonly attribute Performance performance;
 
-    // Timers
-    [Custom] long setTimeout(any handler, [Default=Undefined] optional long timeout);
-    void clearTimeout([Default=Undefined] optional long handle);
-    [Custom] long setInterval(any handler, [Default=Undefined] optional long timeout);
-    void clearInterval([Default=Undefined] optional long handle);
-
     [MeasureAs=UnprefixedRequestAnimationFrame] long requestAnimationFrame(RequestAnimationFrameCallback callback);
     void cancelAnimationFrame(long id);
     [MeasureAs=PrefixedRequestAnimationFrame] long webkitRequestAnimationFrame(RequestAnimationFrameCallback callback);
@@ -261,9 +252,7 @@
     attribute EventListener onwebkitanimationstart;
     attribute EventListener onwebkittransitionend;
     attribute EventListener ontransitionend;
-#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
-    attribute EventListener onorientationchange;
-#endif
+    [Conditional=ORIENTATION_EVENTS] attribute EventListener onorientationchange;
     [EnabledAtRuntime=touch] attribute EventListener ontouchstart;
     [EnabledAtRuntime=touch] attribute EventListener ontouchmove;
     [EnabledAtRuntime=touch] attribute EventListener ontouchend;
@@ -298,40 +287,26 @@
     attribute IDBRequestConstructor webkitIDBRequest;
     attribute IDBTransactionConstructor webkitIDBTransaction;
 
-    // Constructors enabled at runtime but whose interface does not have EnabledAtRuntime
-    // extended attribute.
-    // FIXME: Remove these.
-    [EnabledAtRuntime=media] attribute MediaErrorConstructor MediaError;
-    [EnabledAtRuntime=media] attribute TimeRangesConstructor TimeRanges;
-    [EnabledAtRuntime=media] attribute HTMLSourceElementConstructor HTMLSourceElement;
-    [EnabledAtRuntime=media] attribute MediaControllerConstructor MediaController;
-    [EnabledAtRuntime=deviceMotion] attribute DeviceMotionEventConstructor DeviceMotionEvent;
-    [EnabledAtRuntime=touch] attribute TouchConstructor Touch;
-    [EnabledAtRuntime=touch] attribute TouchEventConstructor TouchEvent;
-    [EnabledAtRuntime=touch] attribute TouchListConstructor TouchList;
-    [EnabledAtRuntime=webMIDI] attribute MIDIConnectionEventConstructor MIDIConnectionEvent;
-    [EnabledAtRuntime=webMIDI] attribute MIDIMessageEventConstructor MIDIMessageEvent;
+    // Constructors whose name does not match the interface name.
+    // FIXME: Remove these once [ImplementedAs] is used and once constructor names match interface names.
     [EnabledAtRuntime=mediaStream] attribute MediaStreamConstructor webkitMediaStream;
     [Conditional=WEB_AUDIO, EnabledAtRuntime=WebAudio] attribute AudioContextConstructor webkitAudioContext;
     [Conditional=WEB_AUDIO, EnabledAtRuntime=WebAudio] attribute OfflineAudioContextConstructor webkitOfflineAudioContext;
     [EnabledAtRuntime=peerConnection] attribute RTCPeerConnectionConstructor webkitRTCPeerConnection;
-    [EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute SecurityPolicyViolationEventConstructor SecurityPolicyViolationEvent;
-    [EnabledAtRuntime] attribute SharedWorkerConstructor SharedWorker; // Usable with the new operator
     [EnabledAtRuntime=scriptedSpeech] attribute SpeechGrammarConstructor webkitSpeechGrammar;
     [EnabledAtRuntime=scriptedSpeech] attribute SpeechGrammarListConstructor webkitSpeechGrammarList;
     [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionConstructor webkitSpeechRecognition;
     [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionErrorConstructor webkitSpeechRecognitionError;
     [EnabledAtRuntime=scriptedSpeech] attribute SpeechRecognitionEventConstructor webkitSpeechRecognitionEvent;
-
-    // Constructors whose name does not match the interface name.
-    // FIXME: Remove these once [ImplementedAs] is used and once constructor names match interface names.
     attribute ShadowRootConstructor WebKitShadowRoot;
     [Conditional=WEB_AUDIO] attribute PannerNodeConstructor webkitAudioPannerNode;
 
     // window.toString() requires special handling in V8
     [DoNotCheckSignature, DoNotCheckSecurity, Custom, NotEnumerable] DOMString toString();
 
-    [ImplementedAs=anonymousIndexedGetter, NotEnumerable] getter DOMWindow(unsigned long index);
-    [Custom, NotEnumerable] getter DOMWindow (DOMString name);
+    [ImplementedAs=anonymousIndexedGetter, NotEnumerable] getter Window(unsigned long index);
+    [Custom, NotEnumerable] getter Window (DOMString name);
 };
 
+Window implements WindowTimers;
+
diff --git a/core/page/DOMWindowPagePopup.idl b/core/page/WindowPagePopup.idl
similarity index 94%
rename from core/page/DOMWindowPagePopup.idl
rename to core/page/WindowPagePopup.idl
index 2ce0bec..36fea46 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/core/page/WindowPagePopup.idl
@@ -29,7 +29,8 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
+    EnabledAtRuntime=pagePopup,
+    ImplementedAs=DOMWindowPagePopup
+] partial interface Window {
     [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
 };
diff --git a/modules/indexeddb/DOMWindowIndexedDatabase.idl b/core/page/WindowTimers.idl
similarity index 76%
copy from modules/indexeddb/DOMWindowIndexedDatabase.idl
copy to core/page/WindowTimers.idl
index bb9982c..97d5d42 100644
--- a/modules/indexeddb/DOMWindowIndexedDatabase.idl
+++ b/core/page/WindowTimers.idl
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
  * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Samsung Electronics. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,8 +25,12 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
-    [ImplementedAs=indexedDB,MeasureAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
-
-    [MeasureAs=UnprefixedIndexedDB] readonly attribute IDBFactory indexedDB;
+[
+    NoInterfaceObject
+] interface WindowTimers {
+    [Custom] long setTimeout(any handler, [Default=Undefined] optional long timeout);
+    void clearTimeout([Default=Undefined] optional long handle);
+    [Custom] long setInterval(any handler, [Default=Undefined] optional long timeout);
+    void clearInterval([Default=Undefined] optional long handle);
 };
+
diff --git a/core/core.gyp/scripts/action_derivedsourcesallinone.py b/core/scripts/action_derivedsourcesallinone.py
similarity index 100%
rename from core/core.gyp/scripts/action_derivedsourcesallinone.py
rename to core/scripts/action_derivedsourcesallinone.py
diff --git a/core/core.gyp/scripts/action_makenames.py b/core/scripts/action_makenames.py
similarity index 100%
rename from core/core.gyp/scripts/action_makenames.py
rename to core/scripts/action_makenames.py
diff --git a/core/core.gyp/scripts/action_useragentstylesheets.py b/core/scripts/action_useragentstylesheets.py
similarity index 100%
rename from core/core.gyp/scripts/action_useragentstylesheets.py
rename to core/scripts/action_useragentstylesheets.py
diff --git a/core/scripts/make_css_property_names.py b/core/scripts/make_css_property_names.py
index dc2cc17..58f85f2 100755
--- a/core/scripts/make_css_property_names.py
+++ b/core/scripts/make_css_property_names.py
@@ -183,7 +183,10 @@
             # Aliases do not get an enum_value.
 
         self._properties = filter(lambda property: not property['alias_for'] and not property['condition'] or property['condition'] in self._enabled_conditions, all_properties)
-        self._first_property_id = 1001  # Historical, unclear why.
+        if len(self._properties) > 1024:
+            print "ERROR : There is more than 1024 CSS Properties, you need to update CSSProperty.h/StylePropertyMetadata m_propertyID accordingly."
+            exit(1)
+        self._first_property_id = 2  # We start after CSSPropertyInvalid and CSSPropertyVariable.
         property_id = self._first_property_id
         for offset, property in enumerate(self._properties):
             property['enum_name'] = self._enum_name_from_property_name(property['name'])
diff --git a/core/scripts/make_css_value_keywords.py b/core/scripts/make_css_value_keywords.py
index e0accad..a51823c 100755
--- a/core/scripts/make_css_value_keywords.py
+++ b/core/scripts/make_css_value_keywords.py
@@ -16,12 +16,12 @@
 #ifndef %(class_name)s_h
 #define %(class_name)s_h
 
+#include "core/css/CSSParserMode.h"
 #include <string.h>
 
 namespace WebCore {
 
 enum CSSValueID {
-    CSSValueInvalid = 0,
 %(value_keyword_enums)s
 };
 
@@ -29,6 +29,7 @@
 const size_t maxCSSValueKeywordLength = %(max_value_keyword_length)d;
 
 const char* getValueName(unsigned short id);
+bool isValueAllowedInMode(unsigned short id, CSSParserMode mode);
 
 } // namespace WebCore
 
@@ -78,6 +79,20 @@
     return valueList[id];
 }
 
+bool isValueAllowedInMode(unsigned short id, CSSParserMode mode)
+{
+    switch (id) {
+        %(ua_sheet_mode_values_keywords)s
+            return mode == UASheetMode;
+        %(quirks_mode_values_keywords)s
+            return mode == CSSQuirksMode;
+        %(quirks_mode_or_ua_sheet_mode_values_keywords)s
+            return mode == UASheetMode || mode == CSSQuirksMode;
+        default:
+            return true;
+    }
+}
+
 } // namespace WebCore
 """
 
@@ -86,6 +101,7 @@
     class_name = "CSSValueKeywords"
     defaults = {
         'condition': None,
+        'mode': None,
     }
 
     def __init__(self, file_paths, enabled_conditions):
@@ -101,6 +117,11 @@
             property['name'] = property['name'].lower()
             property['enum_name'] = self._enum_name_from_value_keyword(property['name'])
             property['enum_value'] = first_property_id + offset
+            if property['name'].startswith('-internal-'):
+                assert property['mode'] is None, 'Can\'t specify mode for value keywords with the prefix "-internal-".'
+                property['mode'] = 'UASheet'
+            else:
+                assert property['mode'] != 'UASheet', 'UASheet mode only value keywords should have the prefix "-internal-".'
 
     def _enum_name_from_value_keyword(self, value_keyword):
         return "CSSValue" + "".join(w.capitalize() for w in value_keyword.split("-"))
@@ -108,21 +129,31 @@
     def _enum_declaration(self, property):
         return "    %(enum_name)s = %(enum_value)s," % property
 
+    def _case_value_keyword(self, property):
+        return "case %(enum_name)s:" % property
+
     def generate_header(self):
+        enum_enties = map(self._enum_declaration, [{'enum_name': 'CSSValueInvalid', 'enum_value': 0}] + self._value_keywords)
         return HEADER_TEMPLATE % {
             'license': license.license_for_generated_cpp(),
             'class_name': self.class_name,
-            'value_keyword_enums': "\n".join(map(self._enum_declaration, self._value_keywords)),
-            'value_keywords_count': len(self._value_keywords),
+            'value_keyword_enums': "\n".join(enum_enties),
+            'value_keywords_count': len(enum_enties),
             'max_value_keyword_length': reduce(max, map(len, map(lambda property: property['name'], self._value_keywords))),
         }
 
+    def _value_keywords_with_mode(self, mode):
+        return filter(lambda property: property['mode'] == mode, self._value_keywords)
+
     def generate_implementation(self):
         gperf_input = GPERF_TEMPLATE % {
             'license': license.license_for_generated_cpp(),
             'class_name': self.class_name,
             'value_keyword_strings': '\n'.join(map(lambda property: '    "%(name)s",' % property, self._value_keywords)),
             'value_keyword_to_enum_map': '\n'.join(map(lambda property: '%(name)s, %(enum_name)s' % property, self._value_keywords)),
+            'ua_sheet_mode_values_keywords': '\n'.join(map(self._case_value_keyword, self._value_keywords_with_mode('UASheet'))),
+            'quirks_mode_values_keywords': '\n'.join(map(self._case_value_keyword, self._value_keywords_with_mode('Quirks'))),
+            'quirks_mode_or_ua_sheet_mode_values_keywords': '\n'.join(map(self._case_value_keyword, self._value_keywords_with_mode('QuirksOrUASheet'))),
         }
         # FIXME: If we could depend on Python 2.7, we would use subprocess.check_output
         gperf_args = ['gperf', '--key-positions=*', '-D', '-n', '-s', '2']
diff --git a/core/scripts/make_dom_exceptions.py b/core/scripts/make_dom_exceptions.py
index 540ac3d..f0c7dde 100755
--- a/core/scripts/make_dom_exceptions.py
+++ b/core/scripts/make_dom_exceptions.py
@@ -52,10 +52,6 @@
 struct ExceptionCodeDescription {
     explicit ExceptionCodeDescription(ExceptionCode);
 
-    // |typeName| has spaces and is suitable for use in exception
-    // description strings; maximum length is 10 characters.
-    const char* typeName;
-
     // |name| is the exception name, also intended for use in exception
     // description strings; 0 if name not known; maximum length is 27
     // characters.
@@ -115,7 +111,7 @@
 
 class ExceptionCodeDescriptionWriter(name_macros.Writer):
     defaults = {
-        'interfaceName': None,
+        'implementedAs': None,
         'conditional': None,
     }
     default_parameters = {
@@ -131,8 +127,7 @@
         return self.in_file.name_dictionaries
 
     def _exception_type(self, exception):
-        name = os.path.basename(exception['name'])
-        return self.wrap_with_condition('    ' + name + 'Type,', exception['conditional'])
+        return self.wrap_with_condition('    ' + self._class_name_for_entry(exception) + 'Type,', exception['conditional'])
 
     def generate_header(self):
         return HEADER_TEMPLATE % {
@@ -142,13 +137,13 @@
         }
 
     def _include(self, exception):
-        include = '#include "' + exception['name'] + '.h"'
+        include = '#include "' + self._headers_header_include_path(exception) + '"'
         return self.wrap_with_condition(include, exception['conditional'])
 
     def _description_initalization(self, exception):
         name = os.path.basename(exception['name'])
-        if name == 'DOMCoreException':
-            return ''  # DOMCoreException needs to be last because it's a catch-all.
+        if name == 'DOMException':
+            return ''  # DOMException needs to be last because it's a catch-all.
         description_initalization = """    if (%(name)s::initializeDescription(ec, this))
         return;""" % {'name': name}
         return self.wrap_with_condition(description_initalization, exception['conditional'])
diff --git a/core/scripts/make_event_factory.py b/core/scripts/make_event_factory.py
index 440328d..06d0880 100644
--- a/core/scripts/make_event_factory.py
+++ b/core/scripts/make_event_factory.py
@@ -57,8 +57,8 @@
 
 class EventFactoryWriter(name_macros.Writer):
     defaults = {
-        'interfaceName' : None,
-        'conditional' : None,
+        'implementedAs': None,
+        'conditional': None,
         'runtimeConditional': None,
     }
     default_parameters = {
@@ -77,12 +77,12 @@
         if event['runtimeConditional']:
             runtime_condition = ' && RuntimeEnabledFeatures::' + event['runtimeConditional'] + '()'
         name = os.path.basename(event['name'])
-        interface_name = event['interfaceName'] if event['interfaceName'] else name
+        class_name = self._class_name_for_entry(event)
         implementation = """    if (type == "%(name)s"%(runtime_condition)s)
-        return %(interface_name)s::create();""" % {
+        return %(class_name)s::create();""" % {
             'name': name,
             'runtime_condition': runtime_condition,
-            'interface_name': interface_name,
+            'class_name': class_name,
         }
         return self.wrap_with_condition(implementation, event['conditional'])
 
diff --git a/core/scripts/make_runtime_features.py b/core/scripts/make_runtime_features.py
index e56b2cf..1454f09 100755
--- a/core/scripts/make_runtime_features.py
+++ b/core/scripts/make_runtime_features.py
@@ -72,6 +72,7 @@
         lowered = lowered.replace("cSS", "css")
         lowered = lowered.replace("iME", "ime")
         lowered = lowered.replace("hTML", "html")
+        lowered = lowered.replace("wOFF", "woff")
         return lowered
 
     def _feature_sets(self):
diff --git a/core/scripts/make_style_builder.py b/core/scripts/make_style_builder.py
index fab2d71..bdad99e 100755
--- a/core/scripts/make_style_builder.py
+++ b/core/scripts/make_style_builder.py
@@ -51,6 +51,7 @@
         'condition': None,
         'apply_type': 'default',
         'name_for_methods': None,
+        'use_handlers_for': None,
 # These depend on property name by default
         'type_name': None,
         'getter': None,
@@ -85,6 +86,7 @@
             cc = self._camelcase_property_name(property["name"])
             property["property_id"] = "CSSProperty" + cc
             cc = property["name_for_methods"] or cc.replace("Webkit", "")
+            property["camel_case_name"] = cc
             set_if_none(property, "type_name", "E" + cc)
             set_if_none(property, "getter", self._lower_first(cc))
             set_if_none(property, "setter", "set" + cc)
diff --git a/core/scripts/name_macros.py b/core/scripts/name_macros.py
index 8af5d28..11d2228 100644
--- a/core/scripts/name_macros.py
+++ b/core/scripts/name_macros.py
@@ -67,11 +67,6 @@
     return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).upper()
 
 
-def _name_for_entry(entry):
-    if entry['interfaceName']:
-        return entry['interfaceName']
-    return os.path.basename(entry['name'])
-
 class Writer(in_generator.Writer):
     def __init__(self, in_file_path, enabled_conditions):
         super(Writer, self).__init__(in_file_path, enabled_conditions)
@@ -88,14 +83,14 @@
         for entry in self.in_file.name_dictionaries:
             conditional = entry['conditional']
             if not conditional:
-                name = _name_for_entry(entry)
+                name = self._class_name_for_entry(entry)
                 if name in unconditional_names:
                     continue
                 unconditional_names.add(name)
                 self._unconditional_entries.append(entry)
                 continue
         for entry in self.in_file.name_dictionaries:
-            name = _name_for_entry(entry)
+            name = self._class_name_for_entry(entry)
             if name in unconditional_names:
                 continue
             conditional = entry['conditional']
@@ -103,22 +98,40 @@
                 self._entries_by_conditional[conditional] = []
             self._entries_by_conditional[conditional].append(entry)
 
-    def _headers_header_include(self, entry):
-        path = entry['name']
-        name = _name_for_entry(entry)
-        if entry['interfaceName']:
-            path = entry['interfaceName']  # FIXME: This seems wrong
-        include = '#include "%(path)s.h"\n#include "V8%(name)s.h"' % {
-            'path': path,
-            'name': name,
-        }
-        return self.wrap_with_condition(include, entry['conditional'])
+    def _class_name_for_entry(self, entry):
+        if entry['implementedAs']:
+            return entry['implementedAs']
+        return os.path.basename(entry['name'])
+
+    def _headers_header_include_path(self, entry):
+        if entry['implementedAs']:
+            path = os.path.dirname(entry['name'])
+            if len(path):
+                path += '/'
+            path += entry['implementedAs']
+        else:
+            path = entry['name']
+        return path + '.h'
+
+    def _headers_header_includes(self, entries):
+        includes = dict()
+        for entry in entries:
+            class_name = self._class_name_for_entry(entry)
+            # Avoid duplicate includes.
+            if class_name in includes:
+                continue
+            include = '#include "%(path)s"\n#include "V8%(js_name)s.h"' % {
+                'path': self._headers_header_include_path(entry),
+                'js_name': os.path.basename(entry['name']),
+            }
+            includes[class_name] = self.wrap_with_condition(include, entry['conditional'])
+        return includes.values()
 
     def generate_headers_header(self):
         return HEADER_TEMPLATE % {
             'license': license.license_for_generated_cpp(),
             'class_name': self.class_name,
-            'includes': '\n'.join(map(self._headers_header_include, self.in_file.name_dictionaries)),
+            'includes': '\n'.join(self._headers_header_includes(self.in_file.name_dictionaries)),
         }
 
     def _declare_one_conditional_macro(self, conditional, entries):
@@ -133,7 +146,7 @@
 #define %(macro_name)s(macro)""" % {
             'macro_name': macro_name,
             'declarations': '\n'.join(sorted(set([
-                '    macro(%(name)s) \\' % {'name': _name_for_entry(entry)}
+                '    macro(%(name)s) \\' % {'name': self._class_name_for_entry(entry)}
                 for entry in entries]))),
         }, conditional)
 
@@ -143,7 +156,7 @@
             for conditional, entries in self._entries_by_conditional.items()])
 
     def _unconditional_macro(self, entry):
-        return '    macro(%(name)s) \\' % {'name': _name_for_entry(entry)}
+        return '    macro(%(name)s) \\' % {'name': self._class_name_for_entry(entry)}
 
     def _conditional_macros(self, conditional):
         return '    %(macro_style_name)s_INTERFACES_FOR_EACH_%(conditional)s(macro) \\' % {
diff --git a/core/core.gyp/scripts/rule_bison.py b/core/scripts/rule_bison.py
similarity index 100%
rename from core/core.gyp/scripts/rule_bison.py
rename to core/scripts/rule_bison.py
diff --git a/core/core.gyp/scripts/supplemental_idl_files.py b/core/scripts/supplemental_idl_files.py
similarity index 100%
rename from core/core.gyp/scripts/supplemental_idl_files.py
rename to core/scripts/supplemental_idl_files.py
diff --git a/core/svg/SVGAElement.idl b/core/svg/SVGAElement.idl
index c635c08..0cbbdf8 100644
--- a/core/svg/SVGAElement.idl
+++ b/core/svg/SVGAElement.idl
@@ -24,11 +24,12 @@
  */
 
 interface SVGAElement : SVGStyledElement,
-                        SVGURIReference,
-                        SVGTests,
                         SVGLangSpace,
-                        SVGExternalResourcesRequired,
                         SVGTransformable {
     readonly attribute SVGAnimatedString target;
 };
 
+SVGAElement implements SVGExternalResourcesRequired;
+SVGAElement implements SVGTests;
+SVGAElement implements SVGURIReference;
+
diff --git a/core/svg/SVGAltGlyphElement.idl b/core/svg/SVGAltGlyphElement.idl
index 7afc4ca..b3fe315 100644
--- a/core/svg/SVGAltGlyphElement.idl
+++ b/core/svg/SVGAltGlyphElement.idl
@@ -25,8 +25,10 @@
 
 [
     Conditional=SVG_FONTS
-] interface SVGAltGlyphElement : SVGTextPositioningElement, SVGURIReference {
+] interface SVGAltGlyphElement : SVGTextPositioningElement {
     [SetterRaisesException] attribute DOMString glyphRef;
     [SetterRaisesException] attribute DOMString format;
 };
 
+SVGAltGlyphElement implements SVGURIReference;
+
diff --git a/core/svg/SVGAnimationElement.idl b/core/svg/SVGAnimationElement.idl
index 503ec0b..55e90f5 100644
--- a/core/svg/SVGAnimationElement.idl
+++ b/core/svg/SVGAnimationElement.idl
@@ -26,8 +26,6 @@
 [
     NoInterfaceObject
 ] interface SVGAnimationElement : SVGElement,
-                                  SVGTests,
-                                  SVGExternalResourcesRequired,
                                   ElementTimeControl {
     readonly attribute SVGElement targetElement;
 
@@ -36,3 +34,6 @@
     float getSimpleDuration();
 };
 
+SVGAnimationElement implements SVGExternalResourcesRequired;
+SVGAnimationElement implements SVGTests;
+
diff --git a/core/svg/SVGCircleElement.idl b/core/svg/SVGCircleElement.idl
index 97a6e26..b60422d 100644
--- a/core/svg/SVGCircleElement.idl
+++ b/core/svg/SVGCircleElement.idl
@@ -25,12 +25,13 @@
  */
 
 interface SVGCircleElement : SVGStyledElement,
-                             SVGTests,
                              SVGLangSpace,
-                             SVGExternalResourcesRequired,
                              SVGTransformable {
     readonly attribute SVGAnimatedLength cx;
     readonly attribute SVGAnimatedLength cy;
     readonly attribute SVGAnimatedLength r;
 };
 
+SVGCircleElement implements SVGExternalResourcesRequired;
+SVGCircleElement implements SVGTests;
+
diff --git a/core/svg/SVGClipPathElement.idl b/core/svg/SVGClipPathElement.idl
index 7fee1c2..ed27856 100644
--- a/core/svg/SVGClipPathElement.idl
+++ b/core/svg/SVGClipPathElement.idl
@@ -25,11 +25,11 @@
  */
 
 interface SVGClipPathElement : SVGStyledElement,
-                               SVGTests,
                                SVGLangSpace,
-                               SVGExternalResourcesRequired,
-                               SVGTransformable
-                               /* SVGUnitTypes */ {
+                               SVGTransformable {
     readonly attribute SVGAnimatedEnumeration clipPathUnits;
 };
 
+SVGClipPathElement implements SVGExternalResourcesRequired;
+SVGClipPathElement implements SVGTests;
+
diff --git a/core/svg/SVGCursorElement.idl b/core/svg/SVGCursorElement.idl
index 057c2b1..3d76a2d 100644
--- a/core/svg/SVGCursorElement.idl
+++ b/core/svg/SVGCursorElement.idl
@@ -23,11 +23,12 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGCursorElement : SVGElement,
-                             SVGURIReference,
-                             SVGTests,
-                             SVGExternalResourcesRequired {
+interface SVGCursorElement : SVGElement {
     readonly attribute SVGAnimatedLength x;
     readonly attribute SVGAnimatedLength y;
 };
 
+SVGCursorElement implements SVGExternalResourcesRequired;
+SVGCursorElement implements SVGURIReference;
+SVGCursorElement implements SVGTests;
+
diff --git a/core/svg/SVGDefsElement.idl b/core/svg/SVGDefsElement.idl
index 24a6d28..c62e757 100644
--- a/core/svg/SVGDefsElement.idl
+++ b/core/svg/SVGDefsElement.idl
@@ -24,9 +24,10 @@
  */
 
 interface SVGDefsElement : SVGStyledElement,
-                           SVGTests,
                            SVGLangSpace,
-                           SVGExternalResourcesRequired,
                            SVGTransformable {
 };
 
+SVGDefsElement implements SVGExternalResourcesRequired;
+SVGDefsElement implements SVGTests;
+
diff --git a/core/svg/SVGEllipseElement.idl b/core/svg/SVGEllipseElement.idl
index db65f0e..b2f791e 100644
--- a/core/svg/SVGEllipseElement.idl
+++ b/core/svg/SVGEllipseElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGEllipseElement : SVGStyledElement,
-                              SVGTests,
                               SVGLangSpace,
-                              SVGExternalResourcesRequired,
                               SVGTransformable {
     readonly attribute SVGAnimatedLength cx;
     readonly attribute SVGAnimatedLength cy;
@@ -34,3 +32,6 @@
     readonly attribute SVGAnimatedLength ry;
 };
 
+SVGEllipseElement implements SVGExternalResourcesRequired;
+SVGEllipseElement implements SVGTests;
+
diff --git a/core/svg/SVGException.idl b/core/svg/SVGException.idl
deleted file mode 100644
index 574c743..0000000
--- a/core/svg/SVGException.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2007 Rob Buis <buis@kde.org>
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-[
-    DoNotCheckConstants
-] exception SVGException {
-
-    readonly attribute unsigned short   code;
-    readonly attribute DOMString        name;
-    readonly attribute DOMString        message;
-
-    // Override in a Mozilla compatible format
-    [NotEnumerable] DOMString toString();
-
-    // SVGExceptionCode
-    const unsigned short SVG_WRONG_TYPE_ERR = 0;
-    const unsigned short SVG_INVALID_VALUE_ERR = 1;
-    const unsigned short SVG_MATRIX_NOT_INVERTABLE = 2;
-};
diff --git a/core/svg/SVGExternalResourcesRequired.idl b/core/svg/SVGExternalResourcesRequired.idl
index 2d0d402..50f8471 100644
--- a/core/svg/SVGExternalResourcesRequired.idl
+++ b/core/svg/SVGExternalResourcesRequired.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    DoNotGenerateToV8
+    NoInterfaceObject
 ] interface SVGExternalResourcesRequired { 
     readonly attribute SVGAnimatedBoolean externalResourcesRequired;
 };
diff --git a/core/svg/SVGFEImageElement.idl b/core/svg/SVGFEImageElement.idl
index 2220f7d..b395d32 100644
--- a/core/svg/SVGFEImageElement.idl
+++ b/core/svg/SVGFEImageElement.idl
@@ -24,10 +24,11 @@
  */
 
 interface SVGFEImageElement : SVGStyledElement,
-                              SVGURIReference,
                               SVGLangSpace,
-                              SVGExternalResourcesRequired,
                               SVGFilterPrimitiveStandardAttributes {
     readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
 };
 
+SVGFEImageElement implements SVGExternalResourcesRequired;
+SVGFEImageElement implements SVGURIReference;
+
diff --git a/core/svg/SVGFilterElement.idl b/core/svg/SVGFilterElement.idl
index a33b461..a8250a0 100644
--- a/core/svg/SVGFilterElement.idl
+++ b/core/svg/SVGFilterElement.idl
@@ -25,10 +25,7 @@
  */
 
 interface SVGFilterElement : SVGStyledElement,
-                             SVGURIReference,
-                             SVGLangSpace,
-                             SVGExternalResourcesRequired
-                             /* SVGUnitTypes */ {
+                             SVGLangSpace {
     readonly attribute SVGAnimatedEnumeration filterUnits;
     readonly attribute SVGAnimatedEnumeration primitiveUnits;
     readonly attribute SVGAnimatedLength      x;
@@ -42,3 +39,6 @@
                       [Default=Undefined] optional unsigned long filterResY);
 };
 
+SVGFilterElement implements SVGExternalResourcesRequired;
+SVGFilterElement implements SVGURIReference;
+
diff --git a/core/svg/SVGFitToViewBox.idl b/core/svg/SVGFitToViewBox.idl
index 261684e..a6388ab 100644
--- a/core/svg/SVGFitToViewBox.idl
+++ b/core/svg/SVGFitToViewBox.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    DoNotGenerateToV8
+    NoInterfaceObject
 ] interface SVGFitToViewBox {
     readonly attribute SVGAnimatedRect                viewBox;
     readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
diff --git a/core/svg/SVGForeignObjectElement.idl b/core/svg/SVGForeignObjectElement.idl
index eecedf8..d765b5b 100644
--- a/core/svg/SVGForeignObjectElement.idl
+++ b/core/svg/SVGForeignObjectElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGForeignObjectElement : SVGStyledElement,
-                                    SVGTests,
                                     SVGLangSpace,
-                                    SVGExternalResourcesRequired,
                                     SVGTransformable {
     readonly attribute SVGAnimatedLength x;
     readonly attribute SVGAnimatedLength y;
@@ -34,3 +32,6 @@
     readonly attribute SVGAnimatedLength height;
 };
 
+SVGForeignObjectElement implements SVGExternalResourcesRequired;
+SVGForeignObjectElement implements SVGTests;
+
diff --git a/core/svg/SVGGElement.idl b/core/svg/SVGGElement.idl
index a6dd6b3..6ab17a8 100644
--- a/core/svg/SVGGElement.idl
+++ b/core/svg/SVGGElement.idl
@@ -24,9 +24,10 @@
  */
 
 interface SVGGElement : SVGStyledElement,
-                        SVGTests,
                         SVGLangSpace,
-                        SVGExternalResourcesRequired,
                         SVGTransformable {
 };
 
+SVGGElement implements SVGExternalResourcesRequired;
+SVGGElement implements SVGTests;
+
diff --git a/core/svg/SVGGlyphRefElement.idl b/core/svg/SVGGlyphRefElement.idl
index 123e8a5..a9d07ca 100644
--- a/core/svg/SVGGlyphRefElement.idl
+++ b/core/svg/SVGGlyphRefElement.idl
@@ -17,8 +17,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-[Conditional=SVG_FONTS] interface SVGGlyphRefElement : SVGStyledElement,
-                                                           SVGURIReference {
+[
+    Conditional=SVG_FONTS
+] interface SVGGlyphRefElement : SVGStyledElement {
     // FIXME: Use [Reflect] after https://bugs.webkit.org/show_bug.cgi?id=64843 is fixed.
     attribute DOMString glyphRef;
     [Reflect] attribute DOMString format;
@@ -28,3 +29,5 @@
     attribute float dy;
 };
 
+SVGGlyphRefElement implements SVGURIReference;
+
diff --git a/core/svg/SVGGradientElement.idl b/core/svg/SVGGradientElement.idl
index 50047cf..e378d7f 100644
--- a/core/svg/SVGGradientElement.idl
+++ b/core/svg/SVGGradientElement.idl
@@ -25,10 +25,7 @@
 
 [
     DoNotCheckConstants
-] interface SVGGradientElement : SVGStyledElement,
-                                 SVGURIReference,
-                                 SVGExternalResourcesRequired
-                                 /* SVGUnitTypes */ {
+] interface SVGGradientElement : SVGStyledElement {
     // Spread Method Types
     const unsigned short SVG_SPREADMETHOD_UNKNOWN = 0;
     const unsigned short SVG_SPREADMETHOD_PAD     = 1;
@@ -40,3 +37,6 @@
     readonly attribute SVGAnimatedEnumeration   spreadMethod;
 };
 
+SVGGradientElement implements SVGExternalResourcesRequired;
+SVGGradientElement implements SVGURIReference;
+
diff --git a/core/svg/SVGImageElement.idl b/core/svg/SVGImageElement.idl
index e063778..dd7afb7 100644
--- a/core/svg/SVGImageElement.idl
+++ b/core/svg/SVGImageElement.idl
@@ -24,10 +24,7 @@
  */
 
 interface SVGImageElement : SVGStyledElement,
-                            SVGURIReference,
-                            SVGTests,
                             SVGLangSpace,
-                            SVGExternalResourcesRequired,
                             SVGTransformable {
     readonly attribute SVGAnimatedLength x;
     readonly attribute SVGAnimatedLength y;
@@ -36,3 +33,7 @@
     readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
 };
 
+SVGImageElement implements SVGExternalResourcesRequired;
+SVGImageElement implements SVGTests;
+SVGImageElement implements SVGURIReference;
+
diff --git a/core/svg/SVGLineElement.idl b/core/svg/SVGLineElement.idl
index 2ecbc2d..8da39e6 100644
--- a/core/svg/SVGLineElement.idl
+++ b/core/svg/SVGLineElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGLineElement : SVGStyledElement,
-                           SVGTests,
                            SVGLangSpace,
-                           SVGExternalResourcesRequired,
                            SVGTransformable {
     readonly attribute SVGAnimatedLength x1;
     readonly attribute SVGAnimatedLength y1;
@@ -34,3 +32,6 @@
     readonly attribute SVGAnimatedLength y2;
 };
 
+SVGLineElement implements SVGExternalResourcesRequired;
+SVGLineElement implements SVGTests;
+
diff --git a/core/svg/SVGMPathElement.idl b/core/svg/SVGMPathElement.idl
index c3a72ac..3fb56ec 100644
--- a/core/svg/SVGMPathElement.idl
+++ b/core/svg/SVGMPathElement.idl
@@ -23,8 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGMPathElement : SVGElement,
-                            SVGURIReference,
-                            SVGExternalResourcesRequired {
+interface SVGMPathElement : SVGElement {
 };
 
+SVGMPathElement implements SVGExternalResourcesRequired;
+SVGMPathElement implements SVGURIReference;
+
diff --git a/core/svg/SVGMarkerElement.idl b/core/svg/SVGMarkerElement.idl
index 757abc1..48084c9 100644
--- a/core/svg/SVGMarkerElement.idl
+++ b/core/svg/SVGMarkerElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGMarkerElement : SVGStyledElement,
-                             SVGLangSpace,
-                             SVGExternalResourcesRequired,
-                             SVGFitToViewBox {
+                             SVGLangSpace {
     // Marker Unit Types
     const unsigned short SVG_MARKERUNITS_UNKNOWN        = 0;
     const unsigned short SVG_MARKERUNITS_USERSPACEONUSE = 1;
@@ -49,3 +47,6 @@
     void setOrientToAngle([Default=Undefined] optional SVGAngle angle);
 };
 
+SVGMarkerElement implements SVGExternalResourcesRequired;
+SVGMarkerElement implements SVGFitToViewBox;
+
diff --git a/core/svg/SVGMaskElement.idl b/core/svg/SVGMaskElement.idl
index 66cad0c..026ae79 100644
--- a/core/svg/SVGMaskElement.idl
+++ b/core/svg/SVGMaskElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGMaskElement : SVGStyledElement,
-                           SVGTests,
-                           SVGLangSpace,
-                           SVGExternalResourcesRequired {
+                           SVGLangSpace {
     readonly attribute SVGAnimatedEnumeration maskUnits;
     readonly attribute SVGAnimatedEnumeration maskContentUnits;
 
@@ -36,3 +34,6 @@
     readonly attribute SVGAnimatedLength height;
 };
 
+SVGMaskElement implements SVGExternalResourcesRequired;
+SVGMaskElement implements SVGTests;
+
diff --git a/core/svg/SVGPathElement.idl b/core/svg/SVGPathElement.idl
index 8608fc3..f54c243 100644
--- a/core/svg/SVGPathElement.idl
+++ b/core/svg/SVGPathElement.idl
@@ -25,9 +25,7 @@
  */
 
 interface SVGPathElement : SVGStyledElement,
-                           SVGTests,
                            SVGLangSpace,
-                           SVGExternalResourcesRequired,
                            SVGTransformable {
     readonly attribute SVGAnimatedNumber pathLength;
 
@@ -110,3 +108,6 @@
     readonly attribute SVGPathSegList animatedNormalizedPathSegList;
 };
 
+SVGPathElement implements SVGExternalResourcesRequired;
+SVGPathElement implements SVGTests;
+
diff --git a/core/svg/SVGPatternElement.idl b/core/svg/SVGPatternElement.idl
index d8fe822..292c49a 100644
--- a/core/svg/SVGPatternElement.idl
+++ b/core/svg/SVGPatternElement.idl
@@ -24,12 +24,7 @@
  */
 
 interface SVGPatternElement : SVGStyledElement,
-                              SVGURIReference,
-                              SVGTests,
-                              SVGLangSpace,
-                              SVGExternalResourcesRequired,
-                              SVGFitToViewBox
-                              /* SVGUnitTypes */ {
+                              SVGLangSpace {
     readonly attribute SVGAnimatedEnumeration   patternUnits;
     readonly attribute SVGAnimatedEnumeration   patternContentUnits;
     readonly attribute SVGAnimatedTransformList patternTransform;
@@ -39,3 +34,8 @@
     readonly attribute SVGAnimatedLength        height;
 };
 
+SVGPatternElement implements SVGExternalResourcesRequired;
+SVGPatternElement implements SVGFitToViewBox;
+SVGPatternElement implements SVGTests;
+SVGPatternElement implements SVGURIReference;
+
diff --git a/core/svg/SVGPolygonElement.idl b/core/svg/SVGPolygonElement.idl
index e63f005..ab9199d 100644
--- a/core/svg/SVGPolygonElement.idl
+++ b/core/svg/SVGPolygonElement.idl
@@ -24,11 +24,12 @@
  */
 
 interface SVGPolygonElement : SVGStyledElement,
-                              SVGTests,
                               SVGLangSpace,
-                              SVGExternalResourcesRequired,
                               SVGTransformable {
     readonly attribute SVGPointList points;
     readonly attribute SVGPointList animatedPoints;
 };
 
+SVGPolygonElement implements SVGExternalResourcesRequired;
+SVGPolygonElement implements SVGTests;
+
diff --git a/core/svg/SVGPolylineElement.idl b/core/svg/SVGPolylineElement.idl
index 62f559e..f2ea579 100644
--- a/core/svg/SVGPolylineElement.idl
+++ b/core/svg/SVGPolylineElement.idl
@@ -24,11 +24,12 @@
  */
 
 interface SVGPolylineElement : SVGStyledElement,
-                               SVGTests,
                                SVGLangSpace,
-                               SVGExternalResourcesRequired,
                                SVGTransformable {
     readonly attribute SVGPointList points;
     readonly attribute SVGPointList animatedPoints;
 };
 
+SVGPolylineElement implements SVGExternalResourcesRequired;
+SVGPolylineElement implements SVGTests;
+
diff --git a/core/svg/SVGRectElement.idl b/core/svg/SVGRectElement.idl
index 55b6f3c..a1cc3a3 100644
--- a/core/svg/SVGRectElement.idl
+++ b/core/svg/SVGRectElement.idl
@@ -25,9 +25,7 @@
  */
 
 interface SVGRectElement : SVGStyledElement,
-                           SVGTests,
                            SVGLangSpace,
-                           SVGExternalResourcesRequired,
                            SVGTransformable {
     readonly attribute SVGAnimatedLength x;
     readonly attribute SVGAnimatedLength y;
@@ -37,3 +35,6 @@
     readonly attribute SVGAnimatedLength ry;
 };
 
+SVGRectElement implements SVGExternalResourcesRequired;
+SVGRectElement implements SVGTests;
+
diff --git a/core/svg/SVGSVGElement.idl b/core/svg/SVGSVGElement.idl
index e32c0a3..a6e5471 100644
--- a/core/svg/SVGSVGElement.idl
+++ b/core/svg/SVGSVGElement.idl
@@ -24,12 +24,8 @@
 // TODO: Fix SVGSVGElement inheritance (css::DocumentCSS)! 
 // TODO: no events::DocumentEvent available!
 interface SVGSVGElement : SVGStyledElement,
-                          SVGTests,
                           SVGLangSpace,
-                          SVGExternalResourcesRequired,
-                          SVGTransformable,
-                          SVGFitToViewBox,
-                          SVGZoomAndPan {
+                          SVGTransformable {
     readonly attribute SVGAnimatedLength x;
     readonly attribute SVGAnimatedLength y;
     readonly attribute SVGAnimatedLength width;
@@ -76,3 +72,8 @@
     Element getElementById([Default=Undefined] optional DOMString elementId);
 };
 
+SVGSVGElement implements SVGExternalResourcesRequired;
+SVGSVGElement implements SVGTests;
+SVGSVGElement implements SVGFitToViewBox;
+SVGSVGElement implements SVGZoomAndPan;
+
diff --git a/core/svg/SVGScriptElement.idl b/core/svg/SVGScriptElement.idl
index 5a7ec3d..dea339f 100644
--- a/core/svg/SVGScriptElement.idl
+++ b/core/svg/SVGScriptElement.idl
@@ -23,9 +23,10 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGScriptElement : SVGElement,
-                             SVGURIReference,
-                             SVGExternalResourcesRequired {
+interface SVGScriptElement : SVGElement {
              [TreatNullAs=NullString] attribute DOMString type;
 };
 
+SVGScriptElement implements SVGExternalResourcesRequired;
+SVGScriptElement implements SVGURIReference;
+
diff --git a/core/svg/SVGSwitchElement.idl b/core/svg/SVGSwitchElement.idl
index 512d8ce..4a1f6ae 100644
--- a/core/svg/SVGSwitchElement.idl
+++ b/core/svg/SVGSwitchElement.idl
@@ -24,9 +24,10 @@
  */
 
 interface SVGSwitchElement : SVGStyledElement,
-                             SVGTests,
                              SVGLangSpace,
-                             SVGExternalResourcesRequired,
                              SVGTransformable {
 };
 
+SVGSwitchElement implements SVGExternalResourcesRequired;
+SVGSwitchElement implements SVGTests;
+
diff --git a/core/svg/SVGSymbolElement.idl b/core/svg/SVGSymbolElement.idl
index 94c9bd6..b7e44e2 100644
--- a/core/svg/SVGSymbolElement.idl
+++ b/core/svg/SVGSymbolElement.idl
@@ -24,8 +24,8 @@
  */
 
 interface SVGSymbolElement : SVGStyledElement,
-                             SVGLangSpace,
-                             SVGExternalResourcesRequired,
-                             SVGFitToViewBox {
+                             SVGLangSpace {
 };
 
+SVGSymbolElement implements SVGExternalResourcesRequired;
+SVGSymbolElement implements SVGFitToViewBox;
diff --git a/core/svg/SVGTRefElement.idl b/core/svg/SVGTRefElement.idl
index 5f58232..27eef02 100644
--- a/core/svg/SVGTRefElement.idl
+++ b/core/svg/SVGTRefElement.idl
@@ -23,7 +23,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGTRefElement : SVGTextPositioningElement,
-                           SVGURIReference {
+interface SVGTRefElement : SVGTextPositioningElement {
 };
 
+SVGTRefElement implements SVGURIReference;
+
diff --git a/core/svg/SVGTests.idl b/core/svg/SVGTests.idl
index 8f47e8e..e2eaa13 100644
--- a/core/svg/SVGTests.idl
+++ b/core/svg/SVGTests.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    DoNotGenerateToV8
+    NoInterfaceObject
 ] interface SVGTests {
     readonly attribute SVGStringList requiredFeatures;
     readonly attribute SVGStringList requiredExtensions;
diff --git a/core/svg/SVGTextContentElement.idl b/core/svg/SVGTextContentElement.idl
index 4a2acb9..1fcd5db 100644
--- a/core/svg/SVGTextContentElement.idl
+++ b/core/svg/SVGTextContentElement.idl
@@ -24,9 +24,7 @@
  */
 
 interface SVGTextContentElement : SVGStyledElement,
-                                  SVGTests,
-                                  SVGLangSpace,
-                                  SVGExternalResourcesRequired {
+                                  SVGLangSpace {
     // lengthAdjust Types
     const unsigned short LENGTHADJUST_UNKNOWN          = 0;
     const unsigned short LENGTHADJUST_SPACING          = 1;
@@ -48,3 +46,6 @@
                          [Default=Undefined,IsIndex] optional unsigned long length);
 };
 
+SVGTextContentElement implements SVGExternalResourcesRequired;
+SVGTextContentElement implements SVGTests;
+
diff --git a/core/svg/SVGTextPathElement.idl b/core/svg/SVGTextPathElement.idl
index 629ff18..d21292a 100644
--- a/core/svg/SVGTextPathElement.idl
+++ b/core/svg/SVGTextPathElement.idl
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGTextPathElement : SVGTextContentElement,
-                               SVGURIReference {
+interface SVGTextPathElement : SVGTextContentElement {
     // textPath Method Types
     const unsigned short TEXTPATH_METHODTYPE_UNKNOWN   = 0;
     const unsigned short TEXTPATH_METHODTYPE_ALIGN     = 1;
@@ -40,3 +39,5 @@
     readonly attribute SVGAnimatedEnumeration spacing;
 };
 
+SVGTextPathElement implements SVGURIReference;
+
diff --git a/core/svg/SVGURIReference.idl b/core/svg/SVGURIReference.idl
index 850048f..06dcca9 100644
--- a/core/svg/SVGURIReference.idl
+++ b/core/svg/SVGURIReference.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    DoNotGenerateToV8
+    NoInterfaceObject
 ] interface SVGURIReference {
     readonly attribute SVGAnimatedString href;
 };
diff --git a/core/svg/SVGUseElement.idl b/core/svg/SVGUseElement.idl
index 8ee8b4a..96518fe 100644
--- a/core/svg/SVGUseElement.idl
+++ b/core/svg/SVGUseElement.idl
@@ -24,10 +24,7 @@
  */
 
 interface SVGUseElement : SVGStyledElement,
-                          SVGURIReference,
-                          SVGTests,
                           SVGLangSpace,
-                          SVGExternalResourcesRequired,
                           SVGTransformable {
     readonly attribute SVGAnimatedLength   x;
     readonly attribute SVGAnimatedLength   y;
@@ -38,3 +35,7 @@
     readonly attribute SVGElementInstance animatedInstanceRoot;
 };
 
+SVGUseElement implements SVGExternalResourcesRequired;
+SVGUseElement implements SVGTests;
+SVGUseElement implements SVGURIReference;
+
diff --git a/core/svg/SVGViewElement.idl b/core/svg/SVGViewElement.idl
index 4d43028..296c410 100644
--- a/core/svg/SVGViewElement.idl
+++ b/core/svg/SVGViewElement.idl
@@ -23,10 +23,11 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-interface SVGViewElement : SVGElement,
-                           SVGExternalResourcesRequired,
-                           SVGFitToViewBox,
-                           SVGZoomAndPan {
+interface SVGViewElement : SVGElement {
     readonly attribute SVGStringList viewTarget;
 };
 
+SVGViewElement implements SVGExternalResourcesRequired;
+SVGViewElement implements SVGFitToViewBox;
+SVGViewElement implements SVGZoomAndPan;
+
diff --git a/core/svg/SVGViewSpec.idl b/core/svg/SVGViewSpec.idl
index 55b1489..40ac152 100644
--- a/core/svg/SVGViewSpec.idl
+++ b/core/svg/SVGViewSpec.idl
@@ -23,8 +23,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-// SVGViewSpec intentionally doesn't inherit from SVGZoomAndPan & SVGFitToViewBox on the IDLs.
-// It would require that any of those classes would be RefCounted, and we want to avoid that.
 interface SVGViewSpec {
       readonly attribute SVGTransformList transform;
       readonly attribute SVGElement viewTarget;
@@ -35,9 +33,7 @@
 
       // SVGZoomAndPan
       [SetterRaisesException] attribute unsigned short zoomAndPan;
-
-      // SVGFitToViewBox
-      readonly attribute SVGAnimatedRect viewBox;
-      readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
 };
 
+SVGViewSpec implements SVGFitToViewBox;
+
diff --git a/core/svg/SVGZoomAndPan.idl b/core/svg/SVGZoomAndPan.idl
index de112e2..edc9f8e 100644
--- a/core/svg/SVGZoomAndPan.idl
+++ b/core/svg/SVGZoomAndPan.idl
@@ -25,7 +25,7 @@
  */
 
 [
-    DoNotGenerateToV8
+    NoInterfaceObject
 ] interface SVGZoomAndPan {
     const unsigned short SVG_ZOOMANDPAN_UNKNOWN = 0;
     const unsigned short SVG_ZOOMANDPAN_DISABLE = 1;
diff --git a/core/testing/Internals.idl b/core/testing/Internals.idl
index 457f306..e91ad01 100644
--- a/core/testing/Internals.idl
+++ b/core/testing/Internals.idl
@@ -25,6 +25,7 @@
  */
 
 [
+    DoNotCheckConstants
 ] interface Internals {
     DOMString address(Node node);
 
@@ -76,9 +77,9 @@
     [RaisesException] boolean attached(Node node);
 
     DOMString visiblePlaceholder(Element element);
-#if defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR
+
     void selectColorInColorChooser(Element element, DOMString colorValue);
-#endif
+
     [RaisesException] DOMString[] formControlStateOfPreviousHistoryItem();
     [RaisesException] void setFormControlStateOfPreviousHistoryItem(sequence<DOMString> values);
     [RaisesException] void setEnableMockPagePopup(boolean enabled);
@@ -122,9 +123,9 @@
     [RaisesException] unsigned long lengthFromRange(Element scope, Range range);
     [RaisesException] DOMString rangeAsText(Range range);
 
-    [RaisesException] DOMPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
+    [RaisesException] WebKitPoint touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
     [RaisesException] Node touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document document);
-    [RaisesException] DOMPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
+    [RaisesException] WebKitPoint touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
     [RaisesException] Node touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document document);
     [RaisesException] ClientRect bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document document);
 
@@ -161,19 +162,19 @@
     readonly attribute unsigned long workerThreadCount;
 
     // Flags for layerTreeAsText.
-    const unsigned short LAYER_TREE_INCLUDES_VISIBLE_RECTS = 1;
-    const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
-    const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 4;
-    const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 8;
+    // The values of these constants must be kept in sync with the values of LayerTreeAsTextBehaviorFlags in GraphicsLayerClient.h.
+    const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 2;
+    const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 4;
     [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags);
+    [RaisesException] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
 
     [RaisesException] NodeList paintOrderListBeforePromote(Element element);
     [RaisesException] NodeList paintOrderListAfterPromote(Element element);
 
     // The values of these constants must be kept in sync with those in RenderLayer.
-    const unsigned short DoNotForceCompositedScrolling = 0;
-    const unsigned short CompositedScrollingAlwaysOn = 1;
-    const unsigned short CompositedScrollingAlwaysOff = 2;
+    const unsigned short DO_NOT_FORCE_COMPOSITED_SCROLLING = 0;
+    const unsigned short COMPOSITED_SCROLLING_ALWAYS_ON = 1;
+    const unsigned short COMPOSITED_SCROLLING_ALWAYS_OFF = 2;
     [RaisesException] void setNeedsCompositedScrolling(Element element, unsigned short value);
 
     [RaisesException] DOMString scrollingStateTreeAsText(Document document);
@@ -189,14 +190,10 @@
     void insertAuthorCSS(Document document, DOMString css);
     void insertUserCSS(Document document, DOMString css);
 
-#if defined(ENABLE_BATTERY_STATUS) && ENABLE_BATTERY_STATUS
-    [RaisesException] void setBatteryStatus(Document document, DOMString eventType, boolean charging, double chargingTime, double dischargingTime, double level);
-#endif
-
     unsigned long numberOfLiveNodes();
     unsigned long numberOfLiveDocuments();
     sequence<DOMString> consoleMessageArgumentCounts(Document document);
-    DOMWindow openDummyInspectorFrontend(DOMString url);
+    Window openDummyInspectorFrontend(DOMString url);
     void closeDummyInspectorFrontend();
     [RaisesException] void setInspectorResourcesDataSizeLimits(long maximumResourcesContentSize, long maximumSingleResourceContentSize);
 
@@ -243,11 +240,11 @@
 
     void forceReload(boolean endToEnd);
 
-    [Conditional=ENCRYPTED_MEDIA_V2] void initializeMockCDM();
-
     void enableMockSpeechSynthesizer();
 
     [RaisesException] DOMString getImageSourceURL(Element element);
 
     boolean isSelectPopupVisible(Node node);
+
+    [RaisesException] ClientRect selectionBounds();
 };
diff --git a/core/testing/TypeConversions.idl b/core/testing/TypeConversions.idl
index b3996ab..1f3df0c 100644
--- a/core/testing/TypeConversions.idl
+++ b/core/testing/TypeConversions.idl
@@ -34,4 +34,9 @@
     [EnforceRange] attribute long long testEnforceRangeLongLong;
     attribute unsigned long long testUnsignedLongLong;
     [EnforceRange] attribute unsigned long long testEnforceRangeUnsignedLongLong;
+
+    attribute byte testByte;
+    [EnforceRange] attribute byte testEnforceRangeByte;
+    attribute octet testOctet;
+    [EnforceRange] attribute octet testEnforceRangeOctet;
 };
diff --git a/core/workers/AbstractWorker.idl b/core/workers/AbstractWorker.idl
index 4a0da0d..4211e68 100644
--- a/core/workers/AbstractWorker.idl
+++ b/core/workers/AbstractWorker.idl
@@ -30,19 +30,8 @@
  */
 
 [
-    NoInterfaceObject,
-    ActiveDOMObject,
-    EventTarget
+    NoInterfaceObject
 ] interface AbstractWorker {
-
     attribute EventListener onerror;
-
-    void addEventListener(DOMString type,
-                          EventListener listener,
-                          optional boolean useCapture);
-    void removeEventListener(DOMString type,
-                             EventListener listener,
-                             optional boolean useCapture);
-    [RaisesException] boolean dispatchEvent(Event evt);
 };
 
diff --git a/core/workers/SharedWorker.idl b/core/workers/SharedWorker.idl
index d6cae73..90fa944 100644
--- a/core/workers/SharedWorker.idl
+++ b/core/workers/SharedWorker.idl
@@ -30,11 +30,14 @@
  */
 
 [
-    NoInterfaceObject,
+    EnabledAtRuntime,
     Constructor(DOMString scriptURL, [Default=NullString] optional DOMString name),
-    CallWith=ScriptExecutionContext,
-    RaisesException
-] interface SharedWorker : AbstractWorker {
+    ConstructorCallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
+    ActiveDOMObject
+] interface SharedWorker : EventTarget {
     readonly attribute MessagePort port;
 };
 
+SharedWorker implements AbstractWorker;
+
diff --git a/core/workers/Worker.idl b/core/workers/Worker.idl
index 2b15b36..ab7f280 100644
--- a/core/workers/Worker.idl
+++ b/core/workers/Worker.idl
@@ -27,9 +27,10 @@
 
 [
     Constructor(DOMString scriptUrl),
-    CallWith=ScriptExecutionContext,
-    RaisesException
-] interface Worker : AbstractWorker {
+    ConstructorCallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
+    ActiveDOMObject
+] interface Worker : EventTarget {
 
     attribute EventListener onmessage;
 
@@ -37,3 +38,5 @@
     void terminate();
 };
 
+Worker implements AbstractWorker;
+
diff --git a/core/workers/WorkerContext.idl b/core/workers/WorkerContext.idl
index e513baf..9c4ff2b 100644
--- a/core/workers/WorkerContext.idl
+++ b/core/workers/WorkerContext.idl
@@ -41,13 +41,6 @@
     [Custom] void importScripts(/*[Variadic] in DOMString urls */);
              [Replaceable] readonly attribute WorkerNavigator navigator;
 
-    // Timers
-    [Custom] long setTimeout(any handler, [Default=Undefined] optional long timeout);
-    void clearTimeout([Default=Undefined] optional long handle);
-    [Custom] long setInterval(any handler, [Default=Undefined] optional long timeout);
-    void clearInterval([Default=Undefined] optional long handle);
-
-
     // EventTarget interface
     void addEventListener(DOMString type, 
                           EventListener listener, 
@@ -61,3 +54,5 @@
     attribute URLConstructor webkitURL; // FIXME: deprecate this.
 };
 
+WorkerContext implements WindowTimers;
+
diff --git a/core/xml/XMLHttpRequest.idl b/core/xml/XMLHttpRequest.idl
index 5c03dd6..8811709 100644
--- a/core/xml/XMLHttpRequest.idl
+++ b/core/xml/XMLHttpRequest.idl
@@ -40,7 +40,7 @@
     GlobalContext=WindowAndWorker,
     ActiveDOMObject,
     Constructor,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     CustomConstructor(optional XMLHttpRequestOptions options),
     EventTarget
 ] interface XMLHttpRequest {
@@ -52,7 +52,7 @@
     attribute EventListener onloadend;
     attribute EventListener onloadstart;
     attribute EventListener onprogress;
-    [Conditional=XHR_TIMEOUT] attribute EventListener ontimeout;
+    attribute EventListener ontimeout;
 
     // event handler attributes
     attribute EventListener onreadystatechange;
@@ -64,7 +64,7 @@
     const unsigned short LOADING = 3;
     const unsigned short DONE = 4;
 
-    [Conditional=XHR_TIMEOUT, SetterRaisesException] attribute unsigned long timeout;
+    [SetterRaisesException] attribute unsigned long timeout;
     readonly attribute unsigned short readyState;
 
     [SetterRaisesException] attribute boolean withCredentials;
diff --git a/core/xml/XPathException.idl b/core/xml/XPathException.idl
deleted file mode 100644
index 2f4ef9f..0000000
--- a/core/xml/XPathException.idl
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    DoNotCheckConstants
-] exception XPathException {
-
-    readonly attribute unsigned short   code;
-    readonly attribute DOMString        name;
-    readonly attribute DOMString        message;
-
-    // Override in a Mozilla compatible format
-    [NotEnumerable] DOMString toString();
-
-    // XPathExceptionCode
-    const unsigned short INVALID_EXPRESSION_ERR = 51;
-    const unsigned short TYPE_ERR = 52;
-};
-
diff --git a/modules/README b/modules/README
index 1001454..b922618 100644
--- a/modules/README
+++ b/modules/README
@@ -6,4 +6,4 @@
 
 The current version corresponds to:
 URL: http://src.chromium.org/multivm/trunk/webkit
-Current revision: 1281
+Current revision: 1316
diff --git a/modules/battery/BatteryManager.idl b/modules/battery/BatteryManager.idl
deleted file mode 100644
index c6fb69e..0000000
--- a/modules/battery/BatteryManager.idl
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Copyright (C) 2012 Samsung Electronics
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- */
-
-// http://dev.w3.org/2009/dap/system-info/battery-status.html
-[
-    NoInterfaceObject,
-    Conditional=BATTERY_STATUS,
-    ActiveDOMObject,
-    EventTarget
- ] interface BatteryManager {
-    readonly attribute boolean charging;
-    readonly attribute double chargingTime;
-    readonly attribute double dischargingTime;
-    readonly attribute double level;
-
-    attribute EventListener onchargingchange;
-    attribute EventListener onchargingtimechange;
-    attribute EventListener ondischargingtimechange;
-    attribute EventListener onlevelchange;
-
-    // EventTarget interface
-    void addEventListener(DOMString type,
-                          EventListener listener,
-                          optional boolean useCapture);
-    void removeEventListener(DOMString type,
-                             EventListener listener,
-                             optional boolean useCapture);
-    [RaisesException] boolean dispatchEvent(Event event);
-};
-
diff --git a/modules/battery/NavigatorBattery.idl b/modules/battery/NavigatorBattery.idl
deleted file mode 100644
index d58c82a..0000000
--- a/modules/battery/NavigatorBattery.idl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- *  Copyright (C) 2012 Samsung Electronics
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Library General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Library General Public License for more details.
- *
- *  You should have received a copy of the GNU Library General Public License
- *  along with this library; see the file COPYING.LIB.  If not, write to
- *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- *  Boston, MA 02110-1301, USA.
- */
-
-[
-    Conditional=BATTERY_STATUS
-] partial interface Navigator {
-    readonly attribute BatteryManager webkitBattery;
-};
-
diff --git a/core/page/Crypto.idl b/modules/crypto/Crypto.idl
similarity index 84%
rename from core/page/Crypto.idl
rename to modules/crypto/Crypto.idl
index 0cabce2..0682853 100644
--- a/core/page/Crypto.idl
+++ b/modules/crypto/Crypto.idl
@@ -29,6 +29,13 @@
 [
     NoInterfaceObject
 ] interface Crypto {
+    // Note that getRandomValues() is available even when the "Crypto"
+    // runtime feature is disabled.
+    //
+    // This is for compatibility sake, since getRandomValues() predates the full
+    // Web Crypto API spec.
     [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
+
+    [EnabledAtRuntime=Crypto] readonly attribute SubtleCrypto subtle;
 };
 
diff --git a/core/page/Crypto.idl b/modules/crypto/SubtleCrypto.idl
similarity index 84%
copy from core/page/Crypto.idl
copy to modules/crypto/SubtleCrypto.idl
index 0cabce2..0c2a8e4 100644
--- a/core/page/Crypto.idl
+++ b/modules/crypto/SubtleCrypto.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,7 +10,7 @@
  * 2.  Redistributions in binary form must reproduce the above copyright
  *     notice, this list of conditions and the following disclaimer in the
  *     documentation and/or other materials provided with the distribution. 
- * 3.  Neither the name of Googl, Inc. ("Google") nor the names of
+ * 3.  Neither the name of Google, Inc. ("Google") nor the names of
  *     its contributors may be used to endorse or promote products derived
  *     from this software without specific prior written permission. 
  *
@@ -27,8 +27,8 @@
  */
 
 [
-    NoInterfaceObject
-] interface Crypto {
-    [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
+    NoInterfaceObject,
+] interface SubtleCrypto {
+    // TODO(eroman): Work in progress: http://crbug.com/245025.
 };
 
diff --git a/modules/quota/DOMWindowQuota.idl b/modules/crypto/WindowCrypto.idl
similarity index 88%
copy from modules/quota/DOMWindowQuota.idl
copy to modules/crypto/WindowCrypto.idl
index c71f863..078b6ae 100644
--- a/modules/quota/DOMWindowQuota.idl
+++ b/modules/crypto/WindowCrypto.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,7 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
-    [DeprecateAs=StorageInfo] readonly attribute StorageInfo webkitStorageInfo;
+[
+    ImplementedAs=DOMWindowCrypto
+] partial interface Window {
+    readonly attribute Crypto crypto;
 };
 
diff --git a/core/page/DOMWindowPagePopup.idl b/modules/crypto/WorkerContextCrypto.idl
similarity index 86%
copy from core/page/DOMWindowPagePopup.idl
copy to modules/crypto/WorkerContextCrypto.idl
index 2ce0bec..83b298c 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/modules/crypto/WorkerContextCrypto.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -28,8 +28,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+partial interface WorkerContext {
+    [EnabledAtRuntime=Crypto] readonly attribute WorkerCrypto crypto;
 };
diff --git a/core/page/DOMWindowPagePopup.idl b/modules/crypto/WorkerCrypto.idl
similarity index 86%
copy from core/page/DOMWindowPagePopup.idl
copy to modules/crypto/WorkerCrypto.idl
index 2ce0bec..4dd16cd 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/modules/crypto/WorkerCrypto.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,7 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+    NoInterfaceObject
+] interface WorkerCrypto {
+    [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
 };
diff --git a/modules/device_orientation/DeviceMotionEvent.idl b/modules/device_orientation/DeviceMotionEvent.idl
index 8d8cc79..d291769 100644
--- a/modules/device_orientation/DeviceMotionEvent.idl
+++ b/modules/device_orientation/DeviceMotionEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    NoInterfaceObject
+    EnabledAtRuntime=deviceMotion
 ] interface DeviceMotionEvent : Event {
     readonly attribute DeviceAcceleration acceleration;
     readonly attribute DeviceAcceleration accelerationIncludingGravity;
diff --git a/modules/encryptedmedia/MediaKeys.idl b/modules/encryptedmedia/MediaKeys.idl
index b6ef196..e3f0d2c 100644
--- a/modules/encryptedmedia/MediaKeys.idl
+++ b/modules/encryptedmedia/MediaKeys.idl
@@ -27,7 +27,7 @@
     Conditional=ENCRYPTED_MEDIA_V2,
     EnabledAtRuntime=encryptedMedia,
     Constructor(DOMString keySystem),
-    RaisesException
+    ConstructorRaisesException
 ] interface MediaKeys {
     [CallWith=ScriptExecutionContext, RaisesException] MediaKeySession createSession([Default=Undefined] optional DOMString type, [Default=Undefined] optional Uint8Array initData);
 
diff --git a/modules/filesystem/FileWriter.idl b/modules/filesystem/FileWriter.idl
index 6624843..ebf71e8 100644
--- a/modules/filesystem/FileWriter.idl
+++ b/modules/filesystem/FileWriter.idl
@@ -32,7 +32,6 @@
 [
     NoInterfaceObject,
     ActiveDOMObject,
-    CallWith=ScriptExecutionContext,
     EventTarget
 ] interface FileWriter {
     // ready states
diff --git a/modules/filesystem/DOMWindowFileSystem.idl b/modules/filesystem/WindowFileSystem.idl
similarity index 96%
rename from modules/filesystem/DOMWindowFileSystem.idl
rename to modules/filesystem/WindowFileSystem.idl
index c42fe21..4fed55e 100644
--- a/modules/filesystem/DOMWindowFileSystem.idl
+++ b/modules/filesystem/WindowFileSystem.idl
@@ -24,7 +24,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
+[
+    ImplementedAs=DOMWindowFileSystem
+] partial interface Window {
     const unsigned short TEMPORARY = 0;
     const unsigned short PERSISTENT = 1;
 
diff --git a/modules/indexeddb/IDBRequest.idl b/modules/indexeddb/IDBRequest.idl
index 3f8020a..b0b0bdb 100644
--- a/modules/indexeddb/IDBRequest.idl
+++ b/modules/indexeddb/IDBRequest.idl
@@ -33,7 +33,6 @@
 ] interface IDBRequest {
     [GetterRaisesException] readonly attribute IDBAny result;
     [GetterRaisesException] readonly attribute DOMError error;
-    [TreatReturnedNullStringAs=Undefined, GetterRaisesException] readonly attribute DOMString webkitErrorMessage;
 
     readonly attribute IDBAny source;
     readonly attribute IDBTransaction transaction;
diff --git a/modules/indexeddb/IDBTransaction.idl b/modules/indexeddb/IDBTransaction.idl
index ec9995b..912736d 100644
--- a/modules/indexeddb/IDBTransaction.idl
+++ b/modules/indexeddb/IDBTransaction.idl
@@ -33,7 +33,6 @@
     readonly attribute DOMString mode;
     readonly attribute IDBDatabase db;
     readonly attribute DOMError error;
-    [TreatReturnedNullStringAs=Undefined] readonly attribute DOMString webkitErrorMessage;
 
     // Methods
     [RaisesException] IDBObjectStore objectStore (DOMString name);
diff --git a/modules/indexeddb/IDBVersionChangeEvent.idl b/modules/indexeddb/IDBVersionChangeEvent.idl
index e349114..ce66636 100644
--- a/modules/indexeddb/IDBVersionChangeEvent.idl
+++ b/modules/indexeddb/IDBVersionChangeEvent.idl
@@ -26,4 +26,8 @@
 interface IDBVersionChangeEvent : Event {
     readonly attribute IDBAny oldVersion;
     readonly attribute IDBAny newVersion;
+
+    // FIXME: This is non-standard, see
+    // https://www.w3.org/Bugs/Public/show_bug.cgi?id=22370
+    readonly attribute DOMString dataLoss;
 };
diff --git a/modules/indexeddb/DOMWindowIndexedDatabase.idl b/modules/indexeddb/WindowIndexedDatabase.idl
similarity index 95%
rename from modules/indexeddb/DOMWindowIndexedDatabase.idl
rename to modules/indexeddb/WindowIndexedDatabase.idl
index bb9982c..3823e4f 100644
--- a/modules/indexeddb/DOMWindowIndexedDatabase.idl
+++ b/modules/indexeddb/WindowIndexedDatabase.idl
@@ -24,7 +24,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
+[
+    ImplementedAs=DOMWindowIndexedDatabase
+] partial interface Window {
     [ImplementedAs=indexedDB,MeasureAs=PrefixedIndexedDB] readonly attribute IDBFactory webkitIndexedDB;
 
     [MeasureAs=UnprefixedIndexedDB] readonly attribute IDBFactory indexedDB;
diff --git a/modules/mediasource/MediaSource.idl b/modules/mediasource/MediaSource.idl
new file mode 100644
index 0000000..d0b407d
--- /dev/null
+++ b/modules/mediasource/MediaSource.idl
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
+[
+    EnabledAtRuntime=mediaSource,
+    ActiveDOMObject,
+    EventTarget,
+    Constructor,
+    ConstructorCallWith=ScriptExecutionContext
+] interface MediaSource {
+    // All the source buffers created by this object.
+    readonly attribute SourceBufferList sourceBuffers;
+
+    // Subset of sourceBuffers that provide data for the selected/enabled tracks.
+    readonly attribute SourceBufferList activeSourceBuffers;
+
+    [SetterRaisesException] attribute double duration;
+
+    [RaisesException] SourceBuffer addSourceBuffer(DOMString type);
+    [RaisesException] void removeSourceBuffer(SourceBuffer buffer);
+
+    readonly attribute DOMString readyState;
+    
+    [RaisesException] void endOfStream([Default=NullString] optional DOMString error);
+
+    static boolean isTypeSupported (DOMString type);
+
+    // EventTarget interface
+    void addEventListener(DOMString type,
+                          EventListener listener,
+                          optional boolean useCapture);
+    void removeEventListener(DOMString type,
+                             EventListener listener,
+                             optional boolean useCapture);
+    [RaisesException] boolean dispatchEvent(Event event);
+};
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/modules/mediasource/SourceBuffer.idl
similarity index 60%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to modules/mediasource/SourceBuffer.idl
index 20a0215..d04be71 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/modules/mediasource/SourceBuffer.idl
@@ -27,8 +27,36 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+ 
+[
+    NoInterfaceObject,
+    ActiveDOMObject,
+    EventTarget,
+    EnabledAtRuntime=mediaSource
+] interface SourceBuffer {
+
+    readonly attribute boolean updating;
+  
+    // Returns the time ranges buffered.
+    [GetterRaisesException] readonly attribute TimeRanges buffered;
+
+    // Applies an offset to media segment timestamps.
+    [SetterRaisesException] attribute double timestampOffset;
+
+    // Append segment data.
+    [RaisesException] void appendBuffer(ArrayBuffer data);
+    [RaisesException] void appendBuffer(ArrayBufferView data);
+
+    // Abort the current segment append sequence.
+    [RaisesException] void abort();
+
+    // EventTarget interface
+    void addEventListener(DOMString type,
+                          EventListener listener,
+                          optional boolean useCapture);
+    void removeEventListener(DOMString type,
+                             EventListener listener,
+                             optional boolean useCapture);
+    [RaisesException] boolean dispatchEvent(Event event);
+};
+
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/modules/mediasource/SourceBufferList.idl
similarity index 70%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to modules/mediasource/SourceBufferList.idl
index 20a0215..8c22965 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/modules/mediasource/SourceBufferList.idl
@@ -27,8 +27,23 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+ 
+[
+    NoInterfaceObject,
+    EnabledAtRuntime=mediaSource,
+    EventTarget,
+    CallWith=ScriptExecutionContext
+] interface SourceBufferList {
+    readonly attribute unsigned long length;
+    getter SourceBuffer item(unsigned long index);
+
+    // EventTarget interface
+    void addEventListener(DOMString type,
+                          EventListener listener,
+                          optional boolean useCapture);
+    void removeEventListener(DOMString type,
+                             EventListener listener,
+                             optional boolean useCapture);
+    [RaisesException] boolean dispatchEvent(Event event);
+};
+
diff --git a/modules/mediasource/WebKitMediaSource.idl b/modules/mediasource/WebKitMediaSource.idl
index 573548b..1bc542c 100644
--- a/modules/mediasource/WebKitMediaSource.idl
+++ b/modules/mediasource/WebKitMediaSource.idl
@@ -34,7 +34,7 @@
     ActiveDOMObject,
     EventTarget,
     Constructor,
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface WebKitMediaSource {
     // All the source buffers created by this object.
     readonly attribute WebKitSourceBufferList sourceBuffers;
diff --git a/modules/mediasource/WebKitSourceBufferList.idl b/modules/mediasource/WebKitSourceBufferList.idl
index 7cca041..ba1768e 100644
--- a/modules/mediasource/WebKitSourceBufferList.idl
+++ b/modules/mediasource/WebKitSourceBufferList.idl
@@ -32,7 +32,6 @@
     NoInterfaceObject,
     EnabledAtRuntime=webKitMediaSource,
     EventTarget,
-    CallWith=ScriptExecutionContext
 ] interface WebKitSourceBufferList {
     readonly attribute unsigned long length;
     getter WebKitSourceBuffer item(unsigned long index);
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/modules/mediasource/WindowMediaSource.idl
similarity index 98%
rename from modules/mediasource/DOMWindowMediaSource.idl
rename to modules/mediasource/WindowMediaSource.idl
index 20a0215..eb6d24b 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/modules/mediasource/WindowMediaSource.idl
@@ -27,8 +27,8 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
+partial interface Window {
     [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
     [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
     [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+};
diff --git a/modules/mediastream/MediaStream.idl b/modules/mediastream/MediaStream.idl
index dbb7392..bd7e78f 100644
--- a/modules/mediastream/MediaStream.idl
+++ b/modules/mediastream/MediaStream.idl
@@ -28,7 +28,7 @@
     Constructor,
     Constructor(MediaStream stream),
     Constructor(MediaStreamTrack[] tracks),
-    CallWith=ScriptExecutionContext
+    ConstructorCallWith=ScriptExecutionContext
 ] interface MediaStream {
     // DEPRECATED
     readonly attribute DOMString label;
diff --git a/modules/mediastream/MediaStreamTrack.idl b/modules/mediastream/MediaStreamTrack.idl
index 6710c70..d02d8ed 100644
--- a/modules/mediastream/MediaStreamTrack.idl
+++ b/modules/mediastream/MediaStreamTrack.idl
@@ -23,7 +23,6 @@
  */
 
 [
-    NoInterfaceObject,
     EventTarget,
     ActiveDOMObject
 ] interface MediaStreamTrack {
@@ -38,6 +37,8 @@
     attribute EventListener onunmute;
     attribute EventListener onended;
 
+    [CallWith=ScriptExecutionContext, RaisesException] static void getSources(MediaStreamTrackSourcesCallback callback);
+
     // EventTarget interface
     void addEventListener(DOMString type,
                           EventListener listener,
diff --git a/modules/quota/DOMWindowQuota.idl b/modules/mediastream/MediaStreamTrackSourcesCallback.idl
similarity index 78%
copy from modules/quota/DOMWindowQuota.idl
copy to modules/mediastream/MediaStreamTrackSourcesCallback.idl
index c71f863..ce89327 100644
--- a/modules/quota/DOMWindowQuota.idl
+++ b/modules/mediastream/MediaStreamTrackSourcesCallback.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,10 +10,10 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GOOGLE INC. OR
  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
-    [DeprecateAs=StorageInfo] readonly attribute StorageInfo webkitStorageInfo;
+callback interface MediaStreamTrackSourcesCallback {
+    boolean handleEvent(sequence<SourceInfo> sources);
 };
 
diff --git a/modules/mediastream/RTCIceCandidate.idl b/modules/mediastream/RTCIceCandidate.idl
index acad5fa..8abe472 100644
--- a/modules/mediastream/RTCIceCandidate.idl
+++ b/modules/mediastream/RTCIceCandidate.idl
@@ -30,7 +30,7 @@
 
 [
     Constructor(Dictionary dictionary),
-    RaisesException
+    ConstructorRaisesException
 ] interface RTCIceCandidate {
     readonly attribute DOMString candidate;
     readonly attribute DOMString sdpMid;
diff --git a/modules/mediastream/RTCPeerConnection.idl b/modules/mediastream/RTCPeerConnection.idl
index 04f2bcb..33daf3a 100644
--- a/modules/mediastream/RTCPeerConnection.idl
+++ b/modules/mediastream/RTCPeerConnection.idl
@@ -32,8 +32,8 @@
     NoInterfaceObject,
     ActiveDOMObject,
     Constructor(Dictionary rtcIceServers, optional Dictionary mediaConstraints),
-    RaisesException,
-    CallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface RTCPeerConnection {
     [RaisesException] void createOffer(RTCSessionDescriptionCallback successCallback, [Default=Undefined] optional RTCErrorCallback failureCallback, optional Dictionary mediaConstraints);
diff --git a/modules/mediastream/RTCSessionDescription.idl b/modules/mediastream/RTCSessionDescription.idl
index bdd8d69..0e3d464 100644
--- a/modules/mediastream/RTCSessionDescription.idl
+++ b/modules/mediastream/RTCSessionDescription.idl
@@ -30,7 +30,7 @@
 
 [
     Constructor(Dictionary dictionary),
-    RaisesException
+    ConstructorRaisesException
 ] interface RTCSessionDescription {
     [SetterRaisesException] attribute DOMString type;
     [SetterRaisesException] attribute DOMString sdp;
diff --git a/modules/speech/DOMWindowSpeechSynthesis.idl b/modules/mediastream/SourceInfo.idl
similarity index 74%
copy from modules/speech/DOMWindowSpeechSynthesis.idl
copy to modules/mediastream/SourceInfo.idl
index 7acb4bc..814dd65 100644
--- a/modules/speech/DOMWindowSpeechSynthesis.idl
+++ b/modules/mediastream/SourceInfo.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -10,10 +10,10 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GOOGLE INC. OR
  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -24,7 +24,10 @@
  */
 
 [
-    EnabledAtRuntime=speechSynthesis
-] partial interface DOMWindow {
-    readonly attribute SpeechSynthesis speechSynthesis;
+    NoInterfaceObject
+] interface SourceInfo {
+    readonly attribute DOMString id;
+    readonly attribute DOMString kind;
+    readonly attribute DOMString label;
+    readonly attribute DOMString facing;
 };
diff --git a/modules/notifications/Notification.idl b/modules/notifications/Notification.idl
index 22b76f5..0d5d7f7 100644
--- a/modules/notifications/Notification.idl
+++ b/modules/notifications/Notification.idl
@@ -33,41 +33,26 @@
     Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
     ActiveDOMObject,
     EventTarget,
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
     Constructor(DOMString title, [Default=Undefined] optional Dictionary options),
-    CallWith=ScriptExecutionContext,
-#else
-#endif
+    ConstructorCallWith=ScriptExecutionContext,
 ] interface Notification {
     void show();
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
-    void cancel();
-#endif
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
-    void close();
-#endif
+    [Conditional=LEGACY_NOTIFICATIONS] void cancel();
+    [Conditional=NOTIFICATIONS] void close();
 
 
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
-    [CallWith=ScriptExecutionContext] static readonly attribute DOMString permission;
-    [CallWith=ScriptExecutionContext] static void requestPermission(optional NotificationPermissionCallback callback);
-#endif
+    [CallWith=ScriptExecutionContext, Conditional=NOTIFICATIONS] static readonly attribute DOMString permission;
+    [CallWith=ScriptExecutionContext, Conditional=NOTIFICATIONS] static void requestPermission(optional NotificationPermissionCallback callback);
 
     attribute EventListener onshow;
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
-    attribute EventListener ondisplay;
-#endif
+    [Conditional=LEGACY_NOTIFICATIONS] attribute EventListener ondisplay;
     attribute EventListener onerror;
     attribute EventListener onclose;
     attribute EventListener onclick;
 
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
-    attribute DOMString dir;
-    attribute DOMString replaceId;
-#endif
-#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
-    attribute DOMString tag;
-#endif
+    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString dir;
+    [Conditional=LEGACY_NOTIFICATIONS] attribute DOMString replaceId;
+    [Conditional=NOTIFICATIONS] attribute DOMString tag;
 
     // EventTarget interface
     void addEventListener(DOMString type, 
diff --git a/modules/notifications/NotificationCenter.idl b/modules/notifications/NotificationCenter.idl
index 9dbc0fe..50b5e15 100644
--- a/modules/notifications/NotificationCenter.idl
+++ b/modules/notifications/NotificationCenter.idl
@@ -34,9 +34,7 @@
     Conditional=LEGACY_NOTIFICATIONS,
     ActiveDOMObject
 ] interface NotificationCenter {
-#if !defined(ENABLE_TEXT_NOTIFICATIONS_ONLY) || !ENABLE_TEXT_NOTIFICATIONS_ONLY
    [EnabledPerContext=htmlNotifications, MeasureAs=LegacyHTMLNotifications, ActivityLog=Access, RaisesException] Notification createHTMLNotification(DOMString url);
-#endif
    [MeasureAs=LegacyTextNotifications, ActivityLog=Access, RaisesException] Notification createNotification(DOMString iconUrl, DOMString title, DOMString body);
 
    long checkPermission();
diff --git a/modules/notifications/DOMWindowNotifications.idl b/modules/notifications/WindowNotifications.idl
similarity index 84%
rename from modules/notifications/DOMWindowNotifications.idl
rename to modules/notifications/WindowNotifications.idl
index 9fc7865..7f474e5 100644
--- a/modules/notifications/DOMWindowNotifications.idl
+++ b/modules/notifications/WindowNotifications.idl
@@ -25,10 +25,9 @@
  */
 
 [
-    Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
-] partial interface DOMWindow {
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
-    [EnabledAtRuntime=notifications, MeasureAs=LegacyNotifications, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds] readonly attribute NotificationCenter webkitNotifications;
-#endif
+    Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS,
+    ImplementedAs=DOMWindowNotifications
+] partial interface Window {
+    [EnabledAtRuntime=notifications, MeasureAs=LegacyNotifications, PerWorldBindings, ActivityLog=GetterForIsolatedWorlds, Conditional=LEGACY_NOTIFICATIONS] readonly attribute NotificationCenter webkitNotifications;
 };
 
diff --git a/modules/notifications/WorkerContextNotifications.idl b/modules/notifications/WorkerContextNotifications.idl
index aae97b3..e8f86b9 100644
--- a/modules/notifications/WorkerContextNotifications.idl
+++ b/modules/notifications/WorkerContextNotifications.idl
@@ -27,8 +27,6 @@
 [
     Conditional=NOTIFICATIONS|LEGACY_NOTIFICATIONS
 ] partial interface WorkerContext {
-#if defined(ENABLE_LEGACY_NOTIFICATIONS) && ENABLE_LEGACY_NOTIFICATIONS
-    [EnabledAtRuntime=notifications] readonly attribute NotificationCenter webkitNotifications;
-#endif
+    [EnabledAtRuntime=notifications, Conditional=LEGACY_NOTIFICATIONS] readonly attribute NotificationCenter webkitNotifications;
 };
 
diff --git a/core/page/DOMWindowPagePopup.idl b/modules/performance/WorkerContextPerformance.idl
similarity index 86%
copy from core/page/DOMWindowPagePopup.idl
copy to modules/performance/WorkerContextPerformance.idl
index 2ce0bec..79ef789 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/modules/performance/WorkerContextPerformance.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,7 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+    EnabledAtRuntime=HighResolutionTimeInWorkers
+] partial interface WorkerContext {
+    readonly attribute WorkerPerformance performance;
 };
diff --git a/core/page/DOMWindowPagePopup.idl b/modules/performance/WorkerPerformance.idl
similarity index 85%
copy from core/page/DOMWindowPagePopup.idl
copy to modules/performance/WorkerPerformance.idl
index 2ce0bec..c4ab7fd 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/modules/performance/WorkerPerformance.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -29,7 +29,9 @@
  */
 
 [
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+    NoInterfaceObject
+] interface WorkerPerformance {
+    // See https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime2/Overview.html for details.
+    double now();
 };
+
diff --git a/modules/quota/StorageErrorCallback.idl b/modules/quota/StorageErrorCallback.idl
index 0d65450..79ea608 100644
--- a/modules/quota/StorageErrorCallback.idl
+++ b/modules/quota/StorageErrorCallback.idl
@@ -29,5 +29,5 @@
  */
 
 callback interface StorageErrorCallback {
-    boolean handleEvent(DOMCoreException error);
+    boolean handleEvent(DOMException error);
 };
diff --git a/modules/quota/DOMWindowQuota.idl b/modules/quota/WindowQuota.idl
similarity index 95%
rename from modules/quota/DOMWindowQuota.idl
rename to modules/quota/WindowQuota.idl
index c71f863..1f8ce5e 100644
--- a/modules/quota/DOMWindowQuota.idl
+++ b/modules/quota/WindowQuota.idl
@@ -23,7 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
+[
+    ImplementedAs=DOMWindowQuota
+] partial interface Window {
     [DeprecateAs=StorageInfo] readonly attribute StorageInfo webkitStorageInfo;
 };
 
diff --git a/modules/speech/SpeechRecognition.idl b/modules/speech/SpeechRecognition.idl
index bb4351d..2baaa9d 100644
--- a/modules/speech/SpeechRecognition.idl
+++ b/modules/speech/SpeechRecognition.idl
@@ -27,7 +27,7 @@
     NoInterfaceObject,
     ActiveDOMObject,
     Constructor,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface SpeechRecognition {
     attribute SpeechGrammarList grammars;
diff --git a/modules/speech/SpeechSynthesisUtterance.idl b/modules/speech/SpeechSynthesisUtterance.idl
index 4e602a9..3a9a64b 100644
--- a/modules/speech/SpeechSynthesisUtterance.idl
+++ b/modules/speech/SpeechSynthesisUtterance.idl
@@ -26,7 +26,7 @@
 [
     EnabledAtRuntime=speechSynthesis,
     EventTarget,
-    CallWith=ScriptExecutionContext,
+    ConstructorCallWith=ScriptExecutionContext,
     Constructor([Default=NullString] optional DOMString text)
 ] interface SpeechSynthesisUtterance {
     attribute DOMString text;
diff --git a/modules/speech/DOMWindowSpeechSynthesis.idl b/modules/speech/WindowSpeechSynthesis.idl
similarity index 92%
rename from modules/speech/DOMWindowSpeechSynthesis.idl
rename to modules/speech/WindowSpeechSynthesis.idl
index 7acb4bc..d9d5b5f 100644
--- a/modules/speech/DOMWindowSpeechSynthesis.idl
+++ b/modules/speech/WindowSpeechSynthesis.idl
@@ -24,7 +24,8 @@
  */
 
 [
-    EnabledAtRuntime=speechSynthesis
-] partial interface DOMWindow {
+    EnabledAtRuntime=speechSynthesis,
+    ImplementedAs=DOMWindowSpeechSynthesis
+] partial interface Window {
     readonly attribute SpeechSynthesis speechSynthesis;
 };
diff --git a/modules/vibration/NavigatorVibration.idl b/modules/vibration/NavigatorVibration.idl
index ba3b258..8519266 100644
--- a/modules/vibration/NavigatorVibration.idl
+++ b/modules/vibration/NavigatorVibration.idl
@@ -18,9 +18,9 @@
  */
 
 [
-    Conditional=VIBRATION
+    EnabledAtRuntime=Vibration
 ] partial interface Navigator {
-    [RaisesException] void vibrate(sequence<unsigned long> pattern);
-    [RaisesException] void vibrate(unsigned long time);
+    boolean vibrate(sequence<unsigned long> pattern);
+    boolean vibrate(unsigned long time);
 };
 
diff --git a/modules/webaudio/OfflineAudioContext.idl b/modules/webaudio/OfflineAudioContext.idl
index cbaa9ca..3a3e9ef 100644
--- a/modules/webaudio/OfflineAudioContext.idl
+++ b/modules/webaudio/OfflineAudioContext.idl
@@ -27,8 +27,8 @@
     Conditional=WEB_AUDIO,
     EventTarget,
     Constructor(unsigned long numberOfChannels, unsigned long numberOfFrames, float sampleRate),
-    RaisesException,
-    CallWith=ScriptExecutionContext
+    ConstructorRaisesException,
+    ConstructorCallWith=ScriptExecutionContext
 ] interface OfflineAudioContext : AudioContext {
 
 };
diff --git a/modules/webdatabase/DOMWindowWebDatabase.idl b/modules/webdatabase/WindowWebDatabase.idl
similarity index 96%
rename from modules/webdatabase/DOMWindowWebDatabase.idl
rename to modules/webdatabase/WindowWebDatabase.idl
index 0d525e8..842c79b 100644
--- a/modules/webdatabase/DOMWindowWebDatabase.idl
+++ b/modules/webdatabase/WindowWebDatabase.idl
@@ -24,7 +24,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-partial interface DOMWindow {
+[
+    ImplementedAs=DOMWindowWebDatabase
+] partial interface Window {
     [EnabledAtRuntime=database, MeasureAs=OpenWebDatabase, PerWorldBindings, ActivityLog=AccessForIsolatedWorlds, RaisesException] Database openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback creationCallback);
 };
 
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/modules/webmidi/MIDIAccessPromise.idl
similarity index 81%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to modules/webmidi/MIDIAccessPromise.idl
index 20a0215..2a4b37a 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/modules/webmidi/MIDIAccessPromise.idl
@@ -27,8 +27,13 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+
+// FIXME: Once Promise is implemented, remove this interface and use it.
+// See also, http://crbug.com/243345
+[
+    NoInterfaceObject,
+    ActiveDOMObject
+] interface MIDIAccessPromise {
+    // Supports only then() method tentatively. But it never returns Promise.
+    void then(MIDISuccessCallback successCallback, MIDIErrorCallback errorCallback);
+};
diff --git a/modules/webmidi/MIDIConnectionEvent.idl b/modules/webmidi/MIDIConnectionEvent.idl
index 59481a3..a9c745a 100644
--- a/modules/webmidi/MIDIConnectionEvent.idl
+++ b/modules/webmidi/MIDIConnectionEvent.idl
@@ -29,7 +29,7 @@
  */
 
 [
-    NoInterfaceObject,
+    EnabledAtRuntime=webMIDI,
     ConstructorTemplate=Event
 ] interface MIDIConnectionEvent : Event {
     [InitializedByEventConstructor] readonly attribute MIDIPort port;
diff --git a/modules/webmidi/MIDIMessageEvent.idl b/modules/webmidi/MIDIMessageEvent.idl
index 5a9c05f..fe64536 100644
--- a/modules/webmidi/MIDIMessageEvent.idl
+++ b/modules/webmidi/MIDIMessageEvent.idl
@@ -31,7 +31,7 @@
 // FIXME: The spec doesn't provide details about constructor, yet.
 // See also, https://github.com/WebAudio/web-midi-api/issues/1 .
 [
-    NoInterfaceObject,
+    EnabledAtRuntime=webMIDI,
     ConstructorTemplate=Event
 ] interface MIDIMessageEvent : Event {
     [InitializedByEventConstructor] readonly attribute double receivedTime;
diff --git a/modules/mediasource/DOMWindowMediaSource.idl b/modules/webmidi/MIDISuccessCallback.idl
similarity index 81%
copy from modules/mediasource/DOMWindowMediaSource.idl
copy to modules/webmidi/MIDISuccessCallback.idl
index 20a0215..d2976e8 100644
--- a/modules/mediasource/DOMWindowMediaSource.idl
+++ b/modules/webmidi/MIDISuccessCallback.idl
@@ -27,8 +27,10 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-partial interface DOMWindow {
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitMediaSourceConstructor WebKitMediaSource;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferConstructor WebKitSourceBuffer;
-    [EnabledAtRuntime=webKitMediaSource] attribute WebKitSourceBufferListConstructor WebKitSourceBufferList;
-};
\ No newline at end of file
+
+callback interface MIDISuccessCallback {
+    // FIXME: The second argument should be Dictionary, but IDL generator
+    // can not handle Dictionary as a handleEvent argument correctly now.
+    // http://crbug.com/246161
+    boolean handleEvent(MIDIAccess access, boolean sysexEnabled);
+};
diff --git a/core/page/DOMWindowPagePopup.idl b/modules/webmidi/NavigatorWebMIDI.idl
similarity index 86%
copy from core/page/DOMWindowPagePopup.idl
copy to modules/webmidi/NavigatorWebMIDI.idl
index 2ce0bec..9e8ced7 100644
--- a/core/page/DOMWindowPagePopup.idl
+++ b/modules/webmidi/NavigatorWebMIDI.idl
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2013 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -28,8 +28,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    EnabledAtRuntime=pagePopup
-] partial interface DOMWindow {
-    [EnabledPerContext=pagePopup] readonly attribute PagePopupController pagePopupController;
+partial interface Navigator {
+    [EnabledAtRuntime=webMIDI] MIDIAccessPromise requestMIDIAccess(optional Dictionary options);
 };
diff --git a/modules/websockets/WebSocket.idl b/modules/websockets/WebSocket.idl
index 0973a42..425ac96 100644
--- a/modules/websockets/WebSocket.idl
+++ b/modules/websockets/WebSocket.idl
@@ -34,8 +34,8 @@
     Constructor(DOMString url),
     Constructor(DOMString url, sequence<DOMString> protocols),
     Constructor(DOMString url, DOMString protocol),
-    RaisesException,
-    CallWith=ScriptExecutionContext,
+    ConstructorRaisesException,
+    ConstructorCallWith=ScriptExecutionContext,
     EventTarget
 ] interface WebSocket {
     readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
@@ -61,10 +61,10 @@
 
     attribute DOMString binaryType;
 
-    [RaisesException] boolean send(ArrayBuffer data);
-    [RaisesException] boolean send(ArrayBufferView data);
-    [RaisesException] boolean send(Blob data);
-    [RaisesException] boolean send(DOMString data);
+    [RaisesException] void send(ArrayBuffer data);
+    [RaisesException] void send(ArrayBufferView data);
+    [RaisesException] void send(Blob data);
+    [RaisesException] void send(DOMString data);
 
     [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason);