Merge from Chromium at DEPS revision 225410

This commit was generated by merge_to_master.py.

Change-Id: I639f21f936f7475217030840a808765c32e44635
diff --git a/Source/core/.gitignore b/Source/core/.gitignore
index d0ba3eb..448dc80 100644
--- a/Source/core/.gitignore
+++ b/Source/core/.gitignore
@@ -5,7 +5,5 @@
 *.tmp
 *.vcproj*
 *.vcxproj*
-WebCore.xcodeproj
-webcore_bindings_sources.props
-webcore_bindings_sources.targets
-webcore_bindings_sources.xml
+core.xcodeproj
+core_derived_sources.xcodeproj
diff --git a/Source/core/DEPS b/Source/core/DEPS
index 634db90..bd95807 100644
--- a/Source/core/DEPS
+++ b/Source/core/DEPS
@@ -2,11 +2,12 @@
     "+bindings",
     "+core",
     "+mozilla",
+    "+platform",
     "+public/platform",
     "+sys",
     "+weborigin",
 
-    "-WebKit",
+    "-web",
     "-modules",
 # core/ should not depend on modules/ at all, but there are a number of pieces
 # of code that do. Please don't add to this list of exceptions.
diff --git a/Source/core/Resources/pagepopups/calendarPicker.js b/Source/core/Resources/pagepopups/calendarPicker.js
index 5111f3d..a01c5ba 100644
--- a/Source/core/Resources/pagepopups/calendarPicker.js
+++ b/Source/core/Resources/pagepopups/calendarPicker.js
@@ -3813,19 +3813,19 @@
         return;
     var firstDayInSelection = dayOrWeekOrMonth.firstDay();    
     var lastDayInSelection = dayOrWeekOrMonth.lastDay();
-    if (this.firstVisibleDay() < firstDayInSelection || this.lastVisibleDay() > lastDayInSelection) {
-        // Change current month only if the entire selection will be visible.
-        var candidateCurrentMonth = null;
-        if (this.firstVisibleDay() > firstDayInSelection || this.lastVisibleDay() < lastDayInSelection)
-            candidateCurrentMonth = Month.createFromDay(firstDayInSelection);
-        if (candidateCurrentMonth) {
-            var firstVisibleRow = this.calendarTableView.columnAndRowForDay(candidateCurrentMonth.firstDay()).row;
-            var firstVisibleDay = this.calendarTableView.dayAtColumnAndRow(0, firstVisibleRow);
-            var lastVisibleRow = this.calendarTableView.columnAndRowForDay(candidateCurrentMonth.lastDay()).row;
-            var lastVisibleDay = this.calendarTableView.dayAtColumnAndRow(DaysPerWeek - 1, lastVisibleRow);
-            if (firstDayInSelection >= firstVisibleDay && lastDayInSelection <= lastVisibleDay)
-                this.setCurrentMonth(candidateCurrentMonth, CalendarPicker.NavigationBehavior.WithAnimation);
-        }
+    var candidateCurrentMonth = Month.createFromDay(firstDayInSelection);
+    if (this.firstVisibleDay() > lastDayInSelection || this.lastVisibleDay() < firstDayInSelection) {
+        // Change current month if the selection is not visible at all.
+        this.setCurrentMonth(candidateCurrentMonth, CalendarPicker.NavigationBehavior.WithAnimation);
+    } else if (this.firstVisibleDay() < firstDayInSelection || this.lastVisibleDay() > lastDayInSelection) {
+        // If the selection is partly visible, only change the current month if
+        // doing so will make the whole selection visible.
+        var firstVisibleRow = this.calendarTableView.columnAndRowForDay(candidateCurrentMonth.firstDay()).row;
+        var firstVisibleDay = this.calendarTableView.dayAtColumnAndRow(0, firstVisibleRow);
+        var lastVisibleRow = this.calendarTableView.columnAndRowForDay(candidateCurrentMonth.lastDay()).row;
+        var lastVisibleDay = this.calendarTableView.dayAtColumnAndRow(DaysPerWeek - 1, lastVisibleRow);
+        if (firstDayInSelection >= firstVisibleDay && lastDayInSelection <= lastVisibleDay)
+            this.setCurrentMonth(candidateCurrentMonth, CalendarPicker.NavigationBehavior.WithAnimation);
     }
     this._setHighlight(dayOrWeekOrMonth);
     if (!this.isValid(dayOrWeekOrMonth))
diff --git a/Source/core/accessibility/AXObjectCache.cpp b/Source/core/accessibility/AXObjectCache.cpp
index ad15a32..6b1048c 100644
--- a/Source/core/accessibility/AXObjectCache.cpp
+++ b/Source/core/accessibility/AXObjectCache.cpp
@@ -317,7 +317,7 @@
 
     RefPtr<AccessibilityObject> newObj = 0;
     if (widget->isFrameView())
-        newObj = AccessibilityScrollView::create(static_cast<ScrollView*>(widget));
+        newObj = AccessibilityScrollView::create(toScrollView(widget));
     else if (widget->isScrollbar())
         newObj = AccessibilityScrollbar::create(static_cast<Scrollbar*>(widget));
 
@@ -635,7 +635,7 @@
         // Make sure none of the render views are in the process of being layed out.
         // Notifications should only be sent after the renderer has finished
         if (obj->isAccessibilityRenderObject()) {
-            AccessibilityRenderObject* renderObj = static_cast<AccessibilityRenderObject*>(obj);
+            AccessibilityRenderObject* renderObj = toAccessibilityRenderObject(obj);
             RenderObject* renderer = renderObj->renderer();
             if (renderer && renderer->view())
                 ASSERT(!renderer->view()->layoutState());
diff --git a/Source/core/accessibility/AccessibilityARIAGridCell.cpp b/Source/core/accessibility/AccessibilityARIAGridCell.cpp
index 201aef6..c2c17a2 100644
--- a/Source/core/accessibility/AccessibilityARIAGridCell.cpp
+++ b/Source/core/accessibility/AccessibilityARIAGridCell.cpp
@@ -81,7 +81,7 @@
     } else if (parent->isAccessibilityTable()) {
         // We reached the parent table, so we need to inspect its
         // children to determine the row index for the cell in it.
-        unsigned columnCount = static_cast<AccessibilityTable*>(parent)->columnCount();
+        unsigned columnCount = toAccessibilityTable(parent)->columnCount();
         if (!columnCount)
             return;
 
diff --git a/Source/core/accessibility/AccessibilityARIAGridRow.cpp b/Source/core/accessibility/AccessibilityARIAGridRow.cpp
index a9f14c8..a7ddd26 100644
--- a/Source/core/accessibility/AccessibilityARIAGridRow.cpp
+++ b/Source/core/accessibility/AccessibilityARIAGridRow.cpp
@@ -73,7 +73,7 @@
         return;
 
     unsigned level = hierarchicalLevel();
-    AccessibilityChildrenVector& allRows = static_cast<AccessibilityTable*>(parent)->rows();
+    AccessibilityChildrenVector& allRows = toAccessibilityTable(parent)->rows();
     int rowCount = allRows.size();
     for (int k = index + 1; k < rowCount; ++k) {
         AccessibilityObject* row = allRows[k].get();
@@ -100,7 +100,7 @@
 
     // Search for the previous row that matches the correct level.
     int index = rowIndex();
-    AccessibilityChildrenVector& allRows = static_cast<AccessibilityTable*>(parent)->rows();
+    AccessibilityChildrenVector& allRows = toAccessibilityTable(parent)->rows();
     int rowCount = allRows.size();
     if (index >= rowCount)
         return 0;
diff --git a/Source/core/accessibility/AccessibilityImageMapLink.cpp b/Source/core/accessibility/AccessibilityImageMapLink.cpp
index 312548e..cc7e052 100644
--- a/Source/core/accessibility/AccessibilityImageMapLink.cpp
+++ b/Source/core/accessibility/AccessibilityImageMapLink.cpp
@@ -145,7 +145,7 @@
 
     RenderObject* renderer;
     if (m_parent && m_parent->isAccessibilityRenderObject())
-        renderer = static_cast<AccessibilityRenderObject*>(m_parent)->renderer();
+        renderer = toAccessibilityRenderObject(m_parent)->renderer();
     else
         renderer = m_mapElement->renderer();
 
diff --git a/Source/core/accessibility/AccessibilityMenuList.cpp b/Source/core/accessibility/AccessibilityMenuList.cpp
index 46dd227..0cdb6c8 100644
--- a/Source/core/accessibility/AccessibilityMenuList.cpp
+++ b/Source/core/accessibility/AccessibilityMenuList.cpp
@@ -44,7 +44,7 @@
 
 bool AccessibilityMenuList::press() const
 {
-    RenderMenuList* menuList = static_cast<RenderMenuList*>(m_renderer);
+    RenderMenuList* menuList = toRenderMenuList(m_renderer);
     if (menuList->popupIsVisible())
         menuList->hidePopup();
     else
@@ -62,7 +62,7 @@
     if (!list)
         return;
 
-    static_cast<AccessibilityMockObject*>(list)->setParent(this);
+    toAccessibilityMockObject(list)->setParent(this);
     if (list->accessibilityIsIgnored()) {
         cache->remove(list->axObjectID());
         return;
@@ -84,7 +84,7 @@
 
 bool AccessibilityMenuList::isCollapsed() const
 {
-    return !static_cast<RenderMenuList*>(m_renderer)->popupIsVisible();
+    return !toRenderMenuList(m_renderer)->popupIsVisible();
 }
 
 bool AccessibilityMenuList::canSetFocusAttribute() const
diff --git a/Source/core/accessibility/AccessibilityNodeObject.cpp b/Source/core/accessibility/AccessibilityNodeObject.cpp
index 7e7bc64..294fd98 100644
--- a/Source/core/accessibility/AccessibilityNodeObject.cpp
+++ b/Source/core/accessibility/AccessibilityNodeObject.cpp
@@ -1089,6 +1089,10 @@
     // quite long. As a heuristic, skip links, controls, and elements that are usually
     // containers with lots of children.
 
+    // Skip hidden children
+    if (equalIgnoringCase(obj->getAttribute(aria_hiddenAttr), "true"))
+        return false;
+
     // Skip focusable children, so we don't include the text of links and controls.
     if (obj->canSetFocusAttribute())
         return false;
diff --git a/Source/core/accessibility/AccessibilityRenderObject.cpp b/Source/core/accessibility/AccessibilityRenderObject.cpp
index f604032..e70aaf1 100644
--- a/Source/core/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/core/accessibility/AccessibilityRenderObject.cpp
@@ -227,11 +227,11 @@
 
     for (const AccessibilityObject* obj = this; obj; obj = obj->parentObject()) {
         if (obj->isAccessibilityRenderObject())
-            static_cast<const AccessibilityRenderObject*>(obj)->checkCachedElementRect();
+            toAccessibilityRenderObject(obj)->checkCachedElementRect();
     }
     for (const AccessibilityObject* obj = this; obj; obj = obj->parentObject()) {
         if (obj->isAccessibilityRenderObject())
-            static_cast<const AccessibilityRenderObject*>(obj)->updateCachedElementRect();
+            toAccessibilityRenderObject(obj)->updateCachedElementRect();
     }
 
     return m_cachedElementRect;
@@ -1157,7 +1157,7 @@
         // CSS content is used to insert text or when a RenderCounter is used.)
         RenderText* renderTextObject = toRenderText(m_renderer);
         if (renderTextObject->isTextFragment())
-            return String(static_cast<RenderTextFragment*>(m_renderer)->contentString());
+            return String(toRenderTextFragment(m_renderer)->contentString());
         else
             return String(renderTextObject->text());
     }
@@ -1324,7 +1324,7 @@
     if (result && result->accessibilityIsIgnored()) {
         // If this element is the label of a control, a hit test should return the control.
         if (result->isAccessibilityRenderObject()) {
-            AccessibilityObject* controlObject = static_cast<AccessibilityRenderObject*>(result)->correspondingControlForLabelElement();
+            AccessibilityObject* controlObject = toAccessibilityRenderObject(result)->correspondingControlForLabelElement();
             if (controlObject && !controlObject->exposesTitleUIElement())
                 return controlObject;
         }
@@ -1694,7 +1694,7 @@
     Document& doc = renderer()->document();
     if (!doc.frame()->selection().isFocusedAndActive() || doc.focusedElement() != element)
         return;
-    AccessibilityRenderObject* activedescendant = static_cast<AccessibilityRenderObject*>(activeDescendant());
+    AccessibilityRenderObject* activedescendant = toAccessibilityRenderObject(activeDescendant());
 
     if (activedescendant && shouldNotifyActiveDescendant())
         doc.axObjectCache()->postNotification(m_renderer, AXObjectCache::AXActiveDescendantChanged, true);
@@ -2197,7 +2197,7 @@
     if (!spinButtonElement || !spinButtonElement->isSpinButtonElement())
         return;
 
-    AccessibilitySpinButton* axSpinButton = static_cast<AccessibilitySpinButton*>(axObjectCache()->getOrCreate(SpinButtonRole));
+    AccessibilitySpinButton* axSpinButton = toAccessibilitySpinButton(axObjectCache()->getOrCreate(SpinButtonRole));
     axSpinButton->setSpinButtonElement(toSpinButtonElement(spinButtonElement));
     axSpinButton->setParent(this);
     m_children.append(axSpinButton);
@@ -2326,7 +2326,7 @@
     if (!parent->isAccessibilityRenderObject())
         return false;
 
-    Node* elementNode = static_cast<AccessibilityRenderObject*>(parent)->node();
+    Node* elementNode = toAccessibilityRenderObject(parent)->node();
     if (!elementNode || !elementNode->isElementNode())
         return false;
 
diff --git a/Source/core/accessibility/AccessibilityScrollView.cpp b/Source/core/accessibility/AccessibilityScrollView.cpp
index cc35e73..3e13f5b 100644
--- a/Source/core/accessibility/AccessibilityScrollView.cpp
+++ b/Source/core/accessibility/AccessibilityScrollView.cpp
@@ -117,7 +117,7 @@
 void AccessibilityScrollView::removeChildScrollbar(AccessibilityObject* scrollbar)
 {
     size_t pos = m_children.find(scrollbar);
-    if (pos != WTF::notFound) {
+    if (pos != kNotFound) {
         m_children[pos]->detachFromParent();
         m_children.remove(pos);
     }
diff --git a/Source/core/accessibility/AccessibilityTableHeaderContainer.cpp b/Source/core/accessibility/AccessibilityTableHeaderContainer.cpp
index 1a1d972..ab946f2 100644
--- a/Source/core/accessibility/AccessibilityTableHeaderContainer.cpp
+++ b/Source/core/accessibility/AccessibilityTableHeaderContainer.cpp
@@ -69,7 +69,7 @@
     if (!m_parent || !m_parent->isAccessibilityTable())
         return;
 
-    static_cast<AccessibilityTable*>(m_parent)->columnHeaders(m_children);
+    toAccessibilityTable(m_parent)->columnHeaders(m_children);
 
     unsigned length = m_children.size();
     for (unsigned k = 0; k < length; ++k)
diff --git a/Source/core/animation/AnimationStack.h b/Source/core/animation/AnimationStack.h
index e6e28f6..b046cd4 100644
--- a/Source/core/animation/AnimationStack.h
+++ b/Source/core/animation/AnimationStack.h
@@ -47,7 +47,7 @@
     void remove(Animation* animation)
     {
         size_t position = m_activeAnimations.find(animation);
-        ASSERT(position != notFound);
+        ASSERT(position != kNotFound);
         m_activeAnimations.remove(position);
     }
     bool isEmpty() const { return m_activeAnimations.isEmpty(); }
diff --git a/Source/core/animation/DocumentTimeline.h b/Source/core/animation/DocumentTimeline.h
index 56c4c38..9323f55 100644
--- a/Source/core/animation/DocumentTimeline.h
+++ b/Source/core/animation/DocumentTimeline.h
@@ -34,7 +34,7 @@
 #include "core/animation/ActiveAnimations.h"
 #include "core/animation/Player.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 #include "wtf/Vector.h"
diff --git a/Source/core/animation/css/CSSAnimations.cpp b/Source/core/animation/css/CSSAnimations.cpp
index 9d4ef7b..162ffd9 100644
--- a/Source/core/animation/css/CSSAnimations.cpp
+++ b/Source/core/animation/css/CSSAnimations.cpp
@@ -37,8 +37,8 @@
 #include "core/css/CSSKeyframeRule.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/WebKitAnimationEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/WebKitAnimationEvent.h"
 #include "core/platform/animation/CSSAnimationDataList.h"
 #include "core/platform/animation/TimingFunction.h"
 #include "wtf/HashSet.h"
@@ -320,6 +320,7 @@
     case CSSPropertyMaxWidth:
     case CSSPropertyMinHeight:
     case CSSPropertyMinWidth:
+    case CSSPropertyObjectPosition:
     case CSSPropertyOpacity:
     case CSSPropertyOrphans:
     case CSSPropertyOutlineColor:
diff --git a/Source/core/core.gyp b/Source/core/core.gyp
index f515299..d40a4b8 100644
--- a/Source/core/core.gyp
+++ b/Source/core/core.gyp
@@ -240,13 +240,9 @@
         # FIXME: Remove these once the bindings script generates qualified
         # includes for these correctly. (Sequences don't work yet.)
         '<(bindings_dir)/v8/custom',
-        '../modules/mediastream',
-        '../modules/speech',
-        'dom',
         'html',
         'html/shadow',
         'inspector',
-        'page',
         'svg',
       ],
       'sources': [
@@ -356,6 +352,7 @@
         'core_derived_sources.gyp:make_derived_sources',
         '../wtf/wtf.gyp:wtf',
         '../config.gyp:config',
+        '../platform/blink_platform.gyp:blink_platform',
         '../weborigin/weborigin.gyp:weborigin',
         '<(DEPTH)/third_party/angle_dx11/src/build_angle.gyp:translator_glsl',
         '<(DEPTH)/gpu/gpu.gyp:gles2_c_lib',
@@ -396,7 +393,7 @@
       ],
       'direct_dependent_settings': {
         'defines': [
-          'WEBKIT_IMPLEMENTATION=1',
+          'BLINK_IMPLEMENTATION=1',
           'INSIDE_WEBKIT',
         ],
         'include_dirs': [
@@ -556,10 +553,6 @@
       'sources': [
         '<@(webcore_dom_files)',
       ],
-      'sources!': [
-        'dom/default/PlatformMessagePortChannel.cpp',
-        'dom/default/PlatformMessagePortChannel.h',
-      ],
       # Disable c4267 warnings until we fix size_t to int truncations.
       'msvs_disabled_warnings': [ 4267, ],
     },
@@ -805,7 +798,6 @@
             ['include', 'platform/chromium/FileSystemChromiumLinux\\.cpp$'],
             ['include', 'platform/graphics/chromium/GlyphPageTreeNodeLinux\\.cpp$'],
             ['include', 'platform/graphics/chromium/VDMXParser\\.cpp$'],
-            ['exclude', 'platform/graphics/skia/FontCacheSkia\\.cpp$'],
           ],
         }, { # OS!="android"
           'sources/': [
@@ -1045,13 +1037,6 @@
             'webcore_arm_neon',
           ],
         }],
-        ['OS=="mac"', {
-          'direct_dependent_settings': {
-            'include_dirs': [
-              '../WebKit/mac/WebCoreSupport',
-            ],
-          },
-        }],
         ['OS=="linux" and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
           'link_settings': {
             'ldflags': [
@@ -1081,7 +1066,7 @@
         'webcore',
       ],
       'defines': [
-        'WEBKIT_IMPLEMENTATION=1',
+        'BLINK_IMPLEMENTATION=1',
         'INSIDE_WEBKIT',
       ],
       'include_dirs': [
diff --git a/Source/core/core.gypi b/Source/core/core.gypi
index f506b1d..38b8c3c 100644
--- a/Source/core/core.gypi
+++ b/Source/core/core.gypi
@@ -42,9 +42,6 @@
             'css/WebKitCSSRegionRule.idl',
             'css/WebKitCSSTransformValue.idl',
             'dom/Attr.idl',
-            'dom/AutocompleteErrorEvent.idl',
-            'dom/BeforeLoadEvent.idl',
-            'dom/BeforeUnloadEvent.idl',
             'dom/CDATASection.idl',
             'dom/CharacterData.idl',
             'dom/ChildNode.idl',
@@ -52,8 +49,12 @@
             'dom/ClientRectList.idl',
             'dom/Clipboard.idl',
             'dom/Comment.idl',
-            'dom/CompositionEvent.idl',
-            'dom/CustomEvent.idl',
+            'dom/DataTransferItem.idl',
+            'dom/DataTransferItemList.idl',
+            'dom/Document.idl',
+            'dom/DocumentFragment.idl',
+            'dom/DocumentFullscreen.idl',
+            'dom/DocumentType.idl',
             'dom/DOMError.idl',
             'dom/DOMException.idl',
             'dom/DOMImplementation.idl',
@@ -61,25 +62,10 @@
             'dom/DOMStringList.idl',
             'dom/DOMStringMap.idl',
             'dom/DOMTokenList.idl',
-            'dom/DataTransferItem.idl',
-            'dom/DataTransferItemList.idl',
-            'dom/Document.idl',
-            'dom/DocumentFragment.idl',
-            'dom/DocumentFullscreen.idl',
-            'dom/DocumentType.idl',
             'dom/Element.idl',
             'dom/Entity.idl',
-            'dom/ErrorEvent.idl',
-            'dom/Event.idl',
-            'dom/EventTarget.idl',
-            'dom/FocusEvent.idl',
-            'dom/HashChangeEvent.idl',
-            'dom/KeyboardEvent.idl',
             'dom/MessageChannel.idl',
-            'dom/MessageEvent.idl',
             'dom/MessagePort.idl',
-            'dom/MouseEvent.idl',
-            'dom/MutationEvent.idl',
             'dom/MutationObserver.idl',
             'dom/MutationRecord.idl',
             'dom/NamedNodeMap.idl',
@@ -88,32 +74,45 @@
             'dom/NodeIterator.idl',
             'dom/NodeList.idl',
             'dom/Notation.idl',
-            'dom/OverflowEvent.idl',
-            'dom/PageTransitionEvent.idl',
             'dom/ParentNode.idl',
-            'dom/PopStateEvent.idl',
             'dom/ProcessingInstruction.idl',
-            'dom/ProgressEvent.idl',
             'dom/Promise.idl',
-            'dom/PromiseResolver.idl',
             'dom/Range.idl',
             'dom/RequestAnimationFrameCallback.idl',
-            'dom/ResourceProgressEvent.idl',
-            'dom/SecurityPolicyViolationEvent.idl',
+            'dom/shadow/ShadowRoot.idl',
             'dom/StringCallback.idl',
             'dom/Text.idl',
-            'dom/TextEvent.idl',
             'dom/Touch.idl',
-            'dom/TouchEvent.idl',
             'dom/TouchList.idl',
-            'dom/TransitionEvent.idl',
             'dom/TreeWalker.idl',
-            'dom/UIEvent.idl',
-            'dom/WebKitAnimationEvent.idl',
             'dom/WebKitNamedFlow.idl',
             'dom/WebKitNamedFlowCollection.idl',
-            'dom/WheelEvent.idl',
-            'dom/shadow/ShadowRoot.idl',
+            'events/AutocompleteErrorEvent.idl',
+            'events/BeforeLoadEvent.idl',
+            'events/BeforeUnloadEvent.idl',
+            'events/CompositionEvent.idl',
+            'events/CustomEvent.idl',
+            'events/ErrorEvent.idl',
+            'events/Event.idl',
+            'events/EventTarget.idl',
+            'events/FocusEvent.idl',
+            'events/HashChangeEvent.idl',
+            'events/KeyboardEvent.idl',
+            'events/MessageEvent.idl',
+            'events/MouseEvent.idl',
+            'events/MutationEvent.idl',
+            'events/OverflowEvent.idl',
+            'events/PageTransitionEvent.idl',
+            'events/PopStateEvent.idl',
+            'events/ProgressEvent.idl',
+            'events/ResourceProgressEvent.idl',
+            'events/SecurityPolicyViolationEvent.idl',
+            'events/TextEvent.idl',
+            'events/TouchEvent.idl',
+            'events/TransitionEvent.idl',
+            'events/UIEvent.idl',
+            'events/WebKitAnimationEvent.idl',
+            'events/WheelEvent.idl',
             'fileapi/Blob.idl',
             'fileapi/File.idl',
             'fileapi/FileError.idl',
@@ -885,7 +884,6 @@
             'editing/VisibleUnits.cpp',
             'editing/WrapContentsInDummySpanCommand.cpp',
             'editing/WrapContentsInDummySpanCommand.h',
-            'editing/chromium/EditorChromium.cpp',
             'editing/htmlediting.cpp',
             'editing/markup.cpp',
             'fetch/CachedMetadata.cpp',
@@ -1537,6 +1535,8 @@
             'rendering/VerticalPositionCache.h',
             'rendering/break_lines.cpp',
             'rendering/break_lines.h',
+            'rendering/animation/WebAnimationProvider.cpp',
+            'rendering/animation/WebAnimationProvider.h',
             'rendering/shapes/PolygonShape.cpp',
             'rendering/shapes/PolygonShape.h',
             'rendering/shapes/RasterShape.cpp',
@@ -1749,16 +1749,9 @@
         'webcore_dom_files': [
             'dom/ActiveDOMObject.cpp',
             'dom/Attr.cpp',
-            'dom/AutocompleteErrorEvent.h',
-            'dom/BeforeLoadEvent.h',
-            'dom/BeforeTextInsertedEvent.cpp',
-            'dom/BeforeTextInsertedEvent.h',
-            'dom/BeforeUnloadEvent.cpp',
-            'dom/BeforeUnloadEvent.h',
             'dom/CDATASection.cpp',
             'dom/CDATASection.h',
             'dom/CharacterData.cpp',
-            'dom/CheckedRadioButtons.cpp',
             'dom/ChildListMutationScope.cpp',
             'dom/ChildListMutationScope.h',
             'dom/ChildNodeList.cpp',
@@ -1770,21 +1763,17 @@
             'dom/ClientRectList.cpp',
             'dom/ClientRectList.h',
             'dom/Clipboard.cpp',
-            'dom/ClipboardEvent.cpp',
-            'dom/ClipboardEvent.h',
             'dom/Comment.cpp',
             'dom/Comment.h',
-            'dom/CompositionEvent.cpp',
-            'dom/CompositionEvent.h',
             'dom/ContainerNode.cpp',
-            'dom/ContainerNodeAlgorithms.h',
             'dom/ContainerNodeAlgorithms.cpp',
-            'dom/ContextLifecycleObserver.h',
-            'dom/ContextLifecycleObserver.cpp',
+            'dom/ContainerNodeAlgorithms.h',
             'dom/ContextFeatures.cpp',
             'dom/ContextFeatures.h',
             'dom/ContextLifecycleNotifier.cpp',
             'dom/ContextLifecycleNotifier.h',
+            'dom/ContextLifecycleObserver.cpp',
+            'dom/ContextLifecycleObserver.h',
             'dom/CrossThreadTask.h',
             'dom/CustomElement.cpp',
             'dom/CustomElement.h',
@@ -1811,33 +1800,18 @@
             'dom/CustomElementRegistry.h',
             'dom/CustomElementUpgradeCandidateMap.cpp',
             'dom/CustomElementUpgradeCandidateMap.h',
-            'dom/CustomEvent.cpp',
-            'dom/CustomEvent.h',
-            'dom/DOMError.cpp',
-            'dom/DOMError.h',
-            'dom/DOMException.cpp',
-            'dom/DOMException.h',
-            'dom/DOMImplementation.cpp',
-            'dom/DOMNamedFlowCollection.cpp',
-            'dom/DOMNamedFlowCollection.h',
-            'dom/DOMStringList.cpp',
-            'dom/DOMStringList.h',
-            'dom/DOMStringMap.cpp',
-            'dom/DOMStringMap.h',
-            'dom/DOMTokenList.cpp',
-            'dom/DOMTokenList.h',
+            'dom/DatasetDOMStringMap.cpp',
+            'dom/DatasetDOMStringMap.h',
             'dom/DataTransferItem.cpp',
             'dom/DataTransferItem.h',
             'dom/DataTransferItemList.h',
-            'dom/DatasetDOMStringMap.cpp',
-            'dom/DatasetDOMStringMap.h',
             'dom/DecodedDataDocumentParser.cpp',
             'dom/DecodedDataDocumentParser.h',
+            'dom/default/chromium/PlatformMessagePortChannelChromium.cpp',
+            'dom/default/chromium/PlatformMessagePortChannelChromium.h',
             'dom/DeviceOrientationController.cpp',
             'dom/DeviceOrientationController.h',
             'dom/Document.cpp',
-            'dom/DocumentEventQueue.cpp',
-            'dom/DocumentEventQueue.h',
             'dom/DocumentFragment.cpp',
             'dom/DocumentFullscreen.cpp',
             'dom/DocumentFullscreen.h',
@@ -1845,8 +1819,8 @@
             'dom/DocumentInit.h',
             'dom/DocumentLifecycleObserver.cpp',
             'dom/DocumentLifecycleObserver.h',
-            'dom/DocumentMarkerController.cpp',
             'dom/DocumentMarker.cpp',
+            'dom/DocumentMarkerController.cpp',
             'dom/DocumentOrderedList.cpp',
             'dom/DocumentOrderedList.h',
             'dom/DocumentOrderedMap.cpp',
@@ -1855,62 +1829,45 @@
             'dom/DocumentStyleSheetCollection.cpp',
             'dom/DocumentStyleSheetCollection.h',
             'dom/DocumentType.cpp',
+            'dom/DOMError.cpp',
+            'dom/DOMError.h',
+            'dom/DOMException.cpp',
+            'dom/DOMException.h',
+            'dom/DOMImplementation.cpp',
+            'dom/DOMNamedFlowCollection.cpp',
+            'dom/DOMNamedFlowCollection.h',
+            'dom/DOMSettableTokenList.cpp',
+            'dom/DOMSettableTokenList.h',
+            'dom/DOMStringList.cpp',
+            'dom/DOMStringList.h',
+            'dom/DOMStringMap.cpp',
+            'dom/DOMStringMap.h',
+            'dom/DOMTokenList.cpp',
+            'dom/DOMTokenList.h',
             'dom/Element.cpp',
             'dom/Element.h',
             'dom/ElementRareData.cpp',
             'dom/ElementRareData.h',
             'dom/ElementTraversal.h',
             'dom/Entity.h',
-            'dom/ErrorEvent.cpp',
-            'dom/ErrorEvent.h',
-            'dom/Event.cpp',
-            'dom/EventContext.cpp',
-            'dom/EventContext.h',
-            'dom/EventDispatchMediator.cpp',
-            'dom/EventDispatchMediator.h',
-            'dom/EventDispatcher.cpp',
-            'dom/EventDispatcher.h',
-            'dom/EventRetargeter.cpp',
-            'dom/EventRetargeter.h',
-            'dom/EventListenerMap.cpp',
-            'dom/EventNames.cpp',
-            'dom/EventPathWalker.cpp',
-            'dom/EventPathWalker.h',
-            'dom/EventQueue.h',
-            'dom/EventSender.h',
-            'dom/EventTarget.cpp',
-            'dom/FocusEvent.cpp',
-            'dom/FocusEvent.h',
             'dom/FullscreenElementStack.cpp',
             'dom/FullscreenElementStack.h',
-            'dom/GenericEventQueue.cpp',
-            'dom/GenericEventQueue.h',
-            'dom/GestureEvent.cpp',
-            'dom/GestureEvent.h',
-            'dom/HashChangeEvent.h',
-            'dom/IgnoreDestructiveWriteCountIncrementer.h',
             'dom/IconURL.cpp',
             'dom/IconURL.h',
             'dom/IdTargetObserver.cpp',
             'dom/IdTargetObserver.h',
             'dom/IdTargetObserverRegistry.cpp',
             'dom/IdTargetObserverRegistry.h',
-            'dom/KeyboardEvent.cpp',
+            'dom/IgnoreDestructiveWriteCountIncrementer.h',
             'dom/LiveNodeList.cpp',
             'dom/LiveNodeList.h',
             'dom/MessageChannel.cpp',
             'dom/MessageChannel.h',
-            'dom/MessageEvent.cpp',
-            'dom/MessageEvent.h',
             'dom/MessagePort.cpp',
             'dom/MessagePortChannel.cpp',
             'dom/Microtask.cpp',
             'dom/Microtask.h',
-            'dom/MouseEvent.cpp',
-            'dom/MouseRelatedEvent.cpp',
             'dom/MutationCallback.h',
-            'dom/MutationEvent.cpp',
-            'dom/MutationEvent.h',
             'dom/MutationObserver.cpp',
             'dom/MutationObserver.h',
             'dom/MutationObserverInterestGroup.cpp',
@@ -1923,11 +1880,11 @@
             'dom/NamedFlow.h',
             'dom/NamedFlowCollection.cpp',
             'dom/NamedFlowCollection.h',
-            'dom/NameNodeList.cpp',
-            'dom/NameNodeList.h',
             'dom/NamedNodeMap.cpp',
             'dom/NamedNodesCollection.cpp',
             'dom/NamedNodesCollection.h',
+            'dom/NameNodeList.cpp',
+            'dom/NameNodeList.h',
             'dom/Node.cpp',
             'dom/NodeFilter.cpp',
             'dom/NodeFilter.h',
@@ -1947,49 +1904,46 @@
             'dom/NodeTraversal.h',
             'dom/NodeWithIndex.h',
             'dom/Notation.h',
-            'dom/OverflowEvent.cpp',
-            'dom/OverflowEvent.h',
-            'dom/PageTransitionEvent.cpp',
-            'dom/PageTransitionEvent.h',
             'dom/ParentNode.h',
             'dom/PendingScript.cpp',
-            'dom/PopStateEvent.cpp',
-            'dom/PopStateEvent.h',
             'dom/Position.cpp',
             'dom/PositionIterator.cpp',
             'dom/PositionIterator.h',
-            'dom/ProcessingInstruction.cpp',
-            'dom/ProcessingInstruction.h',
-            'dom/ProgressEvent.cpp',
-            'dom/ProgressEvent.h',
             'dom/PostAttachCallbacks.cpp',
             'dom/PostAttachCallbacks.h',
+            'dom/ProcessingInstruction.cpp',
+            'dom/ProcessingInstruction.h',
             'dom/Promise.h',
-            'dom/PromiseResolver.h',
             'dom/PseudoElement.cpp',
             'dom/QualifiedName.cpp',
             'dom/Range.cpp',
             'dom/RawDataDocumentParser.h',
             'dom/RequestAnimationFrameCallback.h',
-            'dom/ResourceProgressEvent.cpp',
-            'dom/ResourceProgressEvent.h',
-            'dom/ScopedEventQueue.cpp',
-            'dom/ScopedEventQueue.h',
-            'dom/ScriptExecutionContext.cpp',
-            'dom/ScriptLoader.cpp',
-            'dom/ScriptLoader.h',
-            'dom/ScriptRunner.cpp',
             'dom/ScriptableDocumentParser.cpp',
             'dom/ScriptableDocumentParser.h',
             'dom/ScriptedAnimationController.cpp',
             'dom/ScriptedAnimationController.h',
+            'dom/ScriptExecutionContext.cpp',
+            'dom/ScriptLoader.cpp',
+            'dom/ScriptLoader.h',
+            'dom/ScriptRunner.cpp',
             'dom/SecurityContext.cpp',
             'dom/SecurityContext.h',
-            'dom/SecurityPolicyViolationEvent.h',
             'dom/SelectorQuery.cpp',
             'dom/SelectorQuery.h',
-            'dom/DOMSettableTokenList.cpp',
-            'dom/DOMSettableTokenList.h',
+            'dom/shadow/ComposedTreeWalker.cpp',
+            'dom/shadow/ComposedTreeWalker.h',
+            'dom/shadow/ContentDistribution.cpp',
+            'dom/shadow/ContentDistribution.h',
+            'dom/shadow/ElementShadow.cpp',
+            'dom/shadow/ElementShadow.h',
+            'dom/shadow/InsertionPoint.cpp',
+            'dom/shadow/InsertionPoint.h',
+            'dom/shadow/SelectRuleFeatureSet.cpp',
+            'dom/shadow/SelectRuleFeatureSet.h',
+            'dom/shadow/ShadowRoot.cpp',
+            'dom/shadow/ShadowRoot.h',
+            'dom/shadow/ShadowRootRareData.h',
             'dom/ShadowTreeStyleSheetCollection.cpp',
             'dom/ShadowTreeStyleSheetCollection.h',
             'dom/SimulatedClickOptions.h',
@@ -2009,22 +1963,16 @@
             'dom/TagNodeList.cpp',
             'dom/TagNodeList.h',
             'dom/Text.cpp',
-            'dom/TextEvent.cpp',
-            'dom/TextEvent.h',
             'dom/TextLinkColors.cpp',
             'dom/TextLinkColors.h',
             'dom/Touch.cpp',
             'dom/Touch.h',
             'dom/TouchController.cpp',
             'dom/TouchController.h',
-            'dom/TouchEvent.cpp',
-            'dom/TouchEvent.h',
             'dom/TouchList.cpp',
             'dom/TouchList.h',
             'dom/TransformSource.h',
             'dom/TransformSourceLibxslt.cpp',
-            'dom/TransitionEvent.cpp',
-            'dom/TransitionEvent.h',
             'dom/Traversal.cpp',
             'dom/Traversal.h',
             'dom/TreeScope.cpp',
@@ -2033,82 +1981,98 @@
             'dom/TreeScopeAdopter.h',
             'dom/TreeWalker.cpp',
             'dom/TreeWalker.h',
-            'dom/UIEvent.cpp',
-            'dom/UIEventWithKeyState.cpp',
-            'dom/UserActionElementSet.h',
             'dom/UserActionElementSet.cpp',
+            'dom/UserActionElementSet.h',
             'dom/UserGestureIndicator.cpp',
             'dom/UserTypingGestureIndicator.cpp',
             'dom/ViewportArguments.cpp',
             'dom/ViewportArguments.h',
             'dom/VisitedLinkState.cpp',
             'dom/VisitedLinkState.h',
-            'dom/WebKitAnimationEvent.cpp',
-            'dom/WebKitAnimationEvent.h',
             'dom/WheelController.cpp',
             'dom/WheelController.h',
-            'dom/WheelEvent.cpp',
-            'dom/WheelEvent.h',
-            'dom/WindowEventContext.cpp',
-            'dom/WindowEventContext.h',
-            'dom/default/PlatformMessagePortChannel.cpp',
-            'dom/default/PlatformMessagePortChannel.h',
-            'dom/default/chromium/PlatformMessagePortChannelChromium.cpp',
-            'dom/default/chromium/PlatformMessagePortChannelChromium.h',
-            'dom/shadow/ComposedTreeWalker.cpp',
-            'dom/shadow/ComposedTreeWalker.h',
-            'dom/shadow/ContentDistribution.cpp',
-            'dom/shadow/ContentDistribution.h',
-            'dom/shadow/ShadowRootRareData.h',
-            'dom/shadow/ElementShadow.cpp',
-            'dom/shadow/ElementShadow.h',
-            'dom/shadow/InsertionPoint.cpp',
-            'dom/shadow/InsertionPoint.h',
-            'dom/shadow/SelectRuleFeatureSet.cpp',
-            'dom/shadow/SelectRuleFeatureSet.h',
-            'dom/shadow/ShadowRoot.cpp',
-            'dom/shadow/ShadowRoot.h',
+            'events/AutocompleteErrorEvent.h',
+            'events/BeforeLoadEvent.h',
+            'events/BeforeTextInsertedEvent.cpp',
+            'events/BeforeTextInsertedEvent.h',
+            'events/BeforeUnloadEvent.cpp',
+            'events/BeforeUnloadEvent.h',
+            'events/ClipboardEvent.cpp',
+            'events/ClipboardEvent.h',
+            'events/CompositionEvent.cpp',
+            'events/CompositionEvent.h',
+            'events/CustomEvent.cpp',
+            'events/CustomEvent.h',
+            'events/DocumentEventQueue.cpp',
+            'events/DocumentEventQueue.h',
+            'events/ErrorEvent.cpp',
+            'events/ErrorEvent.h',
+            'events/Event.cpp',
+            'events/EventContext.cpp',
+            'events/EventContext.h',
+            'events/EventDispatcher.cpp',
+            'events/EventDispatcher.h',
+            'events/EventDispatchMediator.cpp',
+            'events/EventDispatchMediator.h',
+            'events/EventListenerMap.cpp',
+            'events/EventNames.cpp',
+            'events/EventPathWalker.cpp',
+            'events/EventPathWalker.h',
+            'events/EventQueue.h',
+            'events/EventRetargeter.cpp',
+            'events/EventRetargeter.h',
+            'events/EventSender.h',
+            'events/EventTarget.cpp',
+            'events/FocusEvent.cpp',
+            'events/FocusEvent.h',
+            'events/GenericEventQueue.cpp',
+            'events/GenericEventQueue.h',
+            'events/GestureEvent.cpp',
+            'events/GestureEvent.h',
+            'events/HashChangeEvent.h',
+            'events/KeyboardEvent.cpp',
+            'events/MessageEvent.cpp',
+            'events/MessageEvent.h',
+            'events/MouseEvent.cpp',
+            'events/MouseRelatedEvent.cpp',
+            'events/MutationEvent.cpp',
+            'events/MutationEvent.h',
+            'events/OverflowEvent.cpp',
+            'events/OverflowEvent.h',
+            'events/PageTransitionEvent.cpp',
+            'events/PageTransitionEvent.h',
+            'events/PopStateEvent.cpp',
+            'events/PopStateEvent.h',
+            'events/ProgressEvent.cpp',
+            'events/ProgressEvent.h',
+            'events/ResourceProgressEvent.cpp',
+            'events/ResourceProgressEvent.h',
+            'events/ScopedEventQueue.cpp',
+            'events/ScopedEventQueue.h',
+            'events/SecurityPolicyViolationEvent.h',
+            'events/TextEvent.cpp',
+            'events/TextEvent.h',
+            'events/TouchEvent.cpp',
+            'events/TouchEvent.h',
+            'events/TransitionEvent.cpp',
+            'events/TransitionEvent.h',
+            'events/UIEvent.cpp',
+            'events/UIEventWithKeyState.cpp',
+            'events/WebKitAnimationEvent.cpp',
+            'events/WebKitAnimationEvent.h',
+            'events/WheelEvent.cpp',
+            'events/WheelEvent.h',
+            'events/WindowEventContext.cpp',
+            'events/WindowEventContext.h',
         ],
         'webcore_html_files': [
-            'html/BaseButtonInputType.cpp',
-            'html/BaseButtonInputType.h',
-            'html/BaseCheckableInputType.cpp',
-            'html/BaseCheckableInputType.h',
-            'html/BaseChooserOnlyDateAndTimeInputType.cpp',
-            'html/BaseChooserOnlyDateAndTimeInputType.h',
-            'html/BaseClickableWithKeyInputType.cpp',
-            'html/BaseClickableWithKeyInputType.h',
-            'html/BaseDateAndTimeInputType.cpp',
-            'html/BaseDateAndTimeInputType.h',
-            'html/BaseMultipleFieldsDateAndTimeInputType.cpp',
-            'html/BaseMultipleFieldsDateAndTimeInputType.h',
-            'html/BaseTextInputType.cpp',
-            'html/BaseTextInputType.h',
-            'html/ButtonInputType.cpp',
-            'html/ButtonInputType.h',
-            'html/CheckboxInputType.cpp',
-            'html/CheckboxInputType.h',
             'html/ClassList.cpp',
             'html/ClassList.h',
-            'html/ColorInputType.cpp',
-            'html/ColorInputType.h',
             'html/DOMFormData.cpp',
             'html/DOMFormData.h',
             'html/DOMURL.cpp',
             'html/DOMURL.h',
-            'html/DateInputType.cpp',
-            'html/DateInputType.h',
-            'html/DateTimeFieldsState.cpp',
-            'html/DateTimeFieldsState.h',
-            'html/DateTimeLocalInputType.cpp',
-            'html/DateTimeLocalInputType.h',
-            'html/EmailInputType.cpp',
-            'html/EmailInputType.h',
-            'html/FileInputType.cpp',
-            'html/FileInputType.h',
             'html/FormAssociatedElement.cpp',
-            'html/FormController.cpp',
-            'html/FormController.h',
             'html/FormDataList.cpp',
             'html/FormDataList.h',
             'html/HTMLAllCollection.cpp',
@@ -2275,18 +2239,10 @@
             'html/HTMLVideoElement.h',
             'html/HTMLViewSourceDocument.cpp',
             'html/HTMLViewSourceDocument.h',
-            'html/HiddenInputType.cpp',
-            'html/HiddenInputType.h',
             'html/ImageData.cpp',
             'html/ImageData.h',
             'html/ImageDocument.cpp',
             'html/ImageDocument.h',
-            'html/ImageInputType.cpp',
-            'html/ImageInputType.h',
-            'html/InputType.cpp',
-            'html/InputType.h',
-            'html/InputTypeNames.cpp',
-            'html/InputTypeNames.h',
             'html/LabelableElement.cpp',
             'html/LabelsNodeList.cpp',
             'html/LabelsNodeList.h',
@@ -2308,54 +2264,20 @@
             'html/MediaKeyEvent.h',
             'html/HTMLMediaSource.cpp',
             'html/HTMLMediaSource.h',
-            'html/MonthInputType.cpp',
-            'html/MonthInputType.h',
-            'html/NumberInputType.cpp',
-            'html/NumberInputType.h',
-            'html/PasswordInputType.cpp',
-            'html/PasswordInputType.h',
             'html/PluginDocument.cpp',
             'html/PluginDocument.h',
             'html/PublicURLManager.h',
             'html/PublicURLManager.cpp',
-            'html/RadioInputType.cpp',
-            'html/RadioInputType.h',
             'html/RadioNodeList.cpp',
             'html/RadioNodeList.h',
-            'html/RangeInputType.cpp',
-            'html/RangeInputType.h',
-            'html/ResetInputType.cpp',
-            'html/ResetInputType.h',
-            'html/SearchInputType.cpp',
-            'html/SearchInputType.h',
-            'html/StepRange.cpp',
-            'html/StepRange.h',
-            'html/SubmitInputType.cpp',
-            'html/SubmitInputType.h',
-            'html/TelephoneInputType.cpp',
-            'html/TelephoneInputType.h',
             'html/TextDocument.cpp',
             'html/TextDocument.h',
-            'html/TextFieldInputType.cpp',
-            'html/TextFieldInputType.h',
-            'html/TextInputType.cpp',
-            'html/TextInputType.h',
             'html/TextMetrics.h',
-            'html/TimeInputType.cpp',
-            'html/TimeInputType.h',
             'html/TimeRanges.cpp',
             'html/TimeRanges.h',
-            'html/URLInputType.cpp',
-            'html/URLInputType.h',
             'html/URLRegistry.h',
-            'html/ValidationMessage.cpp',
-            'html/ValidationMessage.h',
             'html/ValidityState.cpp',
             'html/ValidityState.h',
-            'html/WeekInputType.cpp',
-            'html/WeekInputType.h',
-            'html/TypeAhead.cpp',
-            'html/TypeAhead.h',
             'html/canvas/ANGLEInstancedArrays.cpp',
             'html/canvas/ANGLEInstancedArrays.h',
             'html/canvas/Canvas2DContextAttributes.cpp',
@@ -2449,8 +2371,84 @@
             'html/canvas/WebGLUniformLocation.h',
             'html/canvas/WebGLVertexArrayObjectOES.cpp',
             'html/canvas/WebGLVertexArrayObjectOES.h',
+            'html/forms/BaseButtonInputType.cpp',
+            'html/forms/BaseButtonInputType.h',
+            'html/forms/BaseCheckableInputType.cpp',
+            'html/forms/BaseCheckableInputType.h',
+            'html/forms/BaseChooserOnlyDateAndTimeInputType.cpp',
+            'html/forms/BaseChooserOnlyDateAndTimeInputType.h',
+            'html/forms/BaseClickableWithKeyInputType.cpp',
+            'html/forms/BaseClickableWithKeyInputType.h',
+            'html/forms/BaseDateAndTimeInputType.cpp',
+            'html/forms/BaseDateAndTimeInputType.h',
+            'html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp',
+            'html/forms/BaseMultipleFieldsDateAndTimeInputType.h',
+            'html/forms/BaseTextInputType.cpp',
+            'html/forms/BaseTextInputType.h',
+            'html/forms/ButtonInputType.cpp',
+            'html/forms/ButtonInputType.h',
+            'html/forms/CheckboxInputType.cpp',
+            'html/forms/CheckboxInputType.h',
+            'html/forms/CheckedRadioButtons.cpp',
+            'html/forms/CheckedRadioButtons.h',
+            'html/forms/ColorInputType.cpp',
+            'html/forms/ColorInputType.h',
+            'html/forms/DateInputType.cpp',
+            'html/forms/DateInputType.h',
+            'html/forms/DateTimeFieldsState.cpp',
+            'html/forms/DateTimeFieldsState.h',
+            'html/forms/DateTimeLocalInputType.cpp',
+            'html/forms/DateTimeLocalInputType.h',
+            'html/forms/EmailInputType.cpp',
+            'html/forms/EmailInputType.h',
+            'html/forms/FileInputType.cpp',
+            'html/forms/FileInputType.h',
+            'html/forms/FormController.cpp',
+            'html/forms/FormController.h',
+            'html/forms/HiddenInputType.cpp',
+            'html/forms/HiddenInputType.h',
+            'html/forms/ImageInputType.cpp',
+            'html/forms/ImageInputType.h',
+            'html/forms/InputType.cpp',
+            'html/forms/InputType.h',
+            'html/forms/InputTypeNames.cpp',
+            'html/forms/InputTypeNames.h',
             'html/forms/InputTypeView.cpp',
             'html/forms/InputTypeView.h',
+            'html/forms/MonthInputType.cpp',
+            'html/forms/MonthInputType.h',
+            'html/forms/NumberInputType.cpp',
+            'html/forms/NumberInputType.h',
+            'html/forms/PasswordInputType.cpp',
+            'html/forms/PasswordInputType.h',
+            'html/forms/RadioInputType.cpp',
+            'html/forms/RadioInputType.h',
+            'html/forms/RangeInputType.cpp',
+            'html/forms/RangeInputType.h',
+            'html/forms/ResetInputType.cpp',
+            'html/forms/ResetInputType.h',
+            'html/forms/SearchInputType.cpp',
+            'html/forms/SearchInputType.h',
+            'html/forms/StepRange.cpp',
+            'html/forms/StepRange.h',
+            'html/forms/SubmitInputType.cpp',
+            'html/forms/SubmitInputType.h',
+            'html/forms/TelephoneInputType.cpp',
+            'html/forms/TelephoneInputType.h',
+            'html/forms/TextFieldInputType.cpp',
+            'html/forms/TextFieldInputType.h',
+            'html/forms/TextInputType.cpp',
+            'html/forms/TextInputType.h',
+            'html/forms/TimeInputType.cpp',
+            'html/forms/TimeInputType.h',
+            'html/forms/TypeAhead.cpp',
+            'html/forms/TypeAhead.h',
+            'html/forms/URLInputType.cpp',
+            'html/forms/URLInputType.h',
+            'html/forms/ValidationMessage.cpp',
+            'html/forms/ValidationMessage.h',
+            'html/forms/WeekInputType.cpp',
+            'html/forms/WeekInputType.h',
             'html/parser/AtomicHTMLToken.h',
             'html/parser/BackgroundHTMLParser.cpp',
             'html/parser/BackgroundHTMLParser.h',
@@ -2494,6 +2492,8 @@
             'html/parser/HTMLScriptRunnerHost.h',
             'html/parser/HTMLSourceTracker.cpp',
             'html/parser/HTMLSourceTracker.h',
+            'html/parser/HTMLSrcsetParser.cpp',
+            'html/parser/HTMLSrcsetParser.h',
             'html/parser/HTMLStackItem.h',
             'html/parser/HTMLToken.h',
             'html/parser/HTMLTokenizer.cpp',
@@ -2591,8 +2591,6 @@
             'platform/AsyncFileSystemCallbacks.h',
             'platform/CalculationValue.cpp',
             'platform/CalculationValue.h',
-            'platform/Clock.cpp',
-            'platform/Clock.h',
             'platform/ContentType.cpp',
             'platform/ContentType.h',
             'platform/ContextMenu.cpp',
@@ -2631,6 +2629,7 @@
             'platform/MIMETypeFromURL.cpp',
             'platform/MIMETypeFromURL.h',
             'platform/NotImplemented.cpp',
+            'platform/ParsingUtilities.h',
             'platform/Partitions.cpp',
             'platform/Partitions.h',
             'platform/Pasteboard.cpp',
@@ -2697,6 +2696,8 @@
             'platform/Widget.cpp',
             'platform/Widget.h',
             'platform/animation/AnimationValue.h',
+            'platform/animation/AnimationTranslationUtil.cpp',
+            'platform/animation/AnimationTranslationUtil.h',
             'platform/animation/CSSAnimationData.cpp',
             'platform/animation/CSSAnimationDataList.cpp',
             'platform/animation/KeyframeValueList.cpp',
@@ -2807,9 +2808,9 @@
             'platform/chromium/KeyCodeConversionAndroid.cpp',
             'platform/chromium/KeyCodeConversionGtk.cpp',
             'platform/chromium/KeyboardCodes.h',
-            'platform/chromium/LanguageChromium.cpp',
             'platform/chromium/MemoryUsageSupportChromium.cpp',
             'platform/chromium/MIMETypeRegistryChromium.cpp',
+            'platform/chromium/PasteMode.h',
             'platform/chromium/PlatformKeyboardEventChromium.cpp',
             'platform/chromium/PlatformScreenChromium.cpp',
             'platform/chromium/PlatformThemeChromiumDefault.cpp',
@@ -2899,8 +2900,6 @@
             'platform/graphics/cg/IntPointCG.cpp',
             'platform/graphics/cg/IntRectCG.cpp',
             'platform/graphics/cg/IntSizeCG.cpp',
-            'platform/graphics/chromium/AnimationTranslationUtil.cpp',
-            'platform/graphics/chromium/AnimationTranslationUtil.h',
             'platform/graphics/chromium/Canvas2DLayerBridge.cpp',
             'platform/graphics/chromium/Canvas2DLayerBridge.h',
             'platform/graphics/chromium/Canvas2DLayerManager.cpp',
@@ -3826,13 +3825,13 @@
             'page/ImageBitmapTest.cpp',
             'platform/DecimalTest.cpp',
             'platform/SharedBufferTest.cpp',
+            'platform/animation/AnimationTranslationUtilTest.cpp',
             'platform/chromium/ClipboardChromiumTest.cpp',
             'platform/graphics/BitmapImageTest.cpp',
             'platform/graphics/FontTest.cpp',
             'platform/graphics/GraphicsContextTest.cpp',
             'platform/graphics/RoundedRectTest.cpp',
             'platform/graphics/UnitBezierTest.cpp',
-            'platform/graphics/chromium/AnimationTranslationUtilTest.cpp',
             'platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp',
             'platform/graphics/chromium/Canvas2DLayerManagerTest.cpp',
             'platform/graphics/chromium/DeferredImageDecoderTest.cpp',
diff --git a/Source/core/core_derived_sources.gyp b/Source/core/core_derived_sources.gyp
index 058f19e..1ef444a 100644
--- a/Source/core/core_derived_sources.gyp
+++ b/Source/core/core_derived_sources.gyp
@@ -345,8 +345,8 @@
             'scripts/Hasher.pm',
             'scripts/StaticString.pm',
             'scripts/make_names.pl',
-            'svg/svgtags.in',
-            'svg/svgattrs.in',
+            'svg/SVGTagNames.in',
+            'svg/SVGAttributeNames.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/blink/SVGNames.cpp',
@@ -375,7 +375,7 @@
             'scripts/make_event_factory.py',
             'scripts/name_utilities.py',
             '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
-            'dom/EventAliases.in',
+            'events/EventAliases.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/blink/Event.cpp',
@@ -386,7 +386,7 @@
             'python',
             'scripts/make_event_factory.py',
             '<(SHARED_INTERMEDIATE_DIR)/blink/EventInterfaces.in',
-            'dom/EventAliases.in',
+            'events/EventAliases.in',
             '--output_dir',
             '<(SHARED_INTERMEDIATE_DIR)/blink',
           ],
@@ -397,7 +397,7 @@
             '<@(scripts_for_in_files)',
             'scripts/make_event_factory.py',
             'scripts/name_utilities.py',
-            'dom/EventTargetFactory.in',
+            'events/EventTargetFactory.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/blink/EventTargetHeaders.h',
@@ -406,7 +406,7 @@
           'action': [
             'python',
             'scripts/make_event_factory.py',
-            'dom/EventTargetFactory.in',
+            'events/EventTargetFactory.in',
             '--output_dir',
             '<(SHARED_INTERMEDIATE_DIR)/blink',
           ],
@@ -417,8 +417,8 @@
             'scripts/Hasher.pm',
             'scripts/StaticString.pm',
             'scripts/make_names.pl',
-            'mathml/mathtags.in',
-            'mathml/mathattrs.in',
+            'html/parser/MathMLTagNames.in',
+            'html/parser/MathMLAttributeNames.in',
           ],
           'outputs': [
             '<(SHARED_INTERMEDIATE_DIR)/blink/MathMLNames.cpp',
diff --git a/Source/core/css/CSSAspectRatioValue.h b/Source/core/css/CSSAspectRatioValue.h
index 15bbce3..0c4d70c 100644
--- a/Source/core/css/CSSAspectRatioValue.h
+++ b/Source/core/css/CSSAspectRatioValue.h
@@ -59,6 +59,8 @@
     float m_denominatorValue;
 };
 
+DEFINE_CSS_VALUE_TYPE_CASTS(AspectRatioValue);
+
 }
 
 #endif
diff --git a/Source/core/css/CSSBorderImageSliceValue.h b/Source/core/css/CSSBorderImageSliceValue.h
index 37c1354..e3cb0ec 100644
--- a/Source/core/css/CSSBorderImageSliceValue.h
+++ b/Source/core/css/CSSBorderImageSliceValue.h
@@ -56,6 +56,8 @@
     CSSBorderImageSliceValue(PassRefPtr<CSSPrimitiveValue> slices, bool fill);
 };
 
+DEFINE_CSS_VALUE_TYPE_CASTS(BorderImageSliceValue);
+
 } // namespace WebCore
 
 #endif // CSSBorderImageSliceValue_h
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 9be152f..37ef541 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -141,6 +141,7 @@
     CSSPropertyFontWeight,
     CSSPropertyHeight,
     CSSPropertyImageRendering,
+    CSSPropertyIsolation,
     CSSPropertyLeft,
     CSSPropertyLetterSpacing,
     CSSPropertyLineHeight,
@@ -156,6 +157,8 @@
     CSSPropertyMinHeight,
     CSSPropertyMinWidth,
     CSSPropertyMixBlendMode,
+    CSSPropertyObjectFit,
+    CSSPropertyObjectPosition,
     CSSPropertyOpacity,
     CSSPropertyOrphans,
     CSSPropertyOutlineColor,
@@ -286,9 +289,6 @@
     CSSPropertyWebkitLocale,
     CSSPropertyWebkitMarginBeforeCollapse,
     CSSPropertyWebkitMarginAfterCollapse,
-    CSSPropertyWebkitMarqueeIncrement,
-    CSSPropertyWebkitMarqueeRepetition,
-    CSSPropertyWebkitMarqueeStyle,
     CSSPropertyWebkitMaskBoxImage,
     CSSPropertyWebkitMaskBoxImageOutset,
     CSSPropertyWebkitMaskBoxImageRepeat,
@@ -521,7 +521,7 @@
         verticalRepeat = horizontalRepeat;
     else
         verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(image.verticalRule()));
-    return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), verticalRepeat.release()));
+    return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), verticalRepeat.release(), Pair::DropIdenticalValues));
 }
 
 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image, const RenderStyle* style)
@@ -2090,6 +2090,8 @@
             return cssValuePool().createIdentifierValue(CSSValueLines);
         case CSSPropertyImageRendering:
             return CSSPrimitiveValue::create(style->imageRendering());
+        case CSSPropertyIsolation:
+            return cssValuePool().createValue(style->isolation());
         case CSSPropertyLeft:
             return valueForPositionOffset(style.get(), CSSPropertyLeft, renderer, m_node->document().renderView());
         case CSSPropertyLetterSpacing:
@@ -2147,14 +2149,6 @@
                 return zoomAdjustedPixelValueForLength(marginLeft, style.get());
             return zoomAdjustedPixelValue(toRenderBox(renderer)->marginLeft(), style.get());
         }
-        case CSSPropertyWebkitMarqueeIncrement:
-            return cssValuePool().createValue(style->marqueeIncrement());
-        case CSSPropertyWebkitMarqueeRepetition:
-            if (style->marqueeLoopCount() < 0)
-                return cssValuePool().createIdentifierValue(CSSValueInfinite);
-            return cssValuePool().createValue(style->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER);
-        case CSSPropertyWebkitMarqueeStyle:
-            return cssValuePool().createValue(style->marqueeBehavior());
         case CSSPropertyWebkitUserModify:
             return cssValuePool().createValue(style->userModify());
         case CSSPropertyMaxHeight: {
@@ -2181,6 +2175,12 @@
             return zoomAdjustedPixelValueForLength(style->minWidth(), style.get());
         case CSSPropertyObjectFit:
             return cssValuePool().createValue(style->objectFit());
+        case CSSPropertyObjectPosition:
+            return cssValuePool().createValue(
+                Pair::create(
+                    cssValuePool().createValue(style->objectPosition().x()),
+                    cssValuePool().createValue(style->objectPosition().y()),
+                    Pair::KeepIdenticalValues));
         case CSSPropertyOpacity:
             return cssValuePool().createValue(style->opacity(), CSSPrimitiveValue::CSS_NUMBER);
         case CSSPropertyOrphans:
@@ -2885,7 +2885,6 @@
         /* Unimplemented -webkit- properties */
         case CSSPropertyWebkitBorderRadius:
         case CSSPropertyWebkitMarginCollapse:
-        case CSSPropertyWebkitMarqueeSpeed:
         case CSSPropertyWebkitMask:
         case CSSPropertyWebkitMaskRepeatX:
         case CSSPropertyWebkitMaskRepeatY:
@@ -2906,6 +2905,10 @@
 
         // Internal properties that shouldn't be exposed throught getComputedStyle.
         case CSSPropertyInternalMarqueeDirection:
+        case CSSPropertyInternalMarqueeIncrement:
+        case CSSPropertyInternalMarqueeRepetition:
+        case CSSPropertyInternalMarqueeSpeed:
+        case CSSPropertyInternalMarqueeStyle:
             ASSERT_NOT_REACHED();
             return 0;
 
diff --git a/Source/core/css/CSSCursorImageValue.cpp b/Source/core/css/CSSCursorImageValue.cpp
index 24caef7..65c42d8 100644
--- a/Source/core/css/CSSCursorImageValue.cpp
+++ b/Source/core/css/CSSCursorImageValue.cpp
@@ -122,7 +122,7 @@
 StyleImage* CSSCursorImageValue::cachedImage(ResourceFetcher* loader, float deviceScaleFactor)
 {
     if (m_imageValue->isImageSetValue())
-        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedImageSet(loader, deviceScaleFactor);
+        return toCSSImageSetValue(m_imageValue.get())->cachedImageSet(loader, deviceScaleFactor);
 
     if (!m_accessedImage) {
         m_accessedImage = true;
@@ -155,7 +155,7 @@
 {
     // Need to delegate completely so that changes in device scale factor can be handled appropriately.
     if (m_imageValue->isImageSetValue())
-        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedOrPendingImageSet(deviceScaleFactor);
+        return toCSSImageSetValue(m_imageValue.get())->cachedOrPendingImageSet(deviceScaleFactor);
 
     if (!m_image)
         m_image = StylePendingImage::create(this);
diff --git a/Source/core/css/CSSFontFaceLoadEvent.h b/Source/core/css/CSSFontFaceLoadEvent.h
index 84b674c..432dacf 100644
--- a/Source/core/css/CSSFontFaceLoadEvent.h
+++ b/Source/core/css/CSSFontFaceLoadEvent.h
@@ -33,8 +33,8 @@
 
 #include "core/css/FontFace.h"
 #include "core/dom/DOMError.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
 
diff --git a/Source/core/css/CSSFontFaceSource.cpp b/Source/core/css/CSSFontFaceSource.cpp
index 911f28e..7fe19c9 100644
--- a/Source/core/css/CSSFontFaceSource.cpp
+++ b/Source/core/css/CSSFontFaceSource.cpp
@@ -159,7 +159,7 @@
                 if (!m_externalSVGFontElement) {
                     String fragmentIdentifier;
                     size_t start = m_string.find('#');
-                    if (start != notFound)
+                    if (start != kNotFound)
                         fragmentIdentifier = m_string.string().substring(start + 1);
                     m_externalSVGFontElement = m_font->getSVGFontById(fragmentIdentifier);
                 }
diff --git a/Source/core/css/CSSGradientValue.cpp b/Source/core/css/CSSGradientValue.cpp
index 0c6e578..5b7ea0b 100644
--- a/Source/core/css/CSSGradientValue.cpp
+++ b/Source/core/css/CSSGradientValue.cpp
@@ -276,7 +276,7 @@
                 }
 
                 if (maxLengthForRepeat > gradientLength)
-                    maxExtent = maxLengthForRepeat / gradientLength;
+                    maxExtent = gradientLength > 0 ? maxLengthForRepeat / gradientLength : 0;
             }
 
             size_t originalNumStops = numStops;
diff --git a/Source/core/css/CSSImageSetValue.h b/Source/core/css/CSSImageSetValue.h
index 7f5a377..37f59b6 100644
--- a/Source/core/css/CSSImageSetValue.h
+++ b/Source/core/css/CSSImageSetValue.h
@@ -81,6 +81,8 @@
     Vector<ImageWithScale> m_imagesInSet;
 };
 
+DEFINE_CSS_VALUE_TYPE_CASTS(ImageSetValue);
+
 } // namespace WebCore
 
 #endif // CSSImageSetValue_h
diff --git a/Source/core/css/CSSMatrix.cpp b/Source/core/css/CSSMatrix.cpp
index 7866dd9..780feab 100644
--- a/Source/core/css/CSSMatrix.cpp
+++ b/Source/core/css/CSSMatrix.cpp
@@ -70,7 +70,7 @@
 
         TransformOperations operations;
         if (!TransformBuilder::createTransformOperations(value.get(), 0, 0, operations)) {
-            es.throwDOMException(SyntaxError);
+            es.throwUninformativeAndGenericDOMException(SyntaxError);
             return;
         }
 
@@ -79,7 +79,7 @@
         TransformationMatrix t;
         for (unsigned i = 0; i < operations.operations().size(); ++i) {
             if (operations.operations()[i].get()->apply(t, IntSize(0, 0))) {
-                es.throwDOMException(SyntaxError);
+                es.throwUninformativeAndGenericDOMException(SyntaxError);
                 return;
             }
         }
@@ -87,7 +87,7 @@
         // set the matrix
         m_matrix = t;
     } else { // There is something there but parsing failed.
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
     }
 }
 
@@ -103,7 +103,7 @@
 PassRefPtr<CSSMatrix> CSSMatrix::inverse(ExceptionState& es) const
 {
     if (!m_matrix.isInvertible()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
diff --git a/Source/core/css/CSSParser-in.cpp b/Source/core/css/CSSParser-in.cpp
index 889de86..118d8a1 100644
--- a/Source/core/css/CSSParser-in.cpp
+++ b/Source/core/css/CSSParser-in.cpp
@@ -145,9 +145,9 @@
     return false;
 }
 
-static PassRefPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second)
+static PassRefPtr<CSSPrimitiveValue> createPrimitiveValuePair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, Pair::IdenticalValuesPolicy identicalValuesPolicy = Pair::DropIdenticalValues)
 {
-    return cssValuePool().createValue(Pair::create(first, second));
+    return cssValuePool().createValue(Pair::create(first, second, identicalValuesPolicy));
 }
 
 class AnimationParseContext {
@@ -300,10 +300,10 @@
 void CSSParserString::trimTrailingWhitespace()
 {
     if (is8Bit()) {
-        while (m_length > 0 && isHTMLSpace(m_data.characters8[m_length - 1]))
+        while (m_length > 0 && isHTMLSpace<LChar>(m_data.characters8[m_length - 1]))
             --m_length;
     } else {
-        while (m_length > 0 && isHTMLSpace(m_data.characters16[m_length - 1]))
+        while (m_length > 0 && isHTMLSpace<UChar>(m_data.characters16[m_length - 1]))
             --m_length;
     }
 }
@@ -637,6 +637,10 @@
         if (valueID == CSSValueAuto || valueID == CSSValueWebkitOptimizeContrast)
             return true;
         break;
+    case CSSPropertyIsolation: // auto | isolate
+        if (valueID == CSSValueAuto || valueID == CSSValueIsolate)
+            return RuntimeEnabledFeatures::cssCompositingEnabled();
+        break;
     case CSSPropertyListStylePosition: // inside | outside | inherit
         if (valueID == CSSValueInside || valueID == CSSValueOutside)
             return true;
@@ -847,7 +851,7 @@
             || valueID == CSSValueUp || valueID == CSSValueAuto)
             return true;
         break;
-    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyInternalMarqueeStyle:
         if (valueID == CSSValueNone || valueID == CSSValueSlide || valueID == CSSValueScroll || valueID == CSSValueAlternate)
             return true;
         break;
@@ -942,6 +946,7 @@
 {
     switch (propertyId) {
     case CSSPropertyMixBlendMode:
+    case CSSPropertyIsolation:
         return RuntimeEnabledFeatures::cssCompositingEnabled();
     case CSSPropertyTextAlignLast:
         return RuntimeEnabledFeatures::css3TextEnabled();
@@ -1019,7 +1024,7 @@
     case CSSPropertyWebkitMarginBottomCollapse:
     case CSSPropertyWebkitMarginTopCollapse:
     case CSSPropertyInternalMarqueeDirection:
-    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyInternalMarqueeStyle:
     case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRegionBreakAfter:
     case CSSPropertyWebkitRegionBreakBefore:
@@ -1087,7 +1092,7 @@
 {
     while (expectedCount) {
         size_t end = WTF::find(characters, length, expectedCount == 1 ? ')' : ',', start);
-        if (end == notFound || (expectedCount == 1 && end != length - 1))
+        if (end == kNotFound || (expectedCount == 1 && end != length - 1))
             return false;
         unsigned argumentLength = end - start;
         CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER;
@@ -1209,9 +1214,8 @@
 {
     // FIXME: Check RuntimeCSSEnabled::isPropertyEnabled or isValueEnabledForProperty.
 
-    // We don't count the UA style sheet in our statistics.
-    if (m_context.mode != UASheetMode && m_useCounter)
-        m_useCounter->count(propertyID);
+    if (m_useCounter)
+        m_useCounter->count(m_context, propertyID);
 
     setStyleSheet(contextStyleSheet);
 
@@ -1694,8 +1698,8 @@
         return false;
 
     // We don't count the UA style sheet in our statistics.
-    if (m_context.mode != UASheetMode && m_useCounter)
-        m_useCounter->count(propId);
+    if (m_useCounter)
+        m_useCounter->count(m_context, propId);
 
     if (!m_valueList)
         return false;
@@ -2000,6 +2004,8 @@
         m_implicitShorthand = false;
         return result;
     }
+    case CSSPropertyObjectPosition:
+        return RuntimeEnabledFeatures::objectFitPositionEnabled() && parseObjectPosition(important);
     case CSSPropertyListStyleImage:     // <uri> | none | inherit
     case CSSPropertyBorderImageSource:
     case CSSPropertyWebkitMaskBoxImageSource:
@@ -2322,9 +2328,9 @@
         }
         break;
     case CSSPropertyMixBlendMode:
+    case CSSPropertyIsolation:
         if (!RuntimeEnabledFeatures::cssCompositingEnabled())
             return false;
-
         validPrimitive = true;
         break;
     case CSSPropertyFlex: {
@@ -2360,19 +2366,19 @@
             }
         }
         break;
-    case CSSPropertyWebkitMarqueeIncrement:
+    case CSSPropertyInternalMarqueeIncrement:
         if (id == CSSValueSmall || id == CSSValueLarge || id == CSSValueMedium)
             validPrimitive = true;
         else
             validPrimitive = validUnit(value, FLength | FPercent);
         break;
-    case CSSPropertyWebkitMarqueeRepetition:
+    case CSSPropertyInternalMarqueeRepetition:
         if (id == CSSValueInfinite)
             validPrimitive = true;
         else
             validPrimitive = validUnit(value, FInteger | FNonNeg);
         break;
-    case CSSPropertyWebkitMarqueeSpeed:
+    case CSSPropertyInternalMarqueeSpeed:
         if (id == CSSValueNormal || id == CSSValueSlow || id == CSSValueFast)
             validPrimitive = true;
         else
@@ -2862,7 +2868,7 @@
     case CSSPropertyWebkitMarginBottomCollapse:
     case CSSPropertyWebkitMarginTopCollapse:
     case CSSPropertyInternalMarqueeDirection:
-    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyInternalMarqueeStyle:
     case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRegionBreakAfter:
     case CSSPropertyWebkitRegionBreakBefore:
@@ -5936,7 +5942,7 @@
     const CharacterType* current = string;
     double localValue = 0;
     bool negative = false;
-    while (current != end && isHTMLSpace(*current))
+    while (current != end && isHTMLSpace<CharacterType>(*current))
         current++;
     if (current != end && *current == '-') {
         negative = true;
@@ -5988,7 +5994,7 @@
     } else
         expect = CSSPrimitiveValue::CSS_NUMBER;
 
-    while (current != end && isHTMLSpace(*current))
+    while (current != end && isHTMLSpace<CharacterType>(*current))
         current++;
     if (current == end || *current++ != terminator)
         return false;
@@ -6015,7 +6021,7 @@
 template <typename CharacterType>
 static inline bool parseAlphaValue(const CharacterType*& string, const CharacterType* end, const char terminator, int& value)
 {
-    while (string != end && isHTMLSpace(*string))
+    while (string != end && isHTMLSpace<CharacterType>(*string))
         string++;
 
     bool negative = false;
@@ -6626,6 +6632,20 @@
     return true;
 }
 
+bool CSSParser::parseObjectPosition(bool important)
+{
+    RefPtr<CSSValue> xValue;
+    RefPtr<CSSValue> yValue;
+    parseFillPosition(m_valueList.get(), xValue, yValue);
+    if (!xValue || !yValue)
+        return false;
+    addProperty(
+        CSSPropertyObjectPosition,
+        createPrimitiveValuePair(toCSSPrimitiveValue(xValue.get()), toCSSPrimitiveValue(yValue.get()), Pair::KeepIdenticalValues),
+        important);
+    return true;
+}
+
 struct BorderImageParseContext {
     BorderImageParseContext()
     : m_canAdvance(false)
@@ -9632,7 +9652,7 @@
         } while (isASCIIHexDigit(*currentCharacter) && --length);
 
         // Optional space after the escape sequence.
-        if (isHTMLSpace(*currentCharacter))
+        if (isHTMLSpace<CharacterType>(*currentCharacter))
             ++currentCharacter;
         return currentCharacter;
     }
@@ -9642,7 +9662,7 @@
 template <typename CharacterType>
 static inline CharacterType* skipWhiteSpace(CharacterType* currentCharacter)
 {
-    while (isHTMLSpace(*currentCharacter))
+    while (isHTMLSpace<CharacterType>(*currentCharacter))
         ++currentCharacter;
     return currentCharacter;
 }
@@ -9788,7 +9808,7 @@
             unicode = 0xfffd;
 
         // Optional space after the escape sequence.
-        if (isHTMLSpace(*src))
+        if (isHTMLSpace<CharacterType>(*src))
             ++src;
 
         return unicode;
diff --git a/Source/core/css/CSSParser.h b/Source/core/css/CSSParser.h
index 6d0e270..a63df8f 100644
--- a/Source/core/css/CSSParser.h
+++ b/Source/core/css/CSSParser.h
@@ -239,6 +239,8 @@
 
     bool parseFlex(CSSParserValueList* args, bool important);
 
+    bool parseObjectPosition(bool important);
+
     // Image generators
     bool parseCanvas(CSSParserValueList*, RefPtr<CSSValue>&);
 
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 9a5741e..fa13eda 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -629,7 +629,7 @@
     // Keeping values immutable makes optimizations easier and allows sharing of the primitive value objects.
     // No other engine supports mutating style through this API. Computed style is always read-only anyway.
     // Supporting setter would require making primitive value copy-on-write and taking care of style invalidation.
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(unsigned short unitType)
@@ -689,7 +689,7 @@
     double result = 0;
     bool success = getDoubleValueInternal(static_cast<UnitTypes>(unitType), &result);
     if (!success) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0.0;
     }
 
@@ -789,7 +789,7 @@
     // Keeping values immutable makes optimizations easier and allows sharing of the primitive value objects.
     // No other engine supports mutating style through this API. Computed style is always read-only anyway.
     // Supporting setter would require making primitive value copy-on-write and taking care of style invalidation.
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 String CSSPrimitiveValue::getStringValue(ExceptionState& es) const
@@ -805,7 +805,7 @@
         case CSS_PROPERTY_ID:
             return propertyName(m_value.propertyID);
         default:
-            es.throwDOMException(InvalidAccessError);
+            es.throwUninformativeAndGenericDOMException(InvalidAccessError);
             break;
     }
 
@@ -834,7 +834,7 @@
 Counter* CSSPrimitiveValue::getCounterValue(ExceptionState& es) const
 {
     if (m_primitiveUnitType != CSS_COUNTER) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -844,7 +844,7 @@
 Rect* CSSPrimitiveValue::getRectValue(ExceptionState& es) const
 {
     if (m_primitiveUnitType != CSS_RECT) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -854,7 +854,7 @@
 Quad* CSSPrimitiveValue::getQuadValue(ExceptionState& es) const
 {
     if (m_primitiveUnitType != CSS_QUAD) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -864,7 +864,7 @@
 PassRefPtr<RGBColor> CSSPrimitiveValue::getRGBColorValue(ExceptionState& es) const
 {
     if (m_primitiveUnitType != CSS_RGBCOLOR) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -875,7 +875,7 @@
 Pair* CSSPrimitiveValue::getPairValue(ExceptionState& es) const
 {
     if (m_primitiveUnitType != CSS_PAIR) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 418f87d..0de35fd 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -4826,6 +4826,36 @@
     return TouchActionNone;
 }
 
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EIsolation i)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (i) {
+    case IsolationAuto:
+        m_value.valueID = CSSValueAuto;
+        break;
+    case IsolationIsolate:
+        m_value.valueID = CSSValueIsolate;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator EIsolation() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValueAuto:
+        return IsolationAuto;
+    case CSSValueIsolate:
+        return IsolationIsolate;
+    default:
+        break;
+    }
+
+    ASSERT_NOT_REACHED();
+    return IsolationAuto;
+}
+
 }
 
 #endif
diff --git a/Source/core/css/CSSProperties.in b/Source/core/css/CSSProperties.in
index 3af1522..4bcc442 100644
--- a/Source/core/css/CSSProperties.in
+++ b/Source/core/css/CSSProperties.in
@@ -65,6 +65,7 @@
 height type_name=Length, initial=initialSize, converter=convertLengthSizing
 justify-content
 image-rendering
+isolation
 left type_name=Length, initial=initialOffset, converter=convertLengthOrAuto
 letter-spacing type_name=float, initial=initialLetterWordSpacing, converter=convertSpacing
 line-height getter=specifiedLineHeight, custom_value
@@ -82,6 +83,7 @@
 min-width type_name=Length, initial=initialMinSize, converter=convertLengthSizing
 mix-blend-mode type_name=BlendMode, name_for_methods=BlendMode
 object-fit type_name=ObjectFit
+object-position type_name=LengthPoint, initial=initialObjectPosition, converter=convertLengthPoint
 opacity type_name=float
 order type_name=int
 orphans type_name=short, custom_all
@@ -190,10 +192,10 @@
 -webkit-margin-bottom-collapse type_name=EMarginCollapse, name_for_methods=MarginAfterCollapse
 -webkit-margin-top-collapse type_name=EMarginCollapse, name_for_methods=MarginBeforeCollapse
 -internal-marquee-direction type_name=EMarqueeDirection, name_for_methods=MarqueeDirection
--webkit-marquee-increment custom_value
--webkit-marquee-repetition type_name=int, name_for_methods=MarqueeLoopCount, custom_value
--webkit-marquee-speed custom_value
--webkit-marquee-style name_for_methods=MarqueeBehavior
+-internal-marquee-increment custom_value, name_for_methods=MarqueeIncrement
+-internal-marquee-repetition type_name=int, name_for_methods=MarqueeLoopCount, custom_value
+-internal-marquee-speed custom_value, name_for_methods=MarqueeSpeed
+-internal-marquee-style name_for_methods=MarqueeBehavior
 -webkit-mask-box-image initial=initialNinePieceImage, custom_value
 -webkit-mask-box-image-outset custom_all
 -webkit-mask-box-image-repeat custom_all
diff --git a/Source/core/css/CSSProperty.cpp b/Source/core/css/CSSProperty.cpp
index 9097f0e..56e95f1 100644
--- a/Source/core/css/CSSProperty.cpp
+++ b/Source/core/css/CSSProperty.cpp
@@ -437,6 +437,7 @@
     case CSSPropertyFloodOpacity:
     case CSSPropertyFontStretch:
     case CSSPropertyHeight:
+    case CSSPropertyIsolation:
     case CSSPropertyLeft:
     case CSSPropertyLightingColor:
     case CSSPropertyMargin:
@@ -453,6 +454,7 @@
     case CSSPropertyMinWidth:
     case CSSPropertyMixBlendMode:
     case CSSPropertyObjectFit:
+    case CSSPropertyObjectPosition:
     case CSSPropertyOpacity:
     case CSSPropertyOutline:
     case CSSPropertyOutlineColor:
@@ -606,11 +608,11 @@
     case CSSPropertyWebkitMarginStart:
     case CSSPropertyWebkitMarginTopCollapse:
     case CSSPropertyInternalMarqueeDirection:
-    case CSSPropertyWebkitMarqueeIncrement:
-    case CSSPropertyWebkitMarqueeRepetition:
-    case CSSPropertyWebkitMarqueeSpeed:
+    case CSSPropertyInternalMarqueeIncrement:
+    case CSSPropertyInternalMarqueeRepetition:
+    case CSSPropertyInternalMarqueeSpeed:
     case CSSPropertyOrder:
-    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyInternalMarqueeStyle:
     case CSSPropertyWebkitMask:
     case CSSPropertyWebkitMaskBoxImage:
     case CSSPropertyWebkitMaskBoxImageOutset:
diff --git a/Source/core/css/CSSPropertyNames.in b/Source/core/css/CSSPropertyNames.in
index c58da6b..2f88d93 100644
--- a/Source/core/css/CSSPropertyNames.in
+++ b/Source/core/css/CSSPropertyNames.in
@@ -135,6 +135,7 @@
 font-stretch
 height
 image-rendering
+isolation
 left
 letter-spacing
 list-style
@@ -163,6 +164,7 @@
 outline-style
 outline-width
 object-fit
+object-position
 overflow
 overflow-wrap
 overflow-x
@@ -339,10 +341,6 @@
 -webkit-margin-before
 -webkit-margin-end
 -webkit-margin-start
--webkit-marquee-increment
--webkit-marquee-repetition
--webkit-marquee-speed
--webkit-marquee-style
 -webkit-mask
 -webkit-mask-box-image
 -webkit-mask-box-image-outset
@@ -424,3 +422,7 @@
 
 // Internal properties.
 -internal-marquee-direction
+-internal-marquee-increment
+-internal-marquee-repetition
+-internal-marquee-speed
+-internal-marquee-style
diff --git a/Source/core/css/CSSReflectValue.h b/Source/core/css/CSSReflectValue.h
index 91ca5cd..1f5e4c3 100644
--- a/Source/core/css/CSSReflectValue.h
+++ b/Source/core/css/CSSReflectValue.h
@@ -67,6 +67,8 @@
     RefPtr<CSSValue> m_mask;
 };
 
+DEFINE_CSS_VALUE_TYPE_CASTS(ReflectValue);
+
 } // namespace WebCore
 
 #endif // CSSReflectValue_h
diff --git a/Source/core/css/CSSSelector.cpp b/Source/core/css/CSSSelector.cpp
index a0cc26e..e970247 100644
--- a/Source/core/css/CSSSelector.cpp
+++ b/Source/core/css/CSSSelector.cpp
@@ -889,7 +889,7 @@
         m_b = 0;
     } else {
         size_t n = argument.find('n');
-        if (n != notFound) {
+        if (n != kNotFound) {
             if (argument[0] == '-') {
                 if (n == 1)
                     m_a = -1; // -n == -1n
@@ -901,11 +901,11 @@
                 m_a = argument.substring(0, n).toInt();
 
             size_t p = argument.find('+', n);
-            if (p != notFound)
+            if (p != kNotFound)
                 m_b = argument.substring(p + 1, argument.length() - p - 1).toInt();
             else {
                 p = argument.find('-', n);
-                if (p != notFound)
+                if (p != kNotFound)
                     m_b = -argument.substring(p + 1, argument.length() - p - 1).toInt();
             }
         } else
diff --git a/Source/core/css/CSSSelectorList.h b/Source/core/css/CSSSelectorList.h
index 060082b..562e649 100644
--- a/Source/core/css/CSSSelectorList.h
+++ b/Source/core/css/CSSSelectorList.h
@@ -54,7 +54,7 @@
         const CSSSelector* current = selectorAt(index);
         current = next(current);
         if (!current)
-            return notFound;
+            return kNotFound;
         return current - m_selectorArray;
     }
 
diff --git a/Source/core/css/CSSStyleSheet.cpp b/Source/core/css/CSSStyleSheet.cpp
index 1f6e6e7..05e3b21 100644
--- a/Source/core/css/CSSStyleSheet.cpp
+++ b/Source/core/css/CSSStyleSheet.cpp
@@ -250,21 +250,21 @@
     ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size() == m_contents->ruleCount());
 
     if (index > length()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
     CSSParser p(m_contents->parserContext(), UseCounter::getFrom(this));
     RefPtr<StyleRuleBase> rule = p.parseRule(m_contents.get(), ruleString);
 
     if (!rule) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
     RuleMutationScope mutationScope(this);
 
     bool success = m_contents->wrapperInsertRule(rule, index);
     if (!success) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return 0;
     }
     if (!m_childRuleCSSOMWrappers.isEmpty())
@@ -278,7 +278,7 @@
     ASSERT(m_childRuleCSSOMWrappers.isEmpty() || m_childRuleCSSOMWrappers.size() == m_contents->ruleCount());
 
     if (index >= length()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
     RuleMutationScope mutationScope(this);
diff --git a/Source/core/css/CSSToStyleMap.cpp b/Source/core/css/CSSToStyleMap.cpp
index 8a96e56..0ccfbf4 100644
--- a/Source/core/css/CSSToStyleMap.cpp
+++ b/Source/core/css/CSSToStyleMap.cpp
@@ -595,7 +595,7 @@
         return;
 
     // Retrieve the border image value.
-    CSSBorderImageSliceValue* borderImageSlice = static_cast<CSSBorderImageSliceValue*>(value);
+    CSSBorderImageSliceValue* borderImageSlice = toCSSBorderImageSliceValue(value);
 
     // Set up a length box to represent our image slices.
     LengthBox box;
diff --git a/Source/core/css/CSSValue.cpp b/Source/core/css/CSSValue.cpp
index 1ffc0b1..c32bab7 100644
--- a/Source/core/css/CSSValue.cpp
+++ b/Source/core/css/CSSValue.cpp
@@ -340,10 +340,10 @@
 
     switch (classType()) {
     case AspectRatioClass:
-        delete static_cast<CSSAspectRatioValue*>(this);
+        delete toCSSAspectRatioValue(this);
         return;
     case BorderImageSliceClass:
-        delete static_cast<CSSBorderImageSliceValue*>(this);
+        delete toCSSBorderImageSliceValue(this);
         return;
     case CanvasClass:
         delete static_cast<CSSCanvasValue*>(this);
@@ -388,7 +388,7 @@
         delete toCSSPrimitiveValue(this);
         return;
     case ReflectClass:
-        delete static_cast<CSSReflectValue*>(this);
+        delete toCSSReflectValue(this);
         return;
     case ShadowClass:
         delete static_cast<ShadowValue*>(this);
@@ -415,7 +415,7 @@
         delete static_cast<CSSCalcValue*>(this);
         return;
     case ImageSetClass:
-        delete static_cast<CSSImageSetValue*>(this);
+        delete toCSSImageSetValue(this);
         return;
     case CSSFilterClass:
         delete static_cast<CSSFilterValue*>(this);
diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
index a92bc86..d62f81e 100644
--- a/Source/core/css/CSSValue.h
+++ b/Source/core/css/CSSValue.h
@@ -237,6 +237,20 @@
     return first ? second && first->equals(*second) : !second;
 }
 
+#define DEFINE_CSS_VALUE_TYPE_CASTS(ValueTypeName) \
+inline const CSS##ValueTypeName* toCSS##ValueTypeName(const CSSValue* value) \
+{ \
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \
+    return static_cast<const CSS##ValueTypeName*>(value); \
+} \
+inline CSS##ValueTypeName* toCSS##ValueTypeName(CSSValue* value) \
+{ \
+    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->is##ValueTypeName()); \
+    return static_cast<CSS##ValueTypeName*>(value); \
+} \
+void toCSS##ValueTypeName(const CSS##ValueTypeName*); \
+void toCSS##ValueTypeName(const CSS##ValueTypeName&)
+
 } // namespace WebCore
 
 #endif // CSSValue_h
diff --git a/Source/core/css/CSSValueKeywords.in b/Source/core/css/CSSValueKeywords.in
index 198b18e..f4bc3ca 100644
--- a/Source/core/css/CSSValueKeywords.in
+++ b/Source/core/css/CSSValueKeywords.in
@@ -838,11 +838,6 @@
 // -webkit-hyphenate-limit-lines
 no-limit
 
-// -webkit-hyphens
-// none
-manual
-// auto
-
 // -webkit-writing-mode
 // SVG compatibility
 lr
@@ -997,3 +992,7 @@
 // CSS3 viewport-length keywords
 //
 -internal-extend-to-zoom
+
+// isolation
+// auto
+isolate
diff --git a/Source/core/css/CSSValueList.h b/Source/core/css/CSSValueList.h
index eee33ca..acee25a 100644
--- a/Source/core/css/CSSValueList.h
+++ b/Source/core/css/CSSValueList.h
@@ -81,20 +81,7 @@
     Vector<RefPtr<CSSValue>, 4> m_values;
 };
 
-inline CSSValueList* toCSSValueList(CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isValueList());
-    return static_cast<CSSValueList*>(value);
-}
-
-inline const CSSValueList* toCSSValueList(const CSSValue* value)
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(!value || value->isValueList());
-    return static_cast<const CSSValueList*>(value);
-}
-
-// Catch unneeded cast.
-void toCSSValueList(const CSSValueList*);
+DEFINE_CSS_VALUE_TYPE_CASTS(ValueList);
 
 // Objects of this class are intended to be stack-allocated and scoped to a single function.
 // Please take care not to pass these around as they do hold onto a raw pointer.
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index d1d3896..98a3f07 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -65,7 +65,7 @@
 {
     RefPtr<CSSValue> src = parseCSSValue(source, CSSPropertySrc);
     if (!src || !src->isValueList()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -208,7 +208,7 @@
 {
     RefPtr<CSSValue> value = parseCSSValue(s, propertyID);
     if (!value || !setPropertyValue(value, propertyID))
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
 }
 
 bool FontFace::setPropertyFromStyle(const StylePropertySet* properties, CSSPropertyID propertyID)
diff --git a/Source/core/css/FontFaceSet.cpp b/Source/core/css/FontFaceSet.cpp
index c9838d2..d241d24 100644
--- a/Source/core/css/FontFaceSet.cpp
+++ b/Source/core/css/FontFaceSet.cpp
@@ -343,7 +343,7 @@
 
     Font font;
     if (!resolveFontStyle(fontString, font)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return matchedFonts;
     }
 
@@ -360,7 +360,7 @@
     // FIXME: The second parameter (text) is ignored.
     Font font;
     if (!resolveFontStyle(fontString, font)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return ScriptPromise();
     }
 
@@ -382,7 +382,7 @@
     // FIXME: The second parameter (text) is ignored.
     Font font;
     if (!resolveFontStyle(fontString, font)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return false;
     }
 
diff --git a/Source/core/css/FontFaceSet.h b/Source/core/css/FontFaceSet.h
index fdc2b3a..11ad874 100644
--- a/Source/core/css/FontFaceSet.h
+++ b/Source/core/css/FontFaceSet.h
@@ -29,9 +29,9 @@
 #include "bindings/v8/ScriptPromise.h"
 #include "core/css/FontFace.h"
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "core/platform/Timer.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/css/MediaList.cpp b/Source/core/css/MediaList.cpp
index 607ca4a..fdc4b36 100644
--- a/Source/core/css/MediaList.cpp
+++ b/Source/core/css/MediaList.cpp
@@ -202,7 +202,7 @@
 
     bool success = m_mediaQueries->remove(medium);
     if (!success) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
     if (m_parentStyleSheet)
@@ -215,7 +215,7 @@
 
     bool success = m_mediaQueries->add(medium);
     if (!success) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return;
     }
 
diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp
index bf07d2d..01800e4 100644
--- a/Source/core/css/MediaQueryEvaluator.cpp
+++ b/Source/core/css/MediaQueryEvaluator.cpp
@@ -172,7 +172,7 @@
 static bool compareAspectRatioValue(CSSValue* value, int width, int height, MediaFeaturePrefix op)
 {
     if (value->isAspectRatioValue()) {
-        CSSAspectRatioValue* aspectRatio = static_cast<CSSAspectRatioValue*>(value);
+        CSSAspectRatioValue* aspectRatio = toCSSAspectRatioValue(value);
         return compareValue(width * static_cast<int>(aspectRatio->denominatorValue()), height * static_cast<int>(aspectRatio->numeratorValue()), op);
     }
 
diff --git a/Source/core/css/MediaQueryMatcher.cpp b/Source/core/css/MediaQueryMatcher.cpp
index 0d3e7c40..1d16128 100644
--- a/Source/core/css/MediaQueryMatcher.cpp
+++ b/Source/core/css/MediaQueryMatcher.cpp
@@ -142,7 +142,7 @@
 {
     ASSERT(m_document);
 
-    ScriptState* scriptState = mainWorldScriptState(m_document->frame());
+    ScriptState* scriptState = m_document->frame() ? mainWorldScriptState(m_document->frame()) : 0;
     if (!scriptState)
         return;
 
diff --git a/Source/core/css/Pair.h b/Source/core/css/Pair.h
index b4446b3..2c1940f 100644
--- a/Source/core/css/Pair.h
+++ b/Source/core/css/Pair.h
@@ -34,52 +34,69 @@
 // it (eliminating some extra -webkit- internal properties).
 class Pair : public RefCounted<Pair> {
 public:
+    enum IdenticalValuesPolicy { DropIdenticalValues, KeepIdenticalValues };
+
     static PassRefPtr<Pair> create()
     {
         return adoptRef(new Pair);
     }
-    static PassRefPtr<Pair> create(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second)
+    static PassRefPtr<Pair> create(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, IdenticalValuesPolicy identicalValuesPolicy)
     {
-        return adoptRef(new Pair(first, second));
+        return adoptRef(new Pair(first, second, identicalValuesPolicy));
     }
     virtual ~Pair() { }
 
     CSSPrimitiveValue* first() const { return m_first.get(); }
     CSSPrimitiveValue* second() const { return m_second.get(); }
+    IdenticalValuesPolicy identicalValuesPolicy() const { return m_identicalValuesPolicy; }
 
     void setFirst(PassRefPtr<CSSPrimitiveValue> first) { m_first = first; }
     void setSecond(PassRefPtr<CSSPrimitiveValue> second) { m_second = second; }
+    void setIdenticalValuesPolicy(IdenticalValuesPolicy identicalValuesPolicy) { m_identicalValuesPolicy = identicalValuesPolicy; }
 
     String cssText() const
     {
-
-        return generateCSSString(first()->cssText(), second()->cssText());
+        return generateCSSString(first()->cssText(), second()->cssText(), m_identicalValuesPolicy);
     }
 
-    bool equals(const Pair& other) const { return compareCSSValuePtr(m_first, other.m_first) && compareCSSValuePtr(m_second, other.m_second); }
+    bool equals(const Pair& other) const
+    {
+        return compareCSSValuePtr(m_first, other.m_first)
+            && compareCSSValuePtr(m_second, other.m_second)
+            && m_identicalValuesPolicy == other.m_identicalValuesPolicy;
+    }
 
     String serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
     {
-        return generateCSSString(first()->customSerializeResolvingVariables(variables),
-                                 second()->customSerializeResolvingVariables(variables));
+        return generateCSSString(
+            first()->customSerializeResolvingVariables(variables),
+            second()->customSerializeResolvingVariables(variables),
+            m_identicalValuesPolicy);
     }
 
     bool hasVariableReference() const { return first()->hasVariableReference() || second()->hasVariableReference(); }
 
 private:
-    Pair() : m_first(0), m_second(0) { }
-    Pair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second)
-        : m_first(first), m_second(second) { }
+    Pair()
+        : m_first(0)
+        , m_second(0)
+        , m_identicalValuesPolicy(DropIdenticalValues) { }
 
-    static String generateCSSString(const String& first, const String& second)
+    Pair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second, IdenticalValuesPolicy identicalValuesPolicy)
+        : m_first(first)
+        , m_second(second)
+        , m_identicalValuesPolicy(identicalValuesPolicy) { }
+
+    static String generateCSSString(const String& first, const String& second, IdenticalValuesPolicy identicalValuesPolicy)
     {
-        if (first == second)
+        if (identicalValuesPolicy == DropIdenticalValues && first == second)
             return first;
         return first + ' ' + second;
     }
 
     RefPtr<CSSPrimitiveValue> m_first;
     RefPtr<CSSPrimitiveValue> m_second;
+    IdenticalValuesPolicy m_identicalValuesPolicy;
 };
 
 } // namespace
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index 64107b4..900dc36 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -212,7 +212,7 @@
     if (!propertyID)
         return;
 
-    bool important = priority.find("important", 0, false) != notFound;
+    bool important = priority.find("important", 0, false) != kNotFound;
 
     willMutate();
 
diff --git a/Source/core/css/RuleSet.cpp b/Source/core/css/RuleSet.cpp
index 2ffda78..87fd2dc 100644
--- a/Source/core/css/RuleSet.cpp
+++ b/Source/core/css/RuleSet.cpp
@@ -359,7 +359,7 @@
             StyleRule* styleRule = static_cast<StyleRule*>(rule);
 
             const CSSSelectorList& selectorList = styleRule->selectorList();
-            for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
+            for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
                 if (selectorList.hasShadowDistributedAt(selectorIndex)) {
                     if (isDocumentScope(scope))
                         continue;
@@ -423,7 +423,7 @@
 
 void RuleSet::addStyleRule(StyleRule* rule, AddRuleFlags addRuleFlags)
 {
-    for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIndex = rule->selectorList().indexOfNextSelectorAfter(selectorIndex))
+    for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = rule->selectorList().indexOfNextSelectorAfter(selectorIndex))
         addRule(rule, selectorIndex, addRuleFlags);
 }
 
diff --git a/Source/core/css/SelectorChecker.cpp b/Source/core/css/SelectorChecker.cpp
index 6837ffd..80222e1 100644
--- a/Source/core/css/SelectorChecker.cpp
+++ b/Source/core/css/SelectorChecker.cpp
@@ -297,7 +297,7 @@
 static inline bool containsHTMLSpace(const AtomicString& string)
 {
     for (unsigned i = 0; i < string.length(); i++)
-        if (isHTMLSpace(string[i]))
+        if (isHTMLSpace<UChar>(string[i]))
             return true;
     return false;
 }
@@ -322,11 +322,11 @@
             unsigned startSearchAt = 0;
             while (true) {
                 size_t foundPos = value.find(selectorValue, startSearchAt, caseSensitive);
-                if (foundPos == notFound)
+                if (foundPos == kNotFound)
                     return false;
-                if (!foundPos || isHTMLSpace(value[foundPos - 1])) {
+                if (!foundPos || isHTMLSpace<UChar>(value[foundPos - 1])) {
                     unsigned endStr = foundPos + selectorValue.length();
-                    if (endStr == value.length() || isHTMLSpace(value[endStr]))
+                    if (endStr == value.length() || isHTMLSpace<UChar>(value[endStr]))
                         break; // We found a match.
                 }
 
diff --git a/Source/core/css/StyleInvalidationAnalysis.cpp b/Source/core/css/StyleInvalidationAnalysis.cpp
index ab0389d..6fa9e01 100644
--- a/Source/core/css/StyleInvalidationAnalysis.cpp
+++ b/Source/core/css/StyleInvalidationAnalysis.cpp
@@ -80,7 +80,7 @@
 
         const StyleRule* styleRule = toStyleRule(rule);
         const CSSSelectorList& selectorList = styleRule->selectorList();
-        for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
+        for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) {
             if (selectorList.hasShadowDistributedAt(selectorIndex))
                 return true;
         }
@@ -149,7 +149,7 @@
             m_dirtiesAllStyle = true;
             return;
         }
-        StyleRule* styleRule = static_cast<StyleRule*>(rule);
+        StyleRule* styleRule = toStyleRule(rule);
         if (!determineSelectorScopes(styleRule->selectorList(), m_idScopes, m_classScopes)) {
             m_dirtiesAllStyle = true;
             return;
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index 8df65b8..d19d158 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -50,6 +50,7 @@
 
 PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
 {
+    ASSERT(count <= MaxArraySize);
     void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCount(count));
     return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssParserMode));
 }
@@ -138,7 +139,7 @@
 {
     ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
     size_t index = findVariableIndex(name);
-    if (index == notFound)
+    if (index == kNotFound)
         return String();
     return toCSSVariableValue(propertyAt(index).value())->value();
 }
@@ -284,14 +285,14 @@
         return removeVariable(name);
 
     size_t index = findVariableIndex(name);
-    if (index != notFound) {
+    if (index != kNotFound) {
         CSSValue* cssValue = m_propertyVector.at(index).value();
         if (toCSSVariableValue(cssValue)->value() == value)
             return false;
     }
 
     CSSProperty property(CSSPropertyVariable, CSSVariableValue::create(name, value), important);
-    if (index == notFound)
+    if (index == kNotFound)
         m_propertyVector.append(property);
     else
         m_propertyVector.at(index) = property;
@@ -498,7 +499,7 @@
         if (property.id() == CSSPropertyVariable && toCSSVariableValue(property.value())->name() == name)
             return i;
     }
-    return notFound;
+    return kNotFound;
 }
 
 CSSProperty* MutableStylePropertySet::findCSSPropertyWithID(CSSPropertyID propertyID)
@@ -549,7 +550,7 @@
 {
     ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
     size_t index = findVariableIndex(name);
-    if (index == notFound)
+    if (index == kNotFound)
         return false;
     m_propertyVector.remove(index);
     return true;
diff --git a/Source/core/css/StyleRule.cpp b/Source/core/css/StyleRule.cpp
index 2fc1fda..3008e84 100644
--- a/Source/core/css/StyleRule.cpp
+++ b/Source/core/css/StyleRule.cpp
@@ -59,7 +59,7 @@
 {
     switch (type()) {
     case Style:
-        delete static_cast<StyleRule*>(this);
+        delete toStyleRule(this);
         return;
     case Page:
         delete static_cast<StyleRulePage*>(this);
@@ -143,7 +143,7 @@
     StyleRuleBase* self = const_cast<StyleRuleBase*>(this);
     switch (type()) {
     case Style:
-        rule = CSSStyleRule::create(static_cast<StyleRule*>(self), parentSheet);
+        rule = CSSStyleRule::create(toStyleRule(self), parentSheet);
         break;
     case Page:
         rule = CSSPageRule::create(static_cast<StyleRulePage*>(self), parentSheet);
diff --git a/Source/core/css/StyleRule.h b/Source/core/css/StyleRule.h
index 5aeaf86..aa319ed 100644
--- a/Source/core/css/StyleRule.h
+++ b/Source/core/css/StyleRule.h
@@ -128,6 +128,14 @@
     return static_cast<const StyleRule*>(rule);
 }
 
+inline StyleRule* toStyleRule(StyleRuleBase* rule)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!rule || rule->isStyleRule());
+    return static_cast<StyleRule*>(rule);
+}
+
+void toStyleRule(const StyleRule*);
+
 class StyleRuleFontFace : public StyleRuleBase {
 public:
     static PassRefPtr<StyleRuleFontFace> create() { return adoptRef(new StyleRuleFontFace); }
diff --git a/Source/core/css/StyleSheetContents.cpp b/Source/core/css/StyleSheetContents.cpp
index 3c48a6b..9eeb6f1 100644
--- a/Source/core/css/StyleSheetContents.cpp
+++ b/Source/core/css/StyleSheetContents.cpp
@@ -413,7 +413,7 @@
         for (unsigned i = 0; i < styleSheet->m_childRules.size(); ++i) {
             StyleRuleBase* rule = styleSheet->m_childRules[i].get();
             if (rule->isStyleRule())
-                static_cast<StyleRule*>(rule)->properties()->addSubresourceStyleURLs(urls, this);
+                toStyleRule(rule)->properties()->addSubresourceStyleURLs(urls, this);
             else if (rule->isFontFaceRule())
                 static_cast<StyleRuleFontFace*>(rule)->properties()->addSubresourceStyleURLs(urls, this);
         }
@@ -481,7 +481,7 @@
 void StyleSheetContents::unregisterClient(CSSStyleSheet* sheet)
 {
     size_t position = m_clients.find(sheet);
-    ASSERT(position != notFound);
+    ASSERT(position != kNotFound);
     m_clients.remove(position);
 }
 
diff --git a/Source/core/css/fullscreen.css b/Source/core/css/fullscreen.css
index 62b33ea..5ea5f06 100644
--- a/Source/core/css/fullscreen.css
+++ b/Source/core/css/fullscreen.css
@@ -23,7 +23,7 @@
 
 video:-webkit-full-screen, audio:-webkit-full-screen {
     background-color: transparent !important;
-    position: static !important;
+    position: relative !important;
     margin: 0 !important;
     height: 100% !important;
     width: 100% !important;
diff --git a/Source/core/css/resolver/ElementStyleResources.cpp b/Source/core/css/resolver/ElementStyleResources.cpp
index f99919a..6534ea8 100644
--- a/Source/core/css/resolver/ElementStyleResources.cpp
+++ b/Source/core/css/resolver/ElementStyleResources.cpp
@@ -50,7 +50,7 @@
     }
 
     if (value->isImageSetValue())
-        return setOrPendingFromValue(property, static_cast<CSSImageSetValue*>(value));
+        return setOrPendingFromValue(property, toCSSImageSetValue(value));
 
     if (value->isCursorImageValue())
         return cursorOrPendingFromValue(property, static_cast<CSSCursorImageValue*>(value));
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index ec034c7..24cdb1a 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -629,7 +629,7 @@
         state.style()->setHasAspectRatio(false);
         return;
     }
-    CSSAspectRatioValue* aspectRatioValue = static_cast<CSSAspectRatioValue*>(value);
+    CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
     state.style()->setHasAspectRatio(true);
     state.style()->setAspectRatioDenominator(aspectRatioValue->denominatorValue());
     state.style()->setAspectRatioNumerator(aspectRatioValue->numeratorValue());
@@ -667,7 +667,7 @@
     state.fontBuilder().setFontVariantLigaturesValue(value);
 }
 
-void StyleBuilderFunctions::applyValueCSSPropertyWebkitMarqueeIncrement(StyleResolverState& state, CSSValue* value)
+void StyleBuilderFunctions::applyValueCSSPropertyInternalMarqueeIncrement(StyleResolverState& state, CSSValue* value)
 {
     if (!value->isPrimitiveValue())
         return;
@@ -694,7 +694,7 @@
     }
 }
 
-void StyleBuilderFunctions::applyValueCSSPropertyWebkitMarqueeSpeed(StyleResolverState& state, CSSValue* value)
+void StyleBuilderFunctions::applyValueCSSPropertyInternalMarqueeSpeed(StyleResolverState& state, CSSValue* value)
 {
     if (!value->isPrimitiveValue())
         return;
@@ -870,6 +870,15 @@
     return convertLengthSizing(state, value);
 }
 
+LengthPoint StyleBuilderConverter::convertLengthPoint(StyleResolverState& state, CSSValue* value)
+{
+    CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+    Pair* pair = primitiveValue->getPairValue();
+    Length x = pair->first()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    Length y = pair->second()->convertToLength<FixedIntegerConversion | PercentConversion>(state.style(), state.rootElementStyle(), state.style()->effectiveZoom());
+    return LengthPoint(x, y);
+}
+
 LengthSize StyleBuilderConverter::convertRadius(StyleResolverState& state, CSSValue* value)
 {
     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
@@ -1111,7 +1120,7 @@
         int paintOrder = 0;
         CSSValueListInspector iter(cssPaintOrder);
         for (size_t i = 0; i < iter.length(); i++) {
-            CSSPrimitiveValue* value = static_cast<CSSPrimitiveValue*>(iter.item(i));
+            CSSPrimitiveValue* value = toCSSPrimitiveValue(iter.item(i));
 
             EPaintOrderType paintOrderType = PT_NONE;
             switch (value->getValueID()) {
@@ -1202,7 +1211,7 @@
         return static_cast<CSSCalcValue*>(value)->hasVariableReference();
 
     if (value->isReflectValue()) {
-        CSSReflectValue* reflectValue = static_cast<CSSReflectValue*>(value);
+        CSSReflectValue* reflectValue = toCSSReflectValue(value);
         CSSPrimitiveValue* direction = reflectValue->direction();
         CSSPrimitiveValue* offset = reflectValue->offset();
         CSSValue* mask = reflectValue->mask();
@@ -1246,7 +1255,7 @@
 
 void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CSSValue* value)
 {
-    if (id != CSSPropertyVariable && hasVariableReference(value)) {
+    if (RuntimeEnabledFeatures::cssVariablesEnabled() && id != CSSPropertyVariable && hasVariableReference(value)) {
         Vector<std::pair<CSSPropertyID, String> > knownExpressions;
         resolveVariables(state, id, value, knownExpressions);
         return;
@@ -1323,7 +1332,7 @@
                         state.style()->setContent(StyleGeneratedImage::create(static_cast<CSSImageGeneratorValue*>(item)), didSet);
                     didSet = true;
                 } else if (item->isImageSetValue()) {
-                    state.style()->setContent(state.elementStyleResources().setOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageSetValue*>(item)), didSet);
+                    state.style()->setContent(state.elementStyleResources().setOrPendingFromValue(CSSPropertyContent, toCSSImageSetValue(item)), didSet);
                     didSet = true;
                 }
 
@@ -1444,6 +1453,7 @@
     case CSSPropertyBorderWidth:
     case CSSPropertyListStyle:
     case CSSPropertyMargin:
+    case CSSPropertyObjectPosition:
     case CSSPropertyOutline:
     case CSSPropertyOverflow:
     case CSSPropertyPadding:
@@ -1524,7 +1534,7 @@
         if (!value->isReflectValue())
             return;
 
-        CSSReflectValue* reflectValue = static_cast<CSSReflectValue*>(value);
+        CSSReflectValue* reflectValue = toCSSReflectValue(value);
         RefPtr<StyleReflection> reflection = StyleReflection::create();
         reflection->setDirection(*reflectValue->direction());
         if (reflectValue->offset())
@@ -1928,6 +1938,7 @@
     case CSSPropertyFontWeight:
     case CSSPropertyHeight:
     case CSSPropertyImageRendering:
+    case CSSPropertyIsolation:
     case CSSPropertyLeft:
     case CSSPropertyLetterSpacing:
     case CSSPropertyLineHeight:
@@ -2047,10 +2058,10 @@
     case CSSPropertyWebkitLineGrid:
     case CSSPropertyWebkitLineSnap:
     case CSSPropertyInternalMarqueeDirection:
-    case CSSPropertyWebkitMarqueeIncrement:
-    case CSSPropertyWebkitMarqueeRepetition:
-    case CSSPropertyWebkitMarqueeSpeed:
-    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyInternalMarqueeIncrement:
+    case CSSPropertyInternalMarqueeRepetition:
+    case CSSPropertyInternalMarqueeSpeed:
+    case CSSPropertyInternalMarqueeStyle:
     case CSSPropertyWebkitMaskBoxImage:
     case CSSPropertyWebkitMaskBoxImageOutset:
     case CSSPropertyWebkitMaskBoxImageRepeat:
diff --git a/Source/core/css/resolver/StyleBuilderCustom.h b/Source/core/css/resolver/StyleBuilderCustom.h
index 2496b3b..597c501 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.h
+++ b/Source/core/css/resolver/StyleBuilderCustom.h
@@ -44,6 +44,7 @@
     static Length convertLengthOrAuto(StyleResolverState&, CSSValue*);
     static Length convertLengthSizing(StyleResolverState&, CSSValue*);
     static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*);
+    static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*);
     static LengthSize convertRadius(StyleResolverState&, CSSValue*);
     static float convertSpacing(StyleResolverState&, CSSValue*);
     template <CSSValueID IdForNone> static AtomicString convertString(StyleResolverState&, CSSValue*);
diff --git a/Source/core/dom/Attr.cpp b/Source/core/dom/Attr.cpp
index 440ca96..8ebced8 100644
--- a/Source/core/dom/Attr.cpp
+++ b/Source/core/dom/Attr.cpp
@@ -29,7 +29,7 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Element.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/Text.h"
 #include "wtf/text/AtomicString.h"
 #include "wtf/text/StringBuilder.h"
@@ -103,7 +103,7 @@
         return;
     }
 
-    if (static_cast<Attr*>(this)->qualifiedName() == xmlnsAtom) {
+    if (this->qualifiedName() == xmlnsAtom) {
         es.throwDOMException(NamespaceError, ExceptionMessages::failedToSet("prefix", "Attr", "The prefix '" + prefix + "' may not be used as a namespace prefix for attributes whose qualified name is '" + xmlnsAtom + "'."));
         return;
     }
diff --git a/Source/core/dom/CharacterData.cpp b/Source/core/dom/CharacterData.cpp
index 9d6f9c7..7cc21d1 100644
--- a/Source/core/dom/CharacterData.cpp
+++ b/Source/core/dom/CharacterData.cpp
@@ -25,9 +25,9 @@
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/MutationEvent.h"
+#include "core/events/MutationEvent.h"
 #include "core/dom/MutationObserverInterestGroup.h"
 #include "core/dom/MutationRecord.h"
 #include "core/dom/ProcessingInstruction.h"
diff --git a/Source/core/dom/ContainerNode.cpp b/Source/core/dom/ContainerNode.cpp
index de26f39..dd9f85d 100644
--- a/Source/core/dom/ContainerNode.cpp
+++ b/Source/core/dom/ContainerNode.cpp
@@ -28,10 +28,10 @@
 #include "core/dom/ChildListMutationScope.h"
 #include "core/dom/ContainerNodeAlgorithms.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/FullscreenElementStack.h"
-#include "core/dom/MutationEvent.h"
+#include "core/events/MutationEvent.h"
 #include "core/dom/NodeRareData.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/dom/NodeTraversal.h"
@@ -144,7 +144,7 @@
 {
     // Not mentioned in spec: throw NotFoundError if newChild is null
     if (!newChild) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -153,7 +153,7 @@
         ASSERT(!newParent->isDocumentTypeNode());
         ASSERT(isChildTypeAllowed(newParent, newChild));
         if (containsConsideringHostElements(newChild, newParent)) {
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return false;
         }
         return true;
@@ -162,22 +162,22 @@
     // This should never happen, but also protect release builds from tree corruption.
     ASSERT(!newChild->isPseudoElement());
     if (newChild->isPseudoElement()) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return false;
     }
 
     if (containsConsideringHostElements(newChild, newParent)) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return false;
     }
 
     if (oldChild && newParent->isDocumentNode()) {
         if (!toDocument(newParent)->canReplaceChild(newChild, oldChild)) {
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return false;
         }
     } else if (!isChildTypeAllowed(newParent, newChild)) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return false;
     }
 
@@ -189,7 +189,7 @@
     ASSERT(!newParent->isDocumentTypeNode());
     ASSERT(isChildTypeAllowed(newParent, newChild));
     if (newChild->contains(newParent)) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return false;
     }
 
@@ -226,7 +226,7 @@
 
     // NotFoundError: Raised if refChild is not a child of this node
     if (refChild->parentNode() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -334,7 +334,7 @@
         return;
 
     if (!oldChild) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -344,7 +344,7 @@
 
     // NotFoundError: Raised if oldChild is not a child of this node.
     if (oldChild->parentNode() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -451,7 +451,7 @@
 
     // NotFoundError: Raised if oldChild is not a child of this node.
     if (!oldChild || oldChild->parentNode() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -465,7 +465,7 @@
     // Events fired when blurring currently focused node might have moved this
     // child into a different parent.
     if (child->parentNode() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -473,7 +473,7 @@
 
     // Mutation events might have moved this child into a different parent.
     if (child->parentNode() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -553,11 +553,17 @@
     // and remove... e.g. stop loading frames, fire unload events.
     willRemoveChildren(protect.get());
 
-    // Exclude this node when looking for removed focusedElement since only
-    // children will be removed.
-    // This must be later than willRemvoeChildren, which might change focus
-    // state of a child.
-    document().removeFocusedElementOfSubtree(this, true);
+    {
+        // Removing focus can cause frames to load, either via events (focusout, blur)
+        // or widget updates (e.g., for <embed>).
+        SubframeLoadingDisabler disabler(this);
+
+        // Exclude this node when looking for removed focusedElement since only
+        // children will be removed.
+        // This must be later than willRemoveChildren, which might change focus
+        // state of a child.
+        document().removeFocusedElementOfSubtree(this, true);
+    }
 
     NodeVector removedChildren;
     {
diff --git a/Source/core/dom/CustomElement.cpp b/Source/core/dom/CustomElement.cpp
index ddb8db2..d09bafc 100644
--- a/Source/core/dom/CustomElement.cpp
+++ b/Source/core/dom/CustomElement.cpp
@@ -64,10 +64,10 @@
 {
     validNames = NameSet(validNames & enabledNameSet());
 
-    if ((validNames & EmbedderNames) && notFound != embedderCustomElementNames().find(name))
+    if ((validNames & EmbedderNames) && kNotFound != embedderCustomElementNames().find(name))
         return Document::isValidName(name);
 
-    if ((validNames & StandardNames) && notFound != name.find('-')) {
+    if ((validNames & StandardNames) && kNotFound != name.find('-')) {
         DEFINE_STATIC_LOCAL(Vector<AtomicString>, reservedNames, ());
         if (reservedNames.isEmpty()) {
             reservedNames.append(MathMLNames::annotation_xmlTag.localName());
@@ -80,7 +80,7 @@
             reservedNames.append(SVGNames::missing_glyphTag.localName());
         }
 
-        if (notFound == reservedNames.find(name))
+        if (kNotFound == reservedNames.find(name))
             return Document::isValidName(name.string());
     }
 
diff --git a/Source/core/dom/CustomElementCallbackDispatcher.cpp b/Source/core/dom/CustomElementCallbackDispatcher.cpp
index 41d5ecf..9ae56c4 100644
--- a/Source/core/dom/CustomElementCallbackDispatcher.cpp
+++ b/Source/core/dom/CustomElementCallbackDispatcher.cpp
@@ -31,7 +31,8 @@
 #include "config.h"
 #include "core/dom/CustomElementCallbackDispatcher.h"
 
-#include "core/dom/CustomElementCallbackInvocation.h"
+#include "core/dom/CustomElementCallbackQueue.h"
+#include "core/dom/CustomElementCallbackScheduler.h"
 #include "wtf/MainThread.h"
 
 namespace WebCore {
@@ -73,8 +74,7 @@
     s_elementQueueEnd = kNumSentinels;
     m_flattenedProcessingStack.resize(s_elementQueueEnd);
 
-    ElementCallbackQueueMap emptyMap;
-    m_elementCallbackQueueMap.swap(emptyMap);
+    CustomElementCallbackScheduler::clearElementCallbackQueueMap();
 
     bool didWork = start < end;
     return didWork;
@@ -107,46 +107,11 @@
     m_flattenedProcessingStack.resize(start);
     s_elementQueueEnd = start;
 
-    if (start == kNumSentinels) {
-        ElementCallbackQueueMap emptyMap;
-        m_elementCallbackQueueMap.swap(emptyMap);
-    }
+    if (start == kNumSentinels)
+        CustomElementCallbackScheduler::clearElementCallbackQueueMap();
 }
 
-CustomElementCallbackQueue* CustomElementCallbackDispatcher::ensureCallbackQueue(PassRefPtr<Element> element)
-{
-    Element* key = element.get();
-    ElementCallbackQueueMap::iterator it = m_elementCallbackQueueMap.find(key);
-    if (it == m_elementCallbackQueueMap.end())
-        it = m_elementCallbackQueueMap.add(key, CustomElementCallbackQueue::create(element)).iterator;
-    return it->value.get();
-}
-
-// Finds or creates the callback queue for element. If the
-// createdCallback has not finished running, the callback queue is not
-// moved to the top-of-stack. Otherwise like
-// scheduleInCurrentElementQueue.
-CustomElementCallbackQueue* CustomElementCallbackDispatcher::schedule(PassRefPtr<Element> element)
-{
-    CustomElementCallbackQueue* callbackQueue = ensureCallbackQueue(element);
-    if (!callbackQueue->inCreatedCallback())
-        ensureInCurrentElementQueue(callbackQueue);
-    return callbackQueue;
-}
-
-// Finds or creates the callback queue for element. If the element's
-// callback queue is scheduled in an earlier processing stack frame,
-// its owner is set to the element queue on the top of the processing
-// stack. Because callback queues are processed exhaustively, this
-// effectively moves the callback queue to the top of the stack.
-CustomElementCallbackQueue* CustomElementCallbackDispatcher::scheduleInCurrentElementQueue(PassRefPtr<Element> element)
-{
-    CustomElementCallbackQueue* callbackQueue = ensureCallbackQueue(element);
-    ensureInCurrentElementQueue(callbackQueue);
-    return callbackQueue;
-}
-
-void CustomElementCallbackDispatcher::ensureInCurrentElementQueue(CustomElementCallbackQueue* callbackQueue)
+void CustomElementCallbackDispatcher::enqueue(CustomElementCallbackQueue* callbackQueue)
 {
     if (callbackQueue->owner() == currentElementQueue())
         return;
diff --git a/Source/core/dom/CustomElementCallbackDispatcher.h b/Source/core/dom/CustomElementCallbackDispatcher.h
index f26ec9b..1230179 100644
--- a/Source/core/dom/CustomElementCallbackDispatcher.h
+++ b/Source/core/dom/CustomElementCallbackDispatcher.h
@@ -31,15 +31,13 @@
 #ifndef CustomElementCallbackDispatcher_h
 #define CustomElementCallbackDispatcher_h
 
-#include "core/dom/CustomElementCallbackQueue.h"
-#include "core/dom/Element.h"
-#include "wtf/HashMap.h"
-#include "wtf/OwnPtr.h"
-#include "wtf/PassRefPtr.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
 
+class CustomElementCallbackQueue;
+class CustomElementCallbackScheduler;
+
 class CustomElementCallbackDispatcher {
     WTF_MAKE_NONCOPYABLE(CustomElementCallbackDispatcher);
 public:
@@ -72,9 +70,7 @@
 
 protected:
     friend class CustomElementCallbackScheduler;
-
-    CustomElementCallbackQueue* schedule(PassRefPtr<Element>);
-    CustomElementCallbackQueue* scheduleInCurrentElementQueue(PassRefPtr<Element>);
+    void enqueue(CustomElementCallbackQueue*);
 
 private:
     CustomElementCallbackDispatcher()
@@ -106,17 +102,11 @@
     static void processElementQueueAndPop();
     void processElementQueueAndPop(size_t start, size_t end);
 
-    CustomElementCallbackQueue* ensureCallbackQueue(PassRefPtr<Element>);
-    void ensureInCurrentElementQueue(CustomElementCallbackQueue*);
-
     // The processing stack, flattened. Element queues lower in the
     // stack appear toward the head of the vector. The first element
     // is a null sentinel value.
     static const size_t kNumSentinels = 1;
     Vector<CustomElementCallbackQueue*> m_flattenedProcessingStack;
-
-    typedef HashMap<Element*, OwnPtr<CustomElementCallbackQueue> > ElementCallbackQueueMap;
-    ElementCallbackQueueMap m_elementCallbackQueueMap;
 };
 
 }
diff --git a/Source/core/dom/CustomElementCallbackQueue.cpp b/Source/core/dom/CustomElementCallbackQueue.cpp
index 7078364..114b21f 100644
--- a/Source/core/dom/CustomElementCallbackQueue.cpp
+++ b/Source/core/dom/CustomElementCallbackQueue.cpp
@@ -31,8 +31,6 @@
 #include "config.h"
 #include "core/dom/CustomElementCallbackQueue.h"
 
-#include "core/dom/Element.h"
-
 namespace WebCore {
 
 PassOwnPtr<CustomElementCallbackQueue> CustomElementCallbackQueue::create(PassRefPtr<Element> element)
diff --git a/Source/core/dom/CustomElementCallbackQueue.h b/Source/core/dom/CustomElementCallbackQueue.h
index 430766f..9afdeed 100644
--- a/Source/core/dom/CustomElementCallbackQueue.h
+++ b/Source/core/dom/CustomElementCallbackQueue.h
@@ -32,6 +32,7 @@
 #define CustomElementCallbackQueue_h
 
 #include "core/dom/CustomElementCallbackInvocation.h"
+#include "core/dom/Element.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/dom/CustomElementCallbackScheduler.cpp b/Source/core/dom/CustomElementCallbackScheduler.cpp
index 31c8252..d6086cd 100644
--- a/Source/core/dom/CustomElementCallbackScheduler.cpp
+++ b/Source/core/dom/CustomElementCallbackScheduler.cpp
@@ -43,7 +43,7 @@
     if (!callbacks->hasAttributeChangedCallback())
         return;
 
-    CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instance().schedule(element);
+    CustomElementCallbackQueue* queue = instance().schedule(element);
     queue->append(CustomElementCallbackInvocation::createAttributeChangedInvocation(callbacks, name, oldValue, newValue));
 }
 
@@ -52,7 +52,7 @@
     if (!callbacks->hasCreatedCallback())
         return;
 
-    CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instance().scheduleInCurrentElementQueue(element);
+    CustomElementCallbackQueue* queue = instance().scheduleInCurrentElementQueue(element);
     queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, CustomElementLifecycleCallbacks::Created));
 }
 
@@ -61,7 +61,7 @@
     if (!callbacks->hasEnteredViewCallback())
         return;
 
-    CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instance().schedule(element);
+    CustomElementCallbackQueue* queue = instance().schedule(element);
     queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, CustomElementLifecycleCallbacks::EnteredView));
 }
 
@@ -70,8 +70,53 @@
     if (!callbacks->hasLeftViewCallback())
         return;
 
-    CustomElementCallbackQueue* queue = CustomElementCallbackDispatcher::instance().schedule(element);
+    CustomElementCallbackQueue* queue = instance().schedule(element);
     queue->append(CustomElementCallbackInvocation::createInvocation(callbacks, CustomElementLifecycleCallbacks::LeftView));
 }
 
+CustomElementCallbackScheduler& CustomElementCallbackScheduler::instance()
+{
+    DEFINE_STATIC_LOCAL(CustomElementCallbackScheduler, instance, ());
+    return instance;
+}
+
+CustomElementCallbackQueue* CustomElementCallbackScheduler::ensureCallbackQueue(PassRefPtr<Element> element)
+{
+    Element* key = element.get();
+    ElementCallbackQueueMap::iterator it = m_elementCallbackQueueMap.find(key);
+    if (it == m_elementCallbackQueueMap.end())
+        it = m_elementCallbackQueueMap.add(key, CustomElementCallbackQueue::create(element)).iterator;
+    return it->value.get();
+}
+
+void CustomElementCallbackScheduler::clearElementCallbackQueueMap()
+{
+    ElementCallbackQueueMap emptyMap;
+    instance().m_elementCallbackQueueMap.swap(emptyMap);
+}
+
+// Finds or creates the callback queue for element. If the
+// createdCallback has not finished running, the callback queue is not
+// moved to the top-of-stack. Otherwise like
+// scheduleInCurrentElementQueue.
+CustomElementCallbackQueue* CustomElementCallbackScheduler::schedule(PassRefPtr<Element> element)
+{
+    CustomElementCallbackQueue* callbackQueue = ensureCallbackQueue(element);
+    if (!callbackQueue->inCreatedCallback())
+        CustomElementCallbackDispatcher::instance().enqueue(callbackQueue);
+    return callbackQueue;
+}
+
+// Finds or creates the callback queue for element. If the element's
+// callback queue is scheduled in an earlier processing stack frame,
+// its owner is set to the element queue on the top of the processing
+// stack. Because callback queues are processed exhaustively, this
+// effectively moves the callback queue to the top of the stack.
+CustomElementCallbackQueue* CustomElementCallbackScheduler::scheduleInCurrentElementQueue(PassRefPtr<Element> element)
+{
+    CustomElementCallbackQueue* callbackQueue = ensureCallbackQueue(element);
+    CustomElementCallbackDispatcher::instance().enqueue(callbackQueue);
+    return callbackQueue;
+}
+
 } // namespace WebCore
diff --git a/Source/core/dom/CustomElementCallbackScheduler.h b/Source/core/dom/CustomElementCallbackScheduler.h
index 42542e5..b0e757f 100644
--- a/Source/core/dom/CustomElementCallbackScheduler.h
+++ b/Source/core/dom/CustomElementCallbackScheduler.h
@@ -31,6 +31,9 @@
 #ifndef CustomElementCallbackScheduler_h
 #define CustomElementCallbackScheduler_h
 
+#include "core/dom/CustomElementCallbackQueue.h"
+#include "wtf/HashMap.h"
+#include "wtf/OwnPtr.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/text/AtomicString.h"
 
@@ -46,8 +49,21 @@
     static void scheduleEnteredViewCallback(PassRefPtr<CustomElementLifecycleCallbacks>, PassRefPtr<Element>);
     static void scheduleLeftViewCallback(PassRefPtr<CustomElementLifecycleCallbacks>, PassRefPtr<Element>);
 
+protected:
+    friend class CustomElementCallbackDispatcher;
+    static void clearElementCallbackQueueMap();
+
 private:
-    CustomElementCallbackScheduler();
+    CustomElementCallbackScheduler() { }
+
+    static CustomElementCallbackScheduler& instance();
+
+    CustomElementCallbackQueue* ensureCallbackQueue(PassRefPtr<Element>);
+    CustomElementCallbackQueue* schedule(PassRefPtr<Element>);
+    CustomElementCallbackQueue* scheduleInCurrentElementQueue(PassRefPtr<Element>);
+
+    typedef HashMap<Element*, OwnPtr<CustomElementCallbackQueue> > ElementCallbackQueueMap;
+    ElementCallbackQueueMap m_elementCallbackQueueMap;
 };
 
 }
diff --git a/Source/core/dom/CustomElementException.cpp b/Source/core/dom/CustomElementException.cpp
index 73b1717..3f2ccaa 100644
--- a/Source/core/dom/CustomElementException.cpp
+++ b/Source/core/dom/CustomElementException.cpp
@@ -57,11 +57,11 @@
         return;
 
     case ContextDestroyedCreatingCallbacks:
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
 
     case ContextDestroyedRegisteringDefinition:
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
 
     case ExtendsIsInvalidName:
diff --git a/Source/core/dom/DOMTokenList.cpp b/Source/core/dom/DOMTokenList.cpp
index 9b48609..71a123a 100644
--- a/Source/core/dom/DOMTokenList.cpp
+++ b/Source/core/dom/DOMTokenList.cpp
@@ -35,14 +35,14 @@
 bool DOMTokenList::validateToken(const AtomicString& token, ExceptionState& es)
 {
     if (token.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return false;
     }
 
     unsigned length = token.length();
     for (unsigned i = 0; i < length; ++i) {
-        if (isHTMLSpace(token[i])) {
-            es.throwDOMException(InvalidCharacterError);
+        if (isHTMLSpace<UChar>(token[i])) {
+            es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
             return false;
         }
     }
@@ -171,7 +171,7 @@
     StringBuilder builder;
     if (!input.isEmpty()) {
         builder.append(input);
-        needsSpace = !isHTMLSpace(input[input.length() - 1]);
+        needsSpace = !isHTMLSpace<UChar>(input[input.length() - 1]);
     }
 
     for (size_t i = 0; i < tokens.size(); ++i) {
@@ -203,26 +203,26 @@
 
     // Step 5
     while (position < inputLength) {
-        if (isHTMLSpace(input[position])) { // 6
+        if (isHTMLSpace<UChar>(input[position])) { // 6
             output.append(input[position++]); // 6.1, 6.2
             continue; // 6.3
         }
 
         // Step 7
         StringBuilder tokenBuilder;
-        while (position < inputLength && isNotHTMLSpace(input[position]))
+        while (position < inputLength && isNotHTMLSpace<UChar>(input[position]))
             tokenBuilder.append(input[position++]);
 
         // Step 8
         String token = tokenBuilder.toString();
         if (tokens.contains(token)) {
             // Step 8.1
-            while (position < inputLength && isHTMLSpace(input[position]))
+            while (position < inputLength && isHTMLSpace<UChar>(input[position]))
                 ++position;
 
             // Step 8.2
             size_t j = output.length();
-            while (j > 0 && isHTMLSpace(output[j - 1]))
+            while (j > 0 && isHTMLSpace<UChar>(output[j - 1]))
                 --j;
             output.resize(j);
 
diff --git a/Source/core/dom/DatasetDOMStringMap.cpp b/Source/core/dom/DatasetDOMStringMap.cpp
index fbeaa54..309dabf 100644
--- a/Source/core/dom/DatasetDOMStringMap.cpp
+++ b/Source/core/dom/DatasetDOMStringMap.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "core/dom/DatasetDOMStringMap.h"
 
+#include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Element.h"
@@ -180,7 +181,7 @@
 void DatasetDOMStringMap::setItem(const String& name, const String& value, ExceptionState& es)
 {
     if (!isValidPropertyName(name)) {
-        es.throwDOMException(SyntaxError);
+        es.throwDOMException(SyntaxError, ExceptionMessages::failedToSet(name, "DOMStringMap", "'" + name + "' is not a valid property name."));
         return;
     }
 
@@ -190,7 +191,7 @@
 void DatasetDOMStringMap::deleteItem(const String& name, ExceptionState& es)
 {
     if (!isValidPropertyName(name)) {
-        es.throwDOMException(SyntaxError);
+        es.throwDOMException(SyntaxError, ExceptionMessages::failedToDelete(name, "DOMStringMap", "'" + name + "' is not a valid property name."));
         return;
     }
 
diff --git a/Source/core/dom/DecodedDataDocumentParser.cpp b/Source/core/dom/DecodedDataDocumentParser.cpp
index 06ce4e7..7ac890e 100644
--- a/Source/core/dom/DecodedDataDocumentParser.cpp
+++ b/Source/core/dom/DecodedDataDocumentParser.cpp
@@ -41,6 +41,9 @@
     if (!length)
         return 0;
 
+    if (isStopped())
+        return 0;
+
     String decoded = document()->decoder()->decode(data, length);
     document()->setEncoding(document()->decoder()->encoding());
 
@@ -55,6 +58,9 @@
 
 size_t DecodedDataDocumentParser::flush()
 {
+    if (isStopped())
+        return 0;
+
     // null decoder indicates there is no data received.
     // We have nothing to do in that case.
     TextResourceDecoder* decoder = document()->decoder();
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 7417915..e536173 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -55,14 +55,14 @@
 #include "core/css/resolver/FontBuilder.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Attr.h"
-#include "core/dom/BeforeUnloadEvent.h"
+#include "core/events/BeforeUnloadEvent.h"
 #include "core/dom/CDATASection.h"
 #include "core/dom/Comment.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/CustomElementRegistrationContext.h"
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/DOMNamedFlowCollection.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/DocumentLifecycleObserver.h"
 #include "core/dom/DocumentMarkerController.h"
@@ -70,12 +70,12 @@
 #include "core/dom/DocumentType.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventFactory.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventFactory.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/HashChangeEvent.h"
+#include "core/events/HashChangeEvent.h"
 #include "core/dom/NamedFlowCollection.h"
 #include "core/dom/NodeFilter.h"
 #include "core/dom/NodeIterator.h"
@@ -84,13 +84,13 @@
 #include "core/dom/NodeRenderingTraversal.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/NodeWithIndex.h"
-#include "core/dom/PageTransitionEvent.h"
-#include "core/dom/PopStateEvent.h"
+#include "core/events/PageTransitionEvent.h"
+#include "core/events/PopStateEvent.h"
 #include "core/dom/PostAttachCallbacks.h"
 #include "core/dom/ProcessingInstruction.h"
 #include "core/dom/QualifiedName.h"
 #include "core/dom/RequestAnimationFrameCallback.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/ScriptRunner.h"
 #include "core/dom/ScriptedAnimationController.h"
 #include "core/dom/SelectorQuery.h"
@@ -106,7 +106,6 @@
 #include "core/editing/FrameSelection.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/fetch/TextResourceDecoder.h"
-#include "core/html/FormController.h"
 #include "core/html/HTMLAllCollection.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLCanvasElement.h"
@@ -125,6 +124,7 @@
 #include "core/html/HTMLStyleElement.h"
 #include "core/html/HTMLTitleElement.h"
 #include "core/html/PluginDocument.h"
+#include "core/html/forms/FormController.h"
 #include "core/html/parser/HTMLDocumentParser.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/parser/NestingLevelIncrementer.h"
@@ -690,7 +690,7 @@
 PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionState& es)
 {
     if (!isValidName(name)) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return 0;
     }
 
@@ -703,7 +703,7 @@
 PassRefPtr<Element> Document::createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState& es)
 {
     if (!isValidName(localName)) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return 0;
     }
 
@@ -728,7 +728,7 @@
 
     QualifiedName qName(prefix, localName, namespaceURI);
     if (!hasValidNamespaceForElements(qName)) {
-        es.throwDOMException(NamespaceError);
+        es.throwUninformativeAndGenericDOMException(NamespaceError);
         return 0;
     }
 
@@ -752,7 +752,7 @@
 ScriptValue Document::registerElement(WebCore::ScriptState* state, const AtomicString& name, const Dictionary& options, ExceptionState& es, CustomElement::NameSet validNames)
 {
     if (!registrationContext()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return ScriptValue();
     }
 
@@ -795,10 +795,10 @@
 PassRefPtr<CDATASection> Document::createCDATASection(const String& data, ExceptionState& es)
 {
     if (isHTMLDocument()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
-    if (data.find("]]>") != WTF::notFound) {
+    if (data.find("]]>") != WTF::kNotFound) {
         es.throwDOMException(InvalidCharacterError, "String cannot contain ']]>' since that is the end delimiter of a CData section.");
         return 0;
     }
@@ -808,11 +808,11 @@
 PassRefPtr<ProcessingInstruction> Document::createProcessingInstruction(const String& target, const String& data, ExceptionState& es)
 {
     if (!isValidName(target)) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return 0;
     }
     if (isHTMLDocument()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return ProcessingInstruction::create(*this, target, data);
@@ -831,7 +831,7 @@
 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionState& es)
 {
     if (!importedNode) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -849,7 +849,7 @@
         // FIXME: The following check might be unnecessary. Is it possible that
         // oldElement has mismatched prefix/namespace?
         if (!hasValidNamespaceForElements(oldElement->tagQName())) {
-            es.throwDOMException(NamespaceError);
+            es.throwUninformativeAndGenericDOMException(NamespaceError);
             return 0;
         }
         RefPtr<Element> newElement = createElement(oldElement->tagQName(), false);
@@ -901,14 +901,14 @@
     case XPATH_NAMESPACE_NODE:
         break;
     }
-    es.throwDOMException(NotSupportedError);
+    es.throwUninformativeAndGenericDOMException(NotSupportedError);
     return 0;
 }
 
 PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionState& es)
 {
     if (!source) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -920,7 +920,7 @@
     case DOCUMENT_NODE:
     case DOCUMENT_TYPE_NODE:
     case XPATH_NAMESPACE_NODE:
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     case ATTRIBUTE_NODE: {
         Attr* attr = toAttr(source.get());
@@ -932,14 +932,14 @@
     default:
         if (source->isShadowRoot()) {
             // ShadowRoot cannot disconnect itself from the host node.
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return 0;
         }
 
         if (source->isFrameOwnerElement()) {
             HTMLFrameOwnerElement* frameOwnerElement = toHTMLFrameOwnerElement(source.get());
             if (frame() && frame()->tree()->isDescendantOf(frameOwnerElement->contentFrame())) {
-                es.throwDOMException(HierarchyRequestError);
+                es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
                 return 0;
             }
         }
@@ -1047,7 +1047,7 @@
 
     QualifiedName qName(prefix, localName, namespaceURI);
     if (!hasValidNamespaceForElements(qName)) {
-        es.throwDOMException(NamespaceError);
+        es.throwUninformativeAndGenericDOMException(NamespaceError);
         return 0;
     }
 
@@ -1136,12 +1136,12 @@
 void Document::setXMLVersion(const String& version, ExceptionState& es)
 {
     if (!implementation()->hasFeature("XML", String())) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
     if (!XMLDocumentParser::supportsXMLVersion(version)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -1151,7 +1151,7 @@
 void Document::setXMLStandalone(bool standalone, ExceptionState& es)
 {
     if (!implementation()->hasFeature("XML", String())) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -1452,7 +1452,7 @@
 {
     // FIXME: Probably this should be handled within the bindings layer and TypeError should be thrown.
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return NodeIterator::create(root, NodeFilter::SHOW_ALL, PassRefPtr<NodeFilter>());
@@ -1461,7 +1461,7 @@
 PassRefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     // FIXME: It might be a good idea to emit a warning if |whatToShow| contains a bit that is not defined in
@@ -1472,7 +1472,7 @@
 PassRefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter> filter, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     // FIXME: Ditto.
@@ -1482,7 +1482,7 @@
 PassRefPtr<NodeIterator> Document::createNodeIterator(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter> filter, bool expandEntityReferences, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     // FIXME: Warn if |expandEntityReferences| is specified. This optional argument is deprecated in DOM4.
@@ -1493,7 +1493,7 @@
 PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return TreeWalker::create(root, NodeFilter::SHOW_ALL, PassRefPtr<NodeFilter>());
@@ -1502,7 +1502,7 @@
 PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToShow, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return TreeWalker::create(root, whatToShow, PassRefPtr<NodeFilter>());
@@ -1511,7 +1511,7 @@
 PassRefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned whatToShow, PassRefPtr<NodeFilter> filter, ExceptionState& es)
 {
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return TreeWalker::create(root, whatToShow, filter);
@@ -1521,7 +1521,7 @@
 {
     UNUSED_PARAM(expandEntityReferences);
     if (!root) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return TreeWalker::create(root, whatToShow, filter);
@@ -2260,12 +2260,12 @@
     RefPtr<HTMLElement> newBody = prpNewBody;
 
     if (!newBody || !documentElement()) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return;
     }
 
     if (!newBody->hasTagName(bodyTag) && !newBody->hasTagName(framesetTag)) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return;
     }
 
@@ -3680,6 +3680,9 @@
             (*it)->didMergeTextNodes(oldNodeWithIndex, offset);
     }
 
+    if (m_frame)
+        m_frame->selection().didMergeTextNodes(*oldNode, offset);
+
     // FIXME: This should update markers for spelling and grammar checking.
 }
 
@@ -3740,7 +3743,7 @@
     if (event)
         return event.release();
 
-    es.throwDOMException(NotSupportedError);
+    es.throwUninformativeAndGenericDOMException(NotSupportedError);
     return 0;
 }
 
@@ -4035,7 +4038,7 @@
         U16_NEXT(characters, i, length, c)
         if (c == ':') {
             if (sawColon) {
-                es.throwDOMException(NamespaceError);
+                es.throwUninformativeAndGenericDOMException(NamespaceError);
                 return false; // multiple colons: not allowed
             }
             nameStart = true;
@@ -4043,13 +4046,13 @@
             colonPos = i - 1;
         } else if (nameStart) {
             if (!isValidNameStart(c)) {
-                es.throwDOMException(InvalidCharacterError);
+                es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
                 return false;
             }
             nameStart = false;
         } else {
             if (!isValidNamePart(c)) {
-                es.throwDOMException(InvalidCharacterError);
+                es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
                 return false;
             }
         }
@@ -4061,14 +4064,14 @@
     } else {
         prefix = qualifiedName.substring(0, colonPos);
         if (prefix.isEmpty()) {
-            es.throwDOMException(NamespaceError);
+            es.throwUninformativeAndGenericDOMException(NamespaceError);
             return false;
         }
         localName = qualifiedName.substring(colonPos + 1);
     }
 
     if (localName.isEmpty()) {
-        es.throwDOMException(NamespaceError);
+        es.throwUninformativeAndGenericDOMException(NamespaceError);
         return false;
     }
 
@@ -4080,7 +4083,7 @@
     unsigned length = qualifiedName.length();
 
     if (!length) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return false;
     }
 
@@ -4315,7 +4318,7 @@
     QualifiedName qName(prefix, localName, namespaceURI);
 
     if (!shouldIgnoreNamespaceChecks && !hasValidNamespaceForAttributes(qName)) {
-        es.throwDOMException(NamespaceError);
+        es.throwUninformativeAndGenericDOMException(NamespaceError);
         return 0;
     }
 
@@ -4956,7 +4959,7 @@
     if (!element->isInTopLayer())
         return;
     size_t position = m_topLayerElements.find(element);
-    ASSERT(position != notFound);
+    ASSERT(position != kNotFound);
     m_topLayerElements.remove(position);
     element->setIsInTopLayer(false);
 }
@@ -5374,6 +5377,11 @@
     m_associatedFormControls.clear();
 }
 
+float Document::devicePixelRatio() const
+{
+    return m_frame ? m_frame->devicePixelRatio() : 1.0;
+}
+
 PassOwnPtr<LifecycleNotifier> Document::createLifecycleNotifier()
 {
     return DocumentLifecycleNotifier::create(this);
diff --git a/Source/core/dom/Document.h b/Source/core/dom/Document.h
index 0e46a60..5960a6c 100644
--- a/Source/core/dom/Document.h
+++ b/Source/core/dom/Document.h
@@ -32,7 +32,7 @@
 #include "core/dom/ContainerNode.h"
 #include "core/dom/CustomElement.h"
 #include "core/dom/DOMTimeStamp.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 #include "core/dom/DocumentInit.h"
 #include "core/dom/DocumentTiming.h"
 #include "core/dom/IconURL.h"
@@ -461,10 +461,12 @@
     Vector<String> formElementsState() const;
     void setStateForNewFormElements(const Vector<String>&);
 
-    FrameView* view() const; // can be NULL
-    Frame* frame() const { return m_frame; } // can be NULL
-    Page* page() const; // can be NULL
-    Settings* settings() const; // can be NULL
+    FrameView* view() const; // can be null
+    Frame* frame() const { return m_frame; } // can be null
+    Page* page() const; // can be null
+    Settings* settings() const; // can be null
+
+    float devicePixelRatio() const;
 
     PassRefPtr<Range> createRange();
 
diff --git a/Source/core/dom/DocumentMarker.h b/Source/core/dom/DocumentMarker.h
index b6072b9..32bf502 100644
--- a/Source/core/dom/DocumentMarker.h
+++ b/Source/core/dom/DocumentMarker.h
@@ -38,10 +38,17 @@
 // for all types other than type TextMatch.
 class DocumentMarker {
 public:
+    enum MarkerTypeIndex {
+        SpellingMarkerIndex = 0,
+        GramarMarkerIndex,
+        TextMatchMarkerIndex,
+        MarkerTypeIndexesCount
+    };
+
     enum MarkerType {
-        Spelling = 1 << 0,
-        Grammar = 1 << 1,
-        TextMatch = 1 << 2
+        Spelling = 1 << SpellingMarkerIndex,
+        Grammar = 1 << GramarMarkerIndex,
+        TextMatch = 1 << TextMatchMarkerIndex
     };
 
     class MarkerTypes {
@@ -68,6 +75,14 @@
         }
     };
 
+    class MisspellingMarkers : public MarkerTypes {
+    public:
+        MisspellingMarkers()
+            : MarkerTypes(Spelling | Grammar)
+        {
+        }
+    };
+
     DocumentMarker();
     DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset);
     DocumentMarker(MarkerType, unsigned startOffset, unsigned endOffset, const String& description);
diff --git a/Source/core/dom/DocumentMarkerController.cpp b/Source/core/dom/DocumentMarkerController.cpp
index 0682b64..eb23578 100644
--- a/Source/core/dom/DocumentMarkerController.cpp
+++ b/Source/core/dom/DocumentMarkerController.cpp
@@ -40,6 +40,25 @@
 
 namespace WebCore {
 
+namespace {
+
+DocumentMarker::MarkerTypeIndex MarkerTypeToMarkerIndex(DocumentMarker::MarkerType type)
+{
+    switch (type) {
+    case DocumentMarker::Spelling:
+        return DocumentMarker::SpellingMarkerIndex;
+    case DocumentMarker::Grammar:
+        return DocumentMarker::GramarMarkerIndex;
+    case DocumentMarker::TextMatch:
+        return DocumentMarker::TextMatchMarkerIndex;
+    }
+
+    ASSERT_NOT_REACHED();
+    return DocumentMarker::SpellingMarkerIndex;
+}
+
+} // namespace
+
 inline bool DocumentMarkerController::possiblyHasMarkers(DocumentMarker::MarkerTypes types)
 {
     return m_possiblyExistingMarkerTypes.intersects(types);
@@ -114,7 +133,7 @@
             // matches off-screen are (that haven't been painted yet).
             Node* node = textPiece->startContainer();
             Vector<DocumentMarker*> markers = markersFor(node);
-            static_cast<RenderedDocumentMarker*>(markers[markers.size() - 1])->setRenderedRect(range->boundingBox());
+            toRenderedDocumentMarker(markers[markers.size() - 1])->setRenderedRect(range->boundingBox());
         }
     }
 }
@@ -133,6 +152,36 @@
     }
 }
 
+static bool startsFurther(const DocumentMarker& lhv, const DocumentMarker& rhv)
+{
+    return lhv.startOffset() < rhv.startOffset();
+}
+
+static bool startsAfter(const DocumentMarker& marker, size_t startOffset)
+{
+    return marker.startOffset() < startOffset;
+}
+
+static bool endsBefore(size_t startOffset, const DocumentMarker& rhv)
+{
+    return startOffset < rhv.endOffset();
+}
+
+static bool compareByStart(const DocumentMarker* lhv, const DocumentMarker* rhv)
+{
+    return startsFurther(*lhv, *rhv);
+}
+
+static bool doesNotOverlap(const DocumentMarker& lhv, const DocumentMarker& rhv)
+{
+    return lhv.endOffset() < rhv.startOffset();
+}
+
+static bool doesNotInclude(const DocumentMarker& marker, size_t startOffset)
+{
+    return marker.endOffset() < startOffset;
+}
+
 // Markers are stored in order sorted by their start offset.
 // Markers of the same type do not overlap each other.
 
@@ -144,49 +193,28 @@
 
     m_possiblyExistingMarkerTypes.add(newMarker.type());
 
-    OwnPtr<MarkerList>& list = m_markers.add(node, nullptr).iterator->value;
+    OwnPtr<MarkerLists>& markers = m_markers.add(node, nullptr).iterator->value;
+    if (!markers) {
+        markers = adoptPtr(new MarkerLists);
+        markers->grow(DocumentMarker::MarkerTypeIndexesCount);
+    }
 
-    if (!list) {
-        list = adoptPtr(new MarkerList);
+    DocumentMarker::MarkerTypeIndex markerListIndex = MarkerTypeToMarkerIndex(newMarker.type());
+    if (!markers->at(markerListIndex)) {
+        markers->insert(markerListIndex, adoptPtr(new MarkerList));
+    }
+
+    OwnPtr<MarkerList>& list = markers->at(markerListIndex);
+    if (list->isEmpty() || list->last().endOffset() < newMarker.startOffset()) {
         list->append(RenderedDocumentMarker(newMarker));
     } else {
         RenderedDocumentMarker toInsert(newMarker);
-        size_t numMarkers = list->size();
-        size_t i;
-        // Iterate over all markers whose start offset is less than or equal to the new marker's.
-        // If one of them is of the same type as the new marker and touches it or intersects with it
-        // (there is at most one), remove it and adjust the new marker's start offset to encompass it.
-        for (i = 0; i < numMarkers; ++i) {
-            DocumentMarker marker = list->at(i);
-            if (marker.startOffset() > toInsert.startOffset())
-                break;
-            if (marker.type() == toInsert.type() && marker.type() != DocumentMarker::TextMatch && marker.endOffset() >= toInsert.startOffset()) {
-                toInsert.setStartOffset(marker.startOffset());
-                list->remove(i);
-                numMarkers--;
-                break;
-            }
+        if (toInsert.type() != DocumentMarker::TextMatch) {
+            mergeOverlapping(list.get(), toInsert);
+        } else {
+            MarkerList::iterator pos = std::lower_bound(list->begin(), list->end(), toInsert, startsFurther);
+            list->insert(pos - list->begin(), RenderedDocumentMarker(toInsert));
         }
-        size_t j = i;
-        // Iterate over all markers whose end offset is less than or equal to the new marker's,
-        // removing markers of the same type as the new marker which touch it or intersect with it,
-        // adjusting the new marker's end offset to cover them if necessary.
-        while (j < numMarkers) {
-            DocumentMarker marker = list->at(j);
-            if (marker.startOffset() > toInsert.endOffset())
-                break;
-            if (marker.type() == toInsert.type() && marker.type() != DocumentMarker::TextMatch) {
-                list->remove(j);
-                if (toInsert.endOffset() <= marker.endOffset()) {
-                    toInsert.setEndOffset(marker.endOffset());
-                    break;
-                }
-                numMarkers--;
-            } else
-                j++;
-        }
-        // At this point i points to the node before which we want to insert.
-        list->insert(i, RenderedDocumentMarker(toInsert));
     }
 
     // repaint the affected node
@@ -194,6 +222,20 @@
         node->renderer()->repaint();
 }
 
+void DocumentMarkerController::mergeOverlapping(MarkerList* list, DocumentMarker& toInsert)
+{
+    MarkerList::iterator firstOverlapping = std::lower_bound(list->begin(), list->end(), toInsert, doesNotOverlap);
+    size_t index = firstOverlapping - list->begin();
+    list->insert(index, RenderedDocumentMarker(toInsert));
+    MarkerList::iterator inserted = list->begin() + index;
+    firstOverlapping = inserted + 1;
+    for (MarkerList::iterator i = firstOverlapping; i != list->end() && i->startOffset() <= inserted->endOffset(); ) {
+        inserted->setStartOffset(std::min(inserted->startOffset(), i->startOffset()));
+        inserted->setEndOffset(std::max(inserted->endOffset(), i->endOffset()));
+        list->remove(i - list->begin());
+    }
+}
+
 // copies markers from srcNode to dstNode, applying the specified shift delta to the copies.  The shift is
 // useful if, e.g., the caller has created the dstNode from a non-prefix substring of the srcNode.
 void DocumentMarkerController::copyMarkers(Node* srcNode, unsigned startOffset, int length, Node* dstNode, int delta)
@@ -205,32 +247,35 @@
         return;
     ASSERT(!m_markers.isEmpty());
 
-    MarkerList* list = m_markers.get(srcNode);
-    if (!list)
+    MarkerLists* markers = m_markers.get(srcNode);
+    if (!markers)
         return;
 
     bool docDirty = false;
-    unsigned endOffset = startOffset + length - 1;
-    for (size_t i = 0; i != list->size(); ++i) {
-        DocumentMarker marker = list->at(i);
-
-        // stop if we are now past the specified range
-        if (marker.startOffset() > endOffset)
-            break;
-
-        // skip marker that is before the specified range or is the wrong type
-        if (marker.endOffset() < startOffset)
+    for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+        OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+        if (!list)
             continue;
 
-        // pin the marker to the specified range and apply the shift delta
-        docDirty = true;
-        if (marker.startOffset() < startOffset)
-            marker.setStartOffset(startOffset);
-        if (marker.endOffset() > endOffset)
-            marker.setEndOffset(endOffset);
-        marker.shiftOffsets(delta);
+        unsigned endOffset = startOffset + length - 1;
+        MarkerList::iterator startPos = std::lower_bound(list->begin(), list->end(), startOffset, doesNotInclude);
+        for (MarkerList::iterator i = startPos; i != list->end(); ++i) {
+            DocumentMarker marker = *i;
 
-        addMarker(dstNode, marker);
+            // stop if we are now past the specified range
+            if (marker.startOffset() > endOffset)
+                break;
+
+            // pin the marker to the specified range and apply the shift delta
+            docDirty = true;
+            if (marker.startOffset() < startOffset)
+                marker.setStartOffset(startOffset);
+            if (marker.endOffset() > endOffset)
+                marker.setEndOffset(endOffset);
+            marker.shiftOffsets(delta);
+
+            addMarker(dstNode, marker);
+        }
     }
 
     // repaint the affected node
@@ -247,53 +292,68 @@
         return;
     ASSERT(!(m_markers.isEmpty()));
 
-    MarkerList* list = m_markers.get(node);
-    if (!list)
+    MarkerLists* markers = m_markers.get(node);
+    if (!markers)
         return;
 
     bool docDirty = false;
-    unsigned endOffset = startOffset + length;
-    for (size_t i = 0; i < list->size();) {
-        DocumentMarker marker = list->at(i);
-
-        // markers are returned in order, so stop if we are now past the specified range
-        if (marker.startOffset() >= endOffset)
-            break;
-
-        // skip marker that is wrong type or before target
-        if (marker.endOffset() <= startOffset || !markerTypes.contains(marker.type())) {
-            i++;
+    size_t emptyListsCount = 0;
+    for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+        OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+        if (!list || list->isEmpty()) {
+            if (list.get() && list->isEmpty())
+                list.clear();
+            ++emptyListsCount;
             continue;
         }
-
-        // at this point we know that marker and target intersect in some way
-        docDirty = true;
-
-        // pitch the old marker
-        list->remove(i);
-
-        if (shouldRemovePartiallyOverlappingMarker)
-            // Stop here. Don't add resulting slices back.
+        if (!markerTypes.contains(list->begin()->type()))
             continue;
+        unsigned endOffset = startOffset + length;
+        MarkerList::iterator startPos = std::upper_bound(list->begin(), list->end(), startOffset, endsBefore);
+        for (MarkerList::iterator i = startPos; i != list->end(); ) {
+            DocumentMarker marker = *i;
 
-        // add either of the resulting slices that are left after removing target
-        if (startOffset > marker.startOffset()) {
-            DocumentMarker newLeft = marker;
-            newLeft.setEndOffset(startOffset);
-            list->insert(i, RenderedDocumentMarker(newLeft));
-            // i now points to the newly-inserted node, but we want to skip that one
-            i++;
+            // markers are returned in order, so stop if we are now past the specified range
+            if (marker.startOffset() >= endOffset)
+                break;
+
+            // at this point we know that marker and target intersect in some way
+            docDirty = true;
+
+            // pitch the old marker
+            list->remove(i - list->begin());
+
+            if (shouldRemovePartiallyOverlappingMarker) {
+                // Stop here. Don't add resulting slices back.
+                continue;
+            }
+
+            // add either of the resulting slices that are left after removing target
+            if (startOffset > marker.startOffset()) {
+                DocumentMarker newLeft = marker;
+                newLeft.setEndOffset(startOffset);
+                size_t insertIndex = i - list->begin();
+                list->insert(insertIndex , RenderedDocumentMarker(newLeft));
+                // Move to the marker after the inserted one.
+                i = list->begin() + insertIndex + 1;
+            }
+            if (marker.endOffset() > endOffset) {
+                DocumentMarker newRight = marker;
+                newRight.setStartOffset(endOffset);
+                size_t insertIndex = i - list->begin();
+                list->insert(insertIndex, RenderedDocumentMarker(newRight));
+                // Move to the marker after the inserted one.
+                i = list->begin() + insertIndex + 1;
+            }
         }
-        if (marker.endOffset() > endOffset) {
-            DocumentMarker newRight = marker;
-            newRight.setStartOffset(endOffset);
-            list->insert(i, RenderedDocumentMarker(newRight));
-            // i now points to the newly-inserted node, but we want to skip that one
-            i++;
+
+        if (list->isEmpty()) {
+            list.clear();
+            ++emptyListsCount;
         }
     }
 
-    if (list->isEmpty()) {
+    if (emptyListsCount == DocumentMarker::MarkerTypeIndexesCount) {
         m_markers.remove(node);
         if (m_markers.isEmpty())
             m_possiblyExistingMarkerTypes = 0;
@@ -314,15 +374,12 @@
     MarkerMap::iterator end = m_markers.end();
     for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != end; ++nodeIterator) {
         // inner loop; process each marker in this node
-        MarkerList* list = nodeIterator->value.get();
-        unsigned markerCount = list->size();
+        MarkerLists* markers = nodeIterator->value.get();
+        OwnPtr<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(markerType)];
+        unsigned markerCount = list.get() ? list->size() : 0;
         for (unsigned markerIndex = 0; markerIndex < markerCount; ++markerIndex) {
             RenderedDocumentMarker& marker = list->at(markerIndex);
 
-            // skip marker that is wrong type
-            if (marker.type() != markerType)
-                continue;
-
             if (marker.contains(point))
                 return &marker;
         }
@@ -334,15 +391,21 @@
 Vector<DocumentMarker*> DocumentMarkerController::markersFor(Node* node, DocumentMarker::MarkerTypes markerTypes)
 {
     Vector<DocumentMarker*> result;
-    MarkerList* list = m_markers.get(node);
-    if (!list)
+
+    MarkerLists* markers = m_markers.get(node);
+    if (!markers)
         return result;
 
-    for (size_t i = 0; i < list->size(); ++i) {
-        if (markerTypes.contains(list->at(i).type()))
+    for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+        OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+        if (!list || list->isEmpty() || !markerTypes.contains(list->begin()->type()))
+            continue;
+
+        for (size_t i = 0; i < list->size(); ++i)
             result.append(&(list->at(i)));
     }
 
+    std::sort(result.begin(), result.end(), compareByStart);
     return result;
 }
 
@@ -350,9 +413,14 @@
 {
     Vector<DocumentMarker*> result;
     for (MarkerMap::iterator i = m_markers.begin(); i != m_markers.end(); ++i) {
-        for (size_t j = 0; j < i->value->size(); ++j)
-            result.append(&(i->value->at(j)));
+        MarkerLists* markers = i->value.get();
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            for (size_t j = 0; list.get() && j < list->size(); ++j)
+                result.append(&(list->at(j)));
+        }
     }
+    std::sort(result.begin(), result.end(), compareByStart);
     return result;
 }
 
@@ -398,19 +466,19 @@
     MarkerMap::iterator end = m_markers.end();
     for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != end; ++nodeIterator) {
         // inner loop; process each marker in this node
-        MarkerList* list = nodeIterator->value.get();
-        unsigned markerCount = list->size();
-        for (unsigned markerIndex = 0; markerIndex < markerCount; ++markerIndex) {
-            const RenderedDocumentMarker& marker = list->at(markerIndex);
-
-            // skip marker that is wrong type
-            if (marker.type() != markerType)
+        MarkerLists* markers = nodeIterator->value.get();
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            if (!list || list->isEmpty() || list->begin()->type() != markerType)
                 continue;
+            for (unsigned markerIndex = 0; markerIndex < list->size(); ++markerIndex) {
+                const RenderedDocumentMarker& marker = list->at(markerIndex);
 
-            if (!marker.isRendered())
-                continue;
+                if (!marker.isRendered())
+                    continue;
 
-            result.append(marker.renderedRect());
+                result.append(marker.renderedRect());
+            }
         }
     }
 
@@ -449,30 +517,32 @@
 void DocumentMarkerController::removeMarkersFromList(MarkerMap::iterator iterator, DocumentMarker::MarkerTypes markerTypes)
 {
     bool needsRepainting = false;
-    bool listCanBeRemoved;
+    bool nodeCanBeRemoved;
 
+    size_t emptyListsCount = 0;
     if (markerTypes == DocumentMarker::AllMarkers()) {
         needsRepainting = true;
-        listCanBeRemoved = true;
+        nodeCanBeRemoved = true;
     } else {
-        MarkerList* list = iterator->value.get();
+        MarkerLists* markers = iterator->value.get();
 
-        for (size_t i = 0; i != list->size(); ) {
-            DocumentMarker marker = list->at(i);
-
-            // skip nodes that are not of the specified type
-            if (!markerTypes.contains(marker.type())) {
-                ++i;
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            if (!list || list->isEmpty()) {
+                if (list.get() && list->isEmpty())
+                    list.clear();
+                ++emptyListsCount;
                 continue;
             }
-
-            // pitch the old marker
-            list->remove(i);
-            needsRepainting = true;
-            // i now is the index of the next marker
+            if (markerTypes.contains(list->begin()->type())) {
+                list->clear();
+                list.clear();
+                ++emptyListsCount;
+                needsRepainting = true;
+            }
         }
 
-        listCanBeRemoved = list->isEmpty();
+        nodeCanBeRemoved = emptyListsCount == DocumentMarker::MarkerTypeIndexesCount;
     }
 
     if (needsRepainting) {
@@ -480,7 +550,7 @@
             renderer->repaint();
     }
 
-    if (listCanBeRemoved) {
+    if (nodeCanBeRemoved) {
         m_markers.remove(iterator);
         if (m_markers.isEmpty())
             m_possiblyExistingMarkerTypes = 0;
@@ -499,24 +569,18 @@
         Node* node = i->key.get();
 
         // inner loop: process each marker in the current node
-        MarkerList* list = i->value.get();
-        bool nodeNeedsRepaint = false;
-        for (size_t i = 0; i != list->size(); ++i) {
-            DocumentMarker marker = list->at(i);
+        MarkerLists* markers = i->value.get();
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            if (!list || list->isEmpty() || !markerTypes.contains(list->begin()->type()))
+                continue;
 
-            // skip nodes that are not of the specified type
-            if (markerTypes.contains(marker.type())) {
-                nodeNeedsRepaint = true;
+            // cause the node to be redrawn
+            if (RenderObject* renderer = node->renderer()) {
+                renderer->repaint();
                 break;
             }
         }
-
-        if (!nodeNeedsRepaint)
-            continue;
-
-        // cause the node to be redrawn
-        if (RenderObject* renderer = node->renderer())
-            renderer->repaint();
     }
 }
 
@@ -527,9 +591,12 @@
     for (MarkerMap::iterator i = m_markers.begin(); i != end; ++i) {
 
         // inner loop: process each rect in the current node
-        MarkerList* list = i->value.get();
-        for (size_t listIndex = 0; listIndex < list->size(); ++listIndex)
-            list->at(listIndex).invalidate(r);
+        MarkerLists* markers = i->value.get();
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            for (size_t markerIndex = 0; list.get() && markerIndex < list->size(); ++markerIndex)
+                list->at(markerIndex).invalidate(r);
+        }
     }
 }
 
@@ -539,20 +606,23 @@
         return;
     ASSERT(!m_markers.isEmpty());
 
-    MarkerList* list = m_markers.get(node);
-    if (!list)
+    MarkerLists* markers = m_markers.get(node);
+    if (!markers)
         return;
 
     bool docDirty = false;
-    for (size_t i = 0; i != list->size(); ++i) {
-        RenderedDocumentMarker& marker = list->at(i);
-        if (marker.startOffset() >= startOffset) {
-            ASSERT((int)marker.startOffset() + delta >= 0);
-            marker.shiftOffsets(delta);
+    for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+        OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+        if (!list)
+            continue;
+        MarkerList::iterator startPos = std::lower_bound(list->begin(), list->end(), startOffset, startsAfter);
+        for (MarkerList::iterator marker = startPos; marker != list->end(); ++marker) {
+            ASSERT((int)marker->startOffset() + delta >= 0);
+            marker->shiftOffsets(delta);
             docDirty = true;
 
             // Marker moved, so previously-computed rendered rectangle is now invalid
-            marker.invalidate();
+            marker->invalidate();
         }
     }
 
@@ -581,23 +651,22 @@
 
 void DocumentMarkerController::setMarkersActive(Node* node, unsigned startOffset, unsigned endOffset, bool active)
 {
-    MarkerList* list = m_markers.get(node);
-    if (!list)
+    MarkerLists* markers = m_markers.get(node);
+    if (!markers)
         return;
 
     bool docDirty = false;
-    for (size_t i = 0; i != list->size(); ++i) {
-        DocumentMarker& marker = list->at(i);
+    OwnPtr<MarkerList>& list = (*markers)[MarkerTypeToMarkerIndex(DocumentMarker::TextMatch)];
+    if (!list)
+        return;
+    MarkerList::iterator startPos = std::upper_bound(list->begin(), list->end(), startOffset, endsBefore);
+    for (MarkerList::iterator marker = startPos; marker != list->end(); ++marker) {
 
         // Markers are returned in order, so stop if we are now past the specified range.
-        if (marker.startOffset() >= endOffset)
+        if (marker->startOffset() >= endOffset)
             break;
 
-        // Skip marker that is wrong type or before target.
-        if (marker.endOffset() <= startOffset || marker.type() != DocumentMarker::TextMatch)
-            continue;
-
-        marker.setActiveMatch(active);
+        marker->setActiveMatch(active);
         docDirty = true;
     }
 
@@ -643,10 +712,13 @@
     for (MarkerMap::const_iterator nodeIterator = m_markers.begin(); nodeIterator != end; ++nodeIterator) {
         Node* node = nodeIterator->key.get();
         fprintf(stderr, "%p", node);
-        MarkerList* list = nodeIterator->value.get();
-        for (unsigned markerIndex = 0; markerIndex < list->size(); ++markerIndex) {
-            const DocumentMarker& marker = list->at(markerIndex);
-            fprintf(stderr, " %d:[%d:%d](%d)", marker.type(), marker.startOffset(), marker.endOffset(), marker.activeMatch());
+        MarkerLists* markers = m_markers.get(node);
+        for (size_t markerListIndex = 0; markerListIndex < DocumentMarker::MarkerTypeIndexesCount; ++markerListIndex) {
+            OwnPtr<MarkerList>& list = (*markers)[markerListIndex];
+            for (unsigned markerIndex = 0; list.get() && markerIndex < list->size(); ++markerIndex) {
+                const DocumentMarker& marker = list->at(markerIndex);
+                fprintf(stderr, " %d:[%d:%d](%d)", marker.type(), marker.startOffset(), marker.endOffset(), marker.activeMatch());
+            }
         }
 
         fprintf(stderr, "\n");
diff --git a/Source/core/dom/DocumentMarkerController.h b/Source/core/dom/DocumentMarkerController.h
index 0b14aaa..d7da987 100644
--- a/Source/core/dom/DocumentMarkerController.h
+++ b/Source/core/dom/DocumentMarkerController.h
@@ -87,7 +87,9 @@
     void addMarker(Node*, const DocumentMarker&);
 
     typedef Vector<RenderedDocumentMarker> MarkerList;
-    typedef HashMap<RefPtr<Node>, OwnPtr<MarkerList> > MarkerMap;
+    typedef Vector<OwnPtr<MarkerList>, DocumentMarker::MarkerTypeIndexesCount> MarkerLists;
+    typedef HashMap<RefPtr<Node>, OwnPtr<MarkerLists> > MarkerMap;
+    void mergeOverlapping(MarkerList*, DocumentMarker&);
     bool possiblyHasMarkers(DocumentMarker::MarkerTypes);
     void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
 
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 1b732d9..7d79c45 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -52,9 +52,9 @@
 #include "core/dom/Document.h"
 #include "core/dom/DocumentSharedObjectPool.h"
 #include "core/dom/ElementRareData.h"
-#include "core/dom/EventDispatcher.h"
+#include "core/events/EventDispatcher.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/FocusEvent.h"
+#include "core/events/FocusEvent.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/MutationObserverInterestGroup.h"
 #include "core/dom/MutationRecord.h"
@@ -361,7 +361,7 @@
         return;
 
     size_t index = elementData()->getAttributeItemIndex(name);
-    if (index == notFound)
+    if (index == kNotFound)
         return;
 
     removeAttributeInternal(index, NotInSynchronizationOfLazyAttribute);
@@ -831,40 +831,40 @@
 void Element::setAttribute(const AtomicString& localName, const AtomicString& value, ExceptionState& es)
 {
     if (!Document::isValidName(localName)) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return;
     }
 
     synchronizeAttribute(localName);
     const AtomicString& caseAdjustedLocalName = shouldIgnoreAttributeCase(this) ? localName.lower() : localName;
 
-    size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdjustedLocalName, false) : notFound;
-    const QualifiedName& qName = index != notFound ? attributeItem(index)->name() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom);
+    size_t index = elementData() ? elementData()->getAttributeItemIndex(caseAdjustedLocalName, false) : kNotFound;
+    const QualifiedName& qName = index != kNotFound ? attributeItem(index)->name() : QualifiedName(nullAtom, caseAdjustedLocalName, nullAtom);
     setAttributeInternal(index, qName, value, NotInSynchronizationOfLazyAttribute);
 }
 
 void Element::setAttribute(const QualifiedName& name, const AtomicString& value)
 {
     synchronizeAttribute(name);
-    size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : notFound;
+    size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : kNotFound;
     setAttributeInternal(index, name, value, NotInSynchronizationOfLazyAttribute);
 }
 
 void Element::setSynchronizedLazyAttribute(const QualifiedName& name, const AtomicString& value)
 {
-    size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : notFound;
+    size_t index = elementData() ? elementData()->getAttributeItemIndex(name) : kNotFound;
     setAttributeInternal(index, name, value, InSynchronizationOfLazyAttribute);
 }
 
 inline void Element::setAttributeInternal(size_t index, const QualifiedName& name, const AtomicString& newValue, SynchronizationOfLazyAttribute inSynchronizationOfLazyAttribute)
 {
     if (newValue.isNull()) {
-        if (index != notFound)
+        if (index != kNotFound)
             removeAttributeInternal(index, inSynchronizationOfLazyAttribute);
         return;
     }
 
-    if (index == notFound) {
+    if (index == kNotFound) {
         addAttributeInternal(name, newValue, inSynchronizationOfLazyAttribute);
         return;
     }
@@ -968,7 +968,7 @@
 
     unsigned i = 0;
     do {
-        if (isNotHTMLSpace(characters[i]))
+        if (isNotHTMLSpace<CharacterType>(characters[i]))
             break;
         ++i;
     } while (i < length);
@@ -1606,7 +1606,7 @@
     // subtrees won't work well in that element. Until they are fixed, we disable
     // adding author shadow root for them.
     if (!areAuthorShadowsAllowed()) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return 0;
     }
     return ensureShadow()->addShadowRoot(this, ShadowRoot::AuthorShadowRoot);
@@ -1814,7 +1814,7 @@
 PassRefPtr<Attr> Element::setAttributeNode(Attr* attrNode, ExceptionState& es)
 {
     if (!attrNode) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return 0;
     }
 
@@ -1825,7 +1825,7 @@
     // InUseAttributeError: Raised if node is an Attr that is already an attribute of another Element object.
     // The DOM user must explicitly clone Attr nodes to re-use them in other elements.
     if (attrNode->ownerElement()) {
-        es.throwDOMException(InUseAttributeError);
+        es.throwUninformativeAndGenericDOMException(InUseAttributeError);
         return 0;
     }
 
@@ -1833,7 +1833,7 @@
     UniqueElementData* elementData = ensureUniqueElementData();
 
     size_t index = elementData->getAttributeItemIndex(attrNode->qualifiedName(), shouldIgnoreAttributeCase(this));
-    if (index != notFound) {
+    if (index != kNotFound) {
         if (oldAttrNode)
             detachAttrNodeFromElementWithValue(oldAttrNode.get(), elementData->attributeItem(index)->value());
         else
@@ -1857,11 +1857,11 @@
 PassRefPtr<Attr> Element::removeAttributeNode(Attr* attr, ExceptionState& es)
 {
     if (!attr) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return 0;
     }
     if (attr->ownerElement() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
 
@@ -1870,8 +1870,8 @@
     synchronizeAttribute(attr->qualifiedName());
 
     size_t index = elementData()->getAttrIndex(attr);
-    if (index == notFound) {
-        es.throwDOMException(NotFoundError);
+    if (index == kNotFound) {
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
 
@@ -1890,7 +1890,7 @@
     QualifiedName qName(prefix, localName, namespaceURI);
 
     if (!Document::hasValidNamespaceForAttributes(qName)) {
-        es.throwDOMException(NamespaceError);
+        es.throwUninformativeAndGenericDOMException(NamespaceError);
         return false;
     }
 
@@ -1945,7 +1945,7 @@
 
     AtomicString localName = shouldIgnoreAttributeCase(this) ? name.lower() : name;
     size_t index = elementData()->getAttributeItemIndex(localName, false);
-    if (index == notFound) {
+    if (index == kNotFound) {
         if (UNLIKELY(localName == styleAttr) && elementData()->m_styleAttributeIsDirty && isStyledElement())
             removeAllInlineStyleProperties();
         return;
@@ -2506,7 +2506,7 @@
 bool Element::webkitMatchesSelector(const String& selector, ExceptionState& es)
 {
     if (selector.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return false;
     }
 
@@ -3611,7 +3611,7 @@
         if (attributeItem(i)->name() == attr->qualifiedName())
             return i;
     }
-    return notFound;
+    return kNotFound;
 }
 
 size_t ElementData::getAttributeItemIndexSlowCase(const AtomicString& name, bool shouldIgnoreAttributeCase) const
@@ -3630,7 +3630,7 @@
                 return i;
         }
     }
-    return notFound;
+    return kNotFound;
 }
 
 Attribute* UniqueElementData::getAttributeItem(const QualifiedName& name)
diff --git a/Source/core/dom/Element.h b/Source/core/dom/Element.h
index a1bf613..9d1ad83 100644
--- a/Source/core/dom/Element.h
+++ b/Source/core/dom/Element.h
@@ -1035,7 +1035,7 @@
 inline const Attribute* ElementData::getAttributeItem(const AtomicString& name, bool shouldIgnoreAttributeCase) const
 {
     size_t index = getAttributeItemIndex(name, shouldIgnoreAttributeCase);
-    if (index != notFound)
+    if (index != kNotFound)
         return attributeItem(index);
     return 0;
 }
@@ -1055,7 +1055,7 @@
         if (attribute.name().matchesPossiblyIgnoringCase(name, shouldIgnoreCase))
             return i;
     }
-    return notFound;
+    return kNotFound;
 }
 
 // We use a boolean parameter instead of calling shouldIgnoreAttributeCase so that the caller
@@ -1078,7 +1078,7 @@
 
     if (doSlowCheck)
         return getAttributeItemIndexSlowCase(name, shouldIgnoreAttributeCase);
-    return notFound;
+    return kNotFound;
 }
 
 inline const Attribute* ElementData::getAttributeItem(const QualifiedName& name) const
diff --git a/Source/core/dom/FullscreenElementStack.cpp b/Source/core/dom/FullscreenElementStack.cpp
index ae70534..b8654e8 100644
--- a/Source/core/dom/FullscreenElementStack.cpp
+++ b/Source/core/dom/FullscreenElementStack.cpp
@@ -32,7 +32,7 @@
 #include "bindings/v8/ScriptController.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
@@ -367,11 +367,6 @@
 
     m_fullScreenElement = element;
 
-#if USE(NATIVE_FULLSCREEN_VIDEO)
-    if (element && element->isMediaElement())
-        return;
-#endif
-
     // Create a placeholder block for a the full-screen element, to keep the page from reflowing
     // when the element is removed from the normal flow. Only do this for a RenderBox, as only
     // a box will have a frameRect. The placeholder will be created in setFullScreenRenderer()
diff --git a/Source/core/dom/MessagePort.cpp b/Source/core/dom/MessagePort.cpp
index 9b3f1cd..b626623 100644
--- a/Source/core/dom/MessagePort.cpp
+++ b/Source/core/dom/MessagePort.cpp
@@ -30,9 +30,9 @@
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/MessageEvent.h"
 #include "core/page/DOMWindow.h"
 #include "core/workers/WorkerGlobalScope.h"
 #include "wtf/text/AtomicString.h"
@@ -69,7 +69,7 @@
         for (unsigned int i = 0; i < ports->size(); ++i) {
             MessagePort* dataPort = (*ports)[i].get();
             if (dataPort == this || m_entangledChannel->isConnectedTo(dataPort)) {
-                es.throwDOMException(DataCloneError);
+                es.throwUninformativeAndGenericDOMException(DataCloneError);
                 return;
             }
         }
@@ -202,7 +202,7 @@
     for (unsigned int i = 0; i < ports->size(); ++i) {
         MessagePort* port = (*ports)[i].get();
         if (!port || port->isNeutered() || portSet.contains(port)) {
-            es.throwDOMException(DataCloneError);
+            es.throwUninformativeAndGenericDOMException(DataCloneError);
             return nullptr;
         }
         portSet.add(port);
diff --git a/Source/core/dom/MessagePort.h b/Source/core/dom/MessagePort.h
index 34773c9..53df123 100644
--- a/Source/core/dom/MessagePort.h
+++ b/Source/core/dom/MessagePort.h
@@ -28,8 +28,8 @@
 #define MessagePort_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/MessagePortChannel.h"
 #include "wtf/Forward.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/core/dom/MutationObserver.cpp b/Source/core/dom/MutationObserver.cpp
index e2d5fec..36d1100 100644
--- a/Source/core/dom/MutationObserver.cpp
+++ b/Source/core/dom/MutationObserver.cpp
@@ -84,7 +84,7 @@
 void MutationObserver::observe(Node* node, const Dictionary& optionsDictionary, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -111,7 +111,7 @@
         options |= AttributeFilter;
 
     if (!validateOptions(options)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
diff --git a/Source/core/dom/NamedFlow.cpp b/Source/core/dom/NamedFlow.cpp
index 013b0eb..36c3952 100644
--- a/Source/core/dom/NamedFlow.cpp
+++ b/Source/core/dom/NamedFlow.cpp
@@ -31,10 +31,10 @@
 #include "core/dom/NamedFlow.h"
 
 #include "RuntimeEnabledFeatures.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NamedFlowCollection.h"
 #include "core/dom/StaticNodeList.h"
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 #include "core/rendering/RenderNamedFlowThread.h"
 #include "core/rendering/RenderRegion.h"
 
diff --git a/Source/core/dom/NamedFlow.h b/Source/core/dom/NamedFlow.h
index 13306cc..1bc5ce3 100644
--- a/Source/core/dom/NamedFlow.h
+++ b/Source/core/dom/NamedFlow.h
@@ -31,7 +31,7 @@
 #define NamedFlow_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
 #include "wtf/text/AtomicString.h"
diff --git a/Source/core/dom/NamedNodeMap.cpp b/Source/core/dom/NamedNodeMap.cpp
index 1e2d022..6bce778 100644
--- a/Source/core/dom/NamedNodeMap.cpp
+++ b/Source/core/dom/NamedNodeMap.cpp
@@ -62,9 +62,9 @@
 
 PassRefPtr<Node> NamedNodeMap::removeNamedItem(const AtomicString& name, ExceptionState& es)
 {
-    size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex(name, shouldIgnoreAttributeCase(m_element)) : notFound;
-    if (index == notFound) {
-        es.throwDOMException(NotFoundError);
+    size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex(name, shouldIgnoreAttributeCase(m_element)) : kNotFound;
+    if (index == kNotFound) {
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
     return m_element->detachAttribute(index);
@@ -72,9 +72,9 @@
 
 PassRefPtr<Node> NamedNodeMap::removeNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName, ExceptionState& es)
 {
-    size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex(QualifiedName(nullAtom, localName, namespaceURI)) : notFound;
-    if (index == notFound) {
-        es.throwDOMException(NotFoundError);
+    size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex(QualifiedName(nullAtom, localName, namespaceURI)) : kNotFound;
+    if (index == kNotFound) {
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
     return m_element->detachAttribute(index);
@@ -83,13 +83,13 @@
 PassRefPtr<Node> NamedNodeMap::setNamedItem(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
 
     // Not mentioned in spec: throw a HIERARCHY_REQUEST_ERROR if the user passes in a non-attribute node
     if (!node->isAttributeNode()) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return 0;
     }
 
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index f6a2d3e..e299a9a 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -33,7 +33,7 @@
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/Attr.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/BeforeLoadEvent.h"
+#include "core/events/BeforeLoadEvent.h"
 #include "core/dom/ChildListMutationScope.h"
 #include "core/dom/ChildNodeList.h"
 #include "core/dom/ClassNodeList.h"
@@ -43,17 +43,17 @@
 #include "core/dom/DocumentType.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementRareData.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/GestureEvent.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/GestureEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/LiveNodeList.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/MutationEvent.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/MutationEvent.h"
 #include "core/dom/NameNodeList.h"
 #include "core/dom/NodeRareData.h"
 #include "core/dom/NodeTraversal.h"
@@ -62,14 +62,14 @@
 #include "core/dom/TagNodeList.h"
 #include "core/dom/TemplateContentDocumentFragment.h"
 #include "core/dom/Text.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/TextEvent.h"
 #include "core/dom/TouchController.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/TreeScopeAdopter.h"
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 #include "core/dom/UserActionElementSet.h"
 #include "core/dom/WheelController.h"
-#include "core/dom/WheelEvent.h"
+#include "core/events/WheelEvent.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/InsertionPoint.h"
 #include "core/dom/shadow/ShadowRoot.h"
@@ -461,7 +461,7 @@
     if (isContainerNode())
         toContainerNode(this)->insertBefore(newChild, refChild, es);
     else
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
 }
 
 void Node::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, ExceptionState& es)
@@ -469,7 +469,7 @@
     if (isContainerNode())
         toContainerNode(this)->replaceChild(newChild, oldChild, es);
     else
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
 }
 
 void Node::removeChild(Node* oldChild, ExceptionState& es)
@@ -477,7 +477,7 @@
     if (isContainerNode())
         toContainerNode(this)->removeChild(oldChild, es);
     else
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
 }
 
 void Node::appendChild(PassRefPtr<Node> newChild, ExceptionState& es)
@@ -485,7 +485,7 @@
     if (isContainerNode())
         toContainerNode(this)->appendChild(newChild, es);
     else
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
 }
 
 void Node::remove(ExceptionState& es)
@@ -510,41 +510,10 @@
         if (node == this)
             break;
 
-        if (type != TEXT_NODE) {
+        if (type == TEXT_NODE)
+            node = toText(node.get())->mergeNextSiblingNodesIfPossible();
+        else
             node = NodeTraversal::nextPostOrder(node.get());
-            continue;
-        }
-
-        RefPtr<Text> text = toText(node.get());
-
-        // Remove empty text nodes.
-        if (!text->length()) {
-            // Care must be taken to get the next node before removing the current node.
-            node = NodeTraversal::nextPostOrder(node.get());
-            text->remove(IGNORE_EXCEPTION);
-            continue;
-        }
-
-        // Merge text nodes.
-        while (Node* nextSibling = node->nextSibling()) {
-            if (nextSibling->nodeType() != TEXT_NODE)
-                break;
-            RefPtr<Text> nextText = toText(nextSibling);
-
-            // Remove empty text nodes.
-            if (!nextText->length()) {
-                nextText->remove(IGNORE_EXCEPTION);
-                continue;
-            }
-
-            // Both non-empty text nodes. Merge them.
-            unsigned offset = text->length();
-            text->appendData(nextText->data());
-            document().didMergeTextNodes(nextText.get(), offset);
-            nextText->remove(IGNORE_EXCEPTION);
-        }
-
-        node = NodeTraversal::nextPostOrder(node.get());
     }
 }
 
@@ -559,7 +528,7 @@
     // The spec says that for nodes other than elements and attributes, prefix is always null.
     // It does not say what to do when the user tries to set the prefix on another type of
     // node, however Mozilla throws a NamespaceError exception.
-    es.throwDOMException(NamespaceError);
+    es.throwUninformativeAndGenericDOMException(NamespaceError);
 }
 
 const AtomicString& Node::localName() const
@@ -892,7 +861,7 @@
     // Element::setPrefix() and Attr::setPrefix()
 
     if (!prefix.isEmpty() && !Document::isValidName(prefix)) {
-        es.throwDOMException(InvalidCharacterError);
+        es.throwUninformativeAndGenericDOMException(InvalidCharacterError);
         return;
     }
 
@@ -1301,7 +1270,7 @@
 PassRefPtr<Element> Node::querySelector(const AtomicString& selectors, ExceptionState& es)
 {
     if (selectors.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -1314,7 +1283,7 @@
 PassRefPtr<NodeList> Node::querySelectorAll(const AtomicString& selectors, ExceptionState& es)
 {
     if (selectors.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -2249,8 +2218,8 @@
         return;
 
     size_t index = registry->find(registration);
-    ASSERT(index != notFound);
-    if (index == notFound)
+    ASSERT(index != kNotFound);
+    if (index == kNotFound)
         return;
 
     // Deleting the registration may cause this node to be derefed, so we must make sure the Vector operation completes
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 58738dc..612111e 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -27,7 +27,7 @@
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/MutationObserver.h"
 #include "core/dom/SimulatedClickOptions.h"
 #include "core/dom/TreeScope.h"
diff --git a/Source/core/dom/NodeRenderingContext.cpp b/Source/core/dom/NodeRenderingContext.cpp
index 236ac4f..60d7d94 100644
--- a/Source/core/dom/NodeRenderingContext.cpp
+++ b/Source/core/dom/NodeRenderingContext.cpp
@@ -72,7 +72,7 @@
 
         const Vector<RefPtr<Element> >& topLayerElements = element->document().topLayerElements();
         size_t position = topLayerElements.find(element);
-        ASSERT(position != notFound);
+        ASSERT(position != kNotFound);
         for (size_t i = position + 1; i < topLayerElements.size(); ++i) {
             if (RenderObject* renderer = topLayerElements[i]->renderer())
                 return renderer;
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index 646f305..8d52a1e 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -674,7 +674,7 @@
                     otherBox = otherBox->nextLeafChild();
                     if (!otherBox)
                         break;
-                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && static_cast<InlineTextBox*>(otherBox)->start() > textOffset))
+                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && toInlineTextBox(otherBox)->start() > textOffset))
                         continuesOnNextLine = false;
                 }
 
@@ -683,7 +683,7 @@
                     otherBox = otherBox->prevLeafChild();
                     if (!otherBox)
                         break;
-                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && static_cast<InlineTextBox*>(otherBox)->start() > textOffset))
+                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && toInlineTextBox(otherBox)->start() > textOffset))
                         continuesOnNextLine = false;
                 }
 
@@ -798,7 +798,7 @@
                     otherBox = otherBox->nextLeafChild();
                     if (!otherBox)
                         break;
-                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && static_cast<InlineTextBox*>(otherBox)->start() >= textOffset))
+                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && toInlineTextBox(otherBox)->start() >= textOffset))
                         continuesOnNextLine = false;
                 }
 
@@ -807,7 +807,7 @@
                     otherBox = otherBox->prevLeafChild();
                     if (!otherBox)
                         break;
-                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && static_cast<InlineTextBox*>(otherBox)->start() >= textOffset))
+                    if (otherBox == lastTextBox || (otherBox->renderer() == textRenderer && toInlineTextBox(otherBox)->start() >= textOffset))
                         continuesOnNextLine = false;
                 }
 
diff --git a/Source/core/dom/Promise.idl b/Source/core/dom/Promise.idl
index 3413c52..f7fb7ba 100644
--- a/Source/core/dom/Promise.idl
+++ b/Source/core/dom/Promise.idl
@@ -28,7 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-callback PromiseInit = void (PromiseResolver resolver);
+callback PromiseInit = void (any resolve, any reject);
 callback AnyCallback = any (optional any value);
 [
    GlobalContext=Window&WorkerGlobalScope,
@@ -38,11 +38,9 @@
    [Custom] Promise then(optional AnyCallback fulfillCallback, optional AnyCallback rejectCallback);
    [Custom] Promise catch(optional AnyCallback rejectCallback);
 
-   [Custom] static Promise fulfill(any value);
    [Custom] static Promise resolve(any value);
    [Custom] static Promise reject(any value);
 
    [Custom] static Promise _any(any... values);
    [Custom] static Promise every(any... values);
-   [Custom] static Promise some(any... values);
 };
diff --git a/Source/core/dom/PseudoElement.cpp b/Source/core/dom/PseudoElement.cpp
index e397b9b..9c10bd0 100644
--- a/Source/core/dom/PseudoElement.cpp
+++ b/Source/core/dom/PseudoElement.cpp
@@ -62,10 +62,6 @@
     setHasCustomStyleCallbacks();
 }
 
-PseudoElement::~PseudoElement()
-{
-}
-
 PassRefPtr<RenderStyle> PseudoElement::customStyleForRenderer()
 {
     return parentOrShadowHostElement()->renderer()->getCachedPseudoStyle(m_pseudoId);
diff --git a/Source/core/dom/PseudoElement.h b/Source/core/dom/PseudoElement.h
index 0bd4984..a0ddf69 100644
--- a/Source/core/dom/PseudoElement.h
+++ b/Source/core/dom/PseudoElement.h
@@ -39,7 +39,6 @@
     {
         return adoptRef(new PseudoElement(parent, pseudoId));
     }
-    ~PseudoElement();
 
     virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
     virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
@@ -70,6 +69,21 @@
     return style && style->display() != NONE && (style->styleType() == BACKDROP || style->contentData() || !style->regionThread().isEmpty());
 }
 
+inline PseudoElement* toPseudoElement(Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isPseudoElement());
+    return static_cast<PseudoElement*>(node);
+}
+
+inline const PseudoElement* toPseudoElement(const Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isPseudoElement());
+    return static_cast<const PseudoElement*>(node);
+}
+
+// This will catch anyone doing an unnecessary cast.
+void toPseudoElement(const PseudoElement*);
+
 } // namespace
 
 #endif
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index a6a6d7d..9c1900a 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -36,7 +36,7 @@
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/NodeWithIndex.h"
 #include "core/dom/ProcessingInstruction.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/Text.h"
 #include "core/editing/TextIterator.h"
 #include "core/editing/VisiblePosition.h"
@@ -131,7 +131,7 @@
 Node* Range::startContainer(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("startContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -141,7 +141,7 @@
 int Range::startOffset(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("startOffset", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -151,7 +151,7 @@
 Node* Range::endContainer(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("endContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -161,7 +161,7 @@
 int Range::endOffset(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("endOffset", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -171,7 +171,7 @@
 Node* Range::commonAncestorContainer(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("commonAncestorContainer", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -192,7 +192,7 @@
 bool Range::collapsed(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapsed", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -214,12 +214,12 @@
 void Range::setStart(PassRefPtr<Node> refNode, int offset, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setStart", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -242,12 +242,12 @@
 void Range::setEnd(PassRefPtr<Node> refNode, int offset, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("setEnd", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -282,7 +282,7 @@
 void Range::collapse(bool toStart, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("collapse", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
@@ -295,12 +295,12 @@
 bool Range::isPointInRange(Node* refNode, int offset, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("isPointInRange", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return false;
     }
 
     if (!refNode) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return false;
     }
 
@@ -323,17 +323,17 @@
     // refNode node and an offset within the node is before, same as, or after the range respectively.
 
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("comparePoint", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
     if (!refNode) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return 0;
     }
 
     if (!refNode->attached() || &refNode->document() != m_ownerDocument) {
-        es.throwDOMException(WrongDocumentError);
+        es.throwUninformativeAndGenericDOMException(WrongDocumentError);
         return 0;
     }
 
@@ -363,12 +363,12 @@
     // before and after(surrounds), or inside the range, respectively
 
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return NODE_BEFORE;
     }
 
     if (!m_start.container() && refNode->attached()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return NODE_BEFORE;
     }
 
@@ -388,7 +388,7 @@
     if (!parentNode) {
         // if the node is the top document we should return NODE_BEFORE_AND_AFTER
         // but we throw to match firefox behavior
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return NODE_BEFORE;
     }
 
@@ -406,12 +406,12 @@
 short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("compareBoundaryPoints", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
     if (!sourceRange) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
 
@@ -423,7 +423,7 @@
         return 0;
 
     if (&thisCont->document() != &sourceCont->document()) {
-        es.throwDOMException(WrongDocumentError);
+        es.throwUninformativeAndGenericDOMException(WrongDocumentError);
         return 0;
     }
 
@@ -434,7 +434,7 @@
     while (sourceTop->parentNode())
         sourceTop = sourceTop->parentNode();
     if (thisTop != sourceTop) { // in different DocumentFragments
-        es.throwDOMException(WrongDocumentError);
+        es.throwUninformativeAndGenericDOMException(WrongDocumentError);
         return 0;
     }
 
@@ -449,7 +449,7 @@
             return compareBoundaryPoints(m_start, sourceRange->m_end, es);
     }
 
-    es.throwDOMException(SyntaxError);
+    es.throwUninformativeAndGenericDOMException(SyntaxError);
     return 0;
 }
 
@@ -515,7 +515,7 @@
     // ### we need to do a traversal here instead
     Node* commonAncestor = commonAncestorContainer(containerA, containerB);
     if (!commonAncestor) {
-        es.throwDOMException(WrongDocumentError);
+        es.throwUninformativeAndGenericDOMException(WrongDocumentError);
         return 0;
     }
     Node* childA = containerA;
@@ -559,7 +559,7 @@
 
 void Range::deleteContents(ExceptionState& es)
 {
-    checkDeleteExtract(es);
+    checkDeleteExtract("deleteContents", es);
     if (es.hadException())
         return;
 
@@ -573,11 +573,11 @@
 
     // Throw exception if the range is already detached.
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("intersectsNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return false;
     }
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -592,7 +592,7 @@
     if (!parentNode) {
         // if the node is the top document we should return NODE_BEFORE_AND_AFTER
         // but we throw to match firefox behavior
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -928,7 +928,7 @@
 
 PassRefPtr<DocumentFragment> Range::extractContents(ExceptionState& es)
 {
-    checkDeleteExtract(es);
+    checkDeleteExtract("extractContents", es);
     if (es.hadException())
         return 0;
 
@@ -938,7 +938,7 @@
 PassRefPtr<DocumentFragment> Range::cloneContents(ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("cloneContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -950,12 +950,12 @@
     RefPtr<Node> newNode = prpNewNode;
 
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("insertNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!newNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -965,7 +965,7 @@
     // an extra one here - if a text node is going to split, it must have a parent to insert into
     bool startIsText = m_start.container()->isTextNode();
     if (startIsText && !m_start.container()->parentNode()) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return;
     }
 
@@ -984,7 +984,7 @@
         numNewChildren = 0;
         for (Node* c = newNode->firstChild(); c; c = c->nextSibling()) {
             if (!checkAgainst->childTypeAllowed(c->nodeType())) {
-                es.throwDOMException(HierarchyRequestError);
+                es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
                 return;
             }
             ++numNewChildren;
@@ -992,14 +992,14 @@
     } else {
         numNewChildren = 1;
         if (!checkAgainst->childTypeAllowed(newNodeType)) {
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return;
         }
     }
 
     for (Node* n = m_start.container(); n; n = n->parentNode()) {
         if (n == newNode) {
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return;
         }
     }
@@ -1010,11 +1010,11 @@
     case Node::ENTITY_NODE:
     case Node::NOTATION_NODE:
     case Node::DOCUMENT_NODE:
-        es.throwDOMException(InvalidNodeTypeError);
+        es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
         return;
     default:
         if (newNode->isShadowRoot()) {
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return;
         }
         break;
@@ -1055,7 +1055,7 @@
 String Range::toString(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("toString", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return String();
     }
 
@@ -1095,13 +1095,13 @@
 PassRefPtr<DocumentFragment> Range::createContextualFragment(const String& markup, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("createContextualFragment", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
     Node* element = m_start.container()->isElementNode() ? m_start.container() : m_start.container()->parentNode();
     if (!element || !element->isHTMLElement()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -1117,7 +1117,7 @@
 {
     // Check first to see if we've already detached:
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("detach", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
@@ -1133,17 +1133,17 @@
         case Node::DOCUMENT_TYPE_NODE:
         case Node::ENTITY_NODE:
         case Node::NOTATION_NODE:
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return 0;
         case Node::CDATA_SECTION_NODE:
         case Node::COMMENT_NODE:
         case Node::TEXT_NODE:
             if (static_cast<unsigned>(offset) > toCharacterData(n)->length())
-                es.throwDOMException(IndexSizeError);
+                es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return 0;
         case Node::PROCESSING_INSTRUCTION_NODE:
             if (static_cast<unsigned>(offset) > toProcessingInstruction(n)->data().length())
-                es.throwDOMException(IndexSizeError);
+                es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return 0;
         case Node::ATTRIBUTE_NODE:
         case Node::DOCUMENT_FRAGMENT_NODE:
@@ -1154,7 +1154,7 @@
                 return 0;
             Node* childBefore = n->childNode(offset - 1);
             if (!childBefore)
-                es.throwDOMException(IndexSizeError);
+                es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return childBefore;
         }
     }
@@ -1162,15 +1162,15 @@
     return 0;
 }
 
-void Range::checkNodeBA(Node* n, ExceptionState& es, const char* methodName) const
+void Range::checkNodeBA(Node* n, const String& methodName, ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute(methodName, "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!n) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -1189,7 +1189,7 @@
         case Node::DOCUMENT_NODE:
         case Node::ENTITY_NODE:
         case Node::NOTATION_NODE:
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return;
         case Node::CDATA_SECTION_NODE:
         case Node::COMMENT_NODE:
@@ -1219,7 +1219,7 @@
         case Node::PROCESSING_INSTRUCTION_NODE:
         case Node::TEXT_NODE:
         case Node::XPATH_NAMESPACE_NODE:
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return;
     }
 }
@@ -1227,7 +1227,7 @@
 PassRefPtr<Range> Range::cloneRange(ExceptionState& es) const
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("cloneRange", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return 0;
     }
 
@@ -1236,7 +1236,7 @@
 
 void Range::setStartAfter(Node* refNode, ExceptionState& es)
 {
-    checkNodeBA(refNode, es, "setStartAfter");
+    checkNodeBA(refNode, "setStartAfter", es);
     if (es.hadException())
         return;
 
@@ -1245,7 +1245,7 @@
 
 void Range::setEndBefore(Node* refNode, ExceptionState& es)
 {
-    checkNodeBA(refNode, es, "setEndBefore");
+    checkNodeBA(refNode, "setEndBefore", es);
     if (es.hadException())
         return;
 
@@ -1254,7 +1254,7 @@
 
 void Range::setEndAfter(Node* refNode, ExceptionState& es)
 {
-    checkNodeBA(refNode, es, "setEndAfter");
+    checkNodeBA(refNode, "setEndAfter", es);
     if (es.hadException())
         return;
 
@@ -1264,12 +1264,12 @@
 void Range::selectNode(Node* refNode, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("selectNode", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -1296,7 +1296,7 @@
             case Node::DOCUMENT_TYPE_NODE:
             case Node::ENTITY_NODE:
             case Node::NOTATION_NODE:
-                es.throwDOMException(InvalidNodeTypeError);
+                es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
                 return;
         }
     }
@@ -1315,7 +1315,7 @@
         case Node::DOCUMENT_NODE:
         case Node::ENTITY_NODE:
         case Node::NOTATION_NODE:
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return;
     }
 
@@ -1329,12 +1329,12 @@
 void Range::selectNodeContents(Node* refNode, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("selectNodeContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!refNode) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -1355,7 +1355,7 @@
             case Node::DOCUMENT_TYPE_NODE:
             case Node::ENTITY_NODE:
             case Node::NOTATION_NODE:
-                es.throwDOMException(InvalidNodeTypeError);
+                es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
                 return;
         }
     }
@@ -1372,12 +1372,12 @@
     RefPtr<Node> newParent = passNewParent;
 
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute("surroundContents", "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
     if (!newParent) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
@@ -1390,7 +1390,7 @@
         case Node::DOCUMENT_TYPE_NODE:
         case Node::ENTITY_NODE:
         case Node::NOTATION_NODE:
-            es.throwDOMException(InvalidNodeTypeError);
+            es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
             return;
         case Node::CDATA_SECTION_NODE:
         case Node::COMMENT_NODE:
@@ -1410,12 +1410,12 @@
     if (parentOfNewParent->isCharacterDataNode())
         parentOfNewParent = parentOfNewParent->parentNode();
     if (!parentOfNewParent || !parentOfNewParent->childTypeAllowed(newParent->nodeType())) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return;
     }
 
     if (newParent->contains(m_start.container())) {
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
         return;
     }
 
@@ -1430,7 +1430,7 @@
     if (endNonTextContainer->nodeType() == Node::TEXT_NODE)
         endNonTextContainer = endNonTextContainer->parentNode();
     if (startNonTextContainer != endNonTextContainer) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -1453,17 +1453,17 @@
 
 void Range::setStartBefore(Node* refNode, ExceptionState& es)
 {
-    checkNodeBA(refNode, es, "setStartBefore");
+    checkNodeBA(refNode, "setStartBefore", es);
     if (es.hadException())
         return;
 
     setStart(refNode->parentNode(), refNode->nodeIndex(), es);
 }
 
-void Range::checkDeleteExtract(ExceptionState& es)
+void Range::checkDeleteExtract(const String& methodName, ExceptionState& es)
 {
     if (!m_start.container()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwDOMException(InvalidStateError, ExceptionMessages::failedToExecute(methodName, "Range", "The range has no container. Perhaps 'detatch()' has been invoked on this object?"));
         return;
     }
 
@@ -1473,7 +1473,7 @@
     Node* pastLast = pastLastNode();
     for (Node* n = firstNode(); n != pastLast; n = NodeTraversal::next(n)) {
         if (n->nodeType() == Node::DOCUMENT_TYPE_NODE) {
-            es.throwDOMException(HierarchyRequestError);
+            es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
             return;
         }
     }
diff --git a/Source/core/dom/Range.h b/Source/core/dom/Range.h
index 8850144..82b716c 100644
--- a/Source/core/dom/Range.h
+++ b/Source/core/dom/Range.h
@@ -156,8 +156,8 @@
     void setDocument(Document&);
 
     Node* checkNodeWOffset(Node*, int offset, ExceptionState&) const;
-    void checkNodeBA(Node*, ExceptionState&, const char* methodName) const;
-    void checkDeleteExtract(ExceptionState&);
+    void checkNodeBA(Node*, const String& methodName, ExceptionState&) const;
+    void checkDeleteExtract(const String& methodName, ExceptionState&);
     int maxStartOffset() const;
     int maxEndOffset() const;
 
diff --git a/Source/core/dom/ScriptExecutionContext.cpp b/Source/core/dom/ScriptExecutionContext.cpp
index 9ac54d9..bc013a3 100644
--- a/Source/core/dom/ScriptExecutionContext.cpp
+++ b/Source/core/dom/ScriptExecutionContext.cpp
@@ -29,8 +29,8 @@
 #include "core/dom/ScriptExecutionContext.h"
 
 #include "core/dom/ContextLifecycleNotifier.h"
-#include "core/dom/ErrorEvent.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/ErrorEvent.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/MessagePort.h"
 #include "core/html/PublicURLManager.h"
 #include "core/inspector/InspectorInstrumentation.h"
diff --git a/Source/core/dom/ScriptExecutionContext.h b/Source/core/dom/ScriptExecutionContext.h
index a595aa1..2f52840 100644
--- a/Source/core/dom/ScriptExecutionContext.h
+++ b/Source/core/dom/ScriptExecutionContext.h
@@ -29,7 +29,7 @@
 #define ScriptExecutionContext_h
 
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/ErrorEvent.h"
+#include "core/events/ErrorEvent.h"
 #include "core/dom/SecurityContext.h"
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/page/ConsoleTypes.h"
diff --git a/Source/core/dom/ScriptLoader.cpp b/Source/core/dom/ScriptLoader.cpp
index 0345ad9..d39efef 100644
--- a/Source/core/dom/ScriptLoader.cpp
+++ b/Source/core/dom/ScriptLoader.cpp
@@ -29,7 +29,7 @@
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptSourceCode.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h"
 #include "core/dom/ScriptLoaderClient.h"
 #include "core/dom/ScriptRunner.h"
diff --git a/Source/core/dom/SecurityContext.cpp b/Source/core/dom/SecurityContext.cpp
index f1375e0..c81e923 100644
--- a/Source/core/dom/SecurityContext.cpp
+++ b/Source/core/dom/SecurityContext.cpp
@@ -94,12 +94,12 @@
     unsigned numberOfTokenErrors = 0;
     StringBuilder tokenErrors;
     while (true) {
-        while (start < length && isHTMLSpace(policy[start]))
+        while (start < length && isHTMLSpace<UChar>(policy[start]))
             ++start;
         if (start >= length)
             break;
         unsigned end = start + 1;
-        while (end < length && !isHTMLSpace(policy[end]))
+        while (end < length && !isHTMLSpace<UChar>(policy[end]))
             ++end;
 
         // Turn off the corresponding sandbox flag if it's set as "allowed".
diff --git a/Source/core/dom/SpaceSplitString.cpp b/Source/core/dom/SpaceSplitString.cpp
index 29222d4..63c3da1 100644
--- a/Source/core/dom/SpaceSplitString.cpp
+++ b/Source/core/dom/SpaceSplitString.cpp
@@ -57,12 +57,12 @@
 {
     unsigned start = 0;
     while (true) {
-        while (start < length && isHTMLSpace(characters[start]))
+        while (start < length && isHTMLSpace<CharacterType>(characters[start]))
             ++start;
         if (start >= length)
             break;
         unsigned end = start + 1;
-        while (end < length && isNotHTMLSpace(characters[end]))
+        while (end < length && isNotHTMLSpace<CharacterType>(characters[end]))
             ++end;
 
         m_vector.append(AtomicString(characters + start, end - start));
diff --git a/Source/core/dom/Text.cpp b/Source/core/dom/Text.cpp
index 744c15d..5c300c5 100644
--- a/Source/core/dom/Text.cpp
+++ b/Source/core/dom/Text.cpp
@@ -30,7 +30,8 @@
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/dom/NodeRenderingContext.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/dom/NodeTraversal.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/rendering/RenderCombineText.h"
 #include "core/rendering/RenderText.h"
@@ -52,6 +53,50 @@
     return adoptRef(new Text(document, data, CreateEditingText));
 }
 
+PassRefPtr<Node> Text::mergeNextSiblingNodesIfPossible()
+{
+    RefPtr<Node> protect(this);
+
+    // Remove empty text nodes.
+    if (!length()) {
+        // Care must be taken to get the next node before removing the current node.
+        RefPtr<Node> nextNode(NodeTraversal::nextPostOrder(this));
+        remove(IGNORE_EXCEPTION);
+        return nextNode.release();
+    }
+
+    // Merge text nodes.
+    while (Node* nextSibling = this->nextSibling()) {
+        if (nextSibling->nodeType() != TEXT_NODE)
+            break;
+
+        RefPtr<Text> nextText = toText(nextSibling);
+
+        // Remove empty text nodes.
+        if (!nextText->length()) {
+            nextText->remove(IGNORE_EXCEPTION);
+            continue;
+        }
+
+        // Both non-empty text nodes. Merge them.
+        unsigned offset = length();
+        String nextTextData = nextText->data();
+        String oldTextData = data();
+        setDataWithoutUpdate(data() + nextTextData);
+        updateTextRenderer(oldTextData.length(), 0);
+        // Empty nextText for layout update.
+        nextText->setDataWithoutUpdate(emptyString());
+        document().didMergeTextNodes(nextText.get(), offset);
+        // Restore nextText for mutation event.
+        nextText->setDataWithoutUpdate(nextTextData);
+        document().incDOMTreeVersion();
+        didModifyData(oldTextData);
+        nextText->remove(IGNORE_EXCEPTION);
+    }
+
+    return NodeTraversal::nextPostOrder(this);
+}
+
 PassRefPtr<Text> Text::splitText(unsigned offset, ExceptionState& es)
 {
     // IndexSizeError: Raised if the specified offset is negative or greater than
diff --git a/Source/core/dom/Text.h b/Source/core/dom/Text.h
index b9929c9..df95ff1 100644
--- a/Source/core/dom/Text.h
+++ b/Source/core/dom/Text.h
@@ -39,6 +39,9 @@
     static PassRefPtr<Text> createWithLengthLimit(Document&, const String&, unsigned positionInString, unsigned lengthLimit = defaultLengthLimit);
     static PassRefPtr<Text> createEditingText(Document&, const String&);
 
+    // mergeNextSiblingNodesIfPossible() merges next sibling nodes if possible
+    // then returns a node not merged.
+    PassRefPtr<Node> mergeNextSiblingNodesIfPossible();
     PassRefPtr<Text> splitText(unsigned offset, ExceptionState&);
 
     // DOM Level 3: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1312295772
diff --git a/Source/core/dom/Touch.h b/Source/core/dom/Touch.h
index bc2c28a..f068a2f 100644
--- a/Source/core/dom/Touch.h
+++ b/Source/core/dom/Touch.h
@@ -27,7 +27,7 @@
 #define Touch_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/platform/graphics/LayoutPoint.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/dom/TouchController.cpp b/Source/core/dom/TouchController.cpp
index ce730d2..2680158 100644
--- a/Source/core/dom/TouchController.cpp
+++ b/Source/core/dom/TouchController.cpp
@@ -27,8 +27,8 @@
 #include "core/dom/TouchController.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/TouchEvent.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Frame.h"
diff --git a/Source/core/dom/TouchController.h b/Source/core/dom/TouchController.h
index 24d1ae1..e444816 100644
--- a/Source/core/dom/TouchController.h
+++ b/Source/core/dom/TouchController.h
@@ -27,7 +27,7 @@
 #define TouchController_h
 
 #include "core/dom/DocumentLifecycleObserver.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/Node.h"
 #include "core/page/DOMWindowLifecycleObserver.h"
 #include "core/platform/Supplementable.h"
diff --git a/Source/core/dom/TreeScope.cpp b/Source/core/dom/TreeScope.cpp
index e20240f..086ecf7 100644
--- a/Source/core/dom/TreeScope.cpp
+++ b/Source/core/dom/TreeScope.cpp
@@ -32,7 +32,7 @@
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventPathWalker.h"
+#include "core/events/EventPathWalker.h"
 #include "core/dom/IdTargetObserverRegistry.h"
 #include "core/dom/TreeScopeAdopter.h"
 #include "core/dom/shadow/ElementShadow.h"
@@ -208,7 +208,7 @@
     if (!m_imageMapsByName)
         return 0;
     size_t hashPos = url.find('#');
-    String name = (hashPos == notFound ? url : url.substring(hashPos + 1)).impl();
+    String name = (hashPos == kNotFound ? url : url.substring(hashPos + 1)).impl();
     if (rootNode()->document().isHTMLDocument())
         return toHTMLMapElement(m_imageMapsByName->getElementByLowercasedMapName(AtomicString(name.lower()).impl(), this));
     return toHTMLMapElement(m_imageMapsByName->getElementByMapName(AtomicString(name).impl(), this));
diff --git a/Source/core/dom/ViewportArguments.cpp b/Source/core/dom/ViewportArguments.cpp
index 48d56e4..0808c89 100644
--- a/Source/core/dom/ViewportArguments.cpp
+++ b/Source/core/dom/ViewportArguments.cpp
@@ -235,7 +235,7 @@
     if (value < 0)
         return Length(); // auto
 
-    if (!static_cast<int>(value) && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk()) {
+    if (!value && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk()) {
         if (keyString == "width")
             return Length(100, ViewportPercentageWidth);
         if (keyString == "height")
@@ -270,7 +270,7 @@
     if (value > 10.0)
         reportViewportWarning(document, MaximumScaleTooLargeError, String(), String());
 
-    if (!static_cast<int>(value) && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk() && (keyString == "minimum-scale" || keyString == "maximum-scale"))
+    if (!value && document->page() && document->page()->settings().viewportMetaZeroValuesQuirk() && (keyString == "minimum-scale" || keyString == "maximum-scale"))
         return ViewportArguments::ValueAuto;
 
     return clampScaleValue(value);
diff --git a/Source/core/dom/WheelController.cpp b/Source/core/dom/WheelController.cpp
index 48c14a7..b55b9c9 100644
--- a/Source/core/dom/WheelController.cpp
+++ b/Source/core/dom/WheelController.cpp
@@ -27,8 +27,8 @@
 #include "core/dom/WheelController.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/WheelEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/WheelEvent.h"
 #include "core/page/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
diff --git a/Source/core/dom/WheelController.h b/Source/core/dom/WheelController.h
index 13406ee..71ad326 100644
--- a/Source/core/dom/WheelController.h
+++ b/Source/core/dom/WheelController.h
@@ -26,7 +26,7 @@
 #ifndef WheelController_h
 #define WheelController_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/page/DOMWindowLifecycleObserver.h"
 #include "core/platform/Supplementable.h"
 
diff --git a/Source/core/dom/default/PlatformMessagePortChannel.cpp b/Source/core/dom/default/PlatformMessagePortChannel.cpp
deleted file mode 100644
index 2837517..0000000
--- a/Source/core/dom/default/PlatformMessagePortChannel.cpp
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2013 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:
- *
- *     * 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.
- */
-
-#include "config.h"
-#include "core/dom/default/PlatformMessagePortChannel.h"
-
-#include "core/dom/MessagePort.h"
-#include "core/dom/ScriptExecutionContext.h"
-
-namespace WebCore {
-
-PassOwnPtr<PlatformMessagePortChannel::EventData> PlatformMessagePortChannel::EventData::create(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
-{
-    return adoptPtr(new EventData(message, channels));
-}
-
-PlatformMessagePortChannel::EventData::EventData(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
-    : m_message(message)
-    , m_channels(channels)
-{
-}
-
-void MessagePortChannel::createChannel(PassRefPtr<MessagePort> port1, PassRefPtr<MessagePort> port2)
-{
-    RefPtr<PlatformMessagePortChannel::MessagePortQueue> queue1 = PlatformMessagePortChannel::MessagePortQueue::create();
-    RefPtr<PlatformMessagePortChannel::MessagePortQueue> queue2 = PlatformMessagePortChannel::MessagePortQueue::create();
-
-    OwnPtr<MessagePortChannel> channel1 = adoptPtr(new MessagePortChannel(PlatformMessagePortChannel::create(queue1, queue2)));
-    OwnPtr<MessagePortChannel> channel2 = adoptPtr(new MessagePortChannel(PlatformMessagePortChannel::create(queue2, queue1)));
-
-    channel1->m_channel->m_entangledChannel = channel2->m_channel;
-    channel2->m_channel->m_entangledChannel = channel1->m_channel;
-
-    port1->entangle(channel2.release());
-    port2->entangle(channel1.release());
-}
-
-MessagePortChannel::MessagePortChannel(PassRefPtr<PlatformMessagePortChannel> channel)
-    : m_channel(channel)
-{
-}
-
-MessagePortChannel::~MessagePortChannel()
-{
-    close();
-}
-
-bool MessagePortChannel::entangleIfOpen(MessagePort* port)
-{
-    // We can't call member functions on our remote pair while holding our mutex or we'll deadlock,
-    // but we need to guard against the remote port getting closed/freed, so create a standalone reference.
-    RefPtr<PlatformMessagePortChannel> remote = m_channel->entangledChannel();
-    if (!remote)
-        return false;
-    remote->setRemotePort(port);
-    return true;
-}
-
-void MessagePortChannel::disentangle()
-{
-    RefPtr<PlatformMessagePortChannel> remote = m_channel->entangledChannel();
-    if (remote)
-        remote->setRemotePort(0);
-}
-
-void MessagePortChannel::postMessageToRemote(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
-{
-    MutexLocker lock(m_channel->m_mutex);
-    if (!m_channel->m_outgoingQueue)
-        return;
-    bool wasEmpty = m_channel->m_outgoingQueue->appendAndCheckEmpty(PlatformMessagePortChannel::EventData::create(message, channels));
-    if (wasEmpty && m_channel->m_remotePort)
-        m_channel->m_remotePort->messageAvailable();
-}
-
-bool MessagePortChannel::tryGetMessageFromRemote(RefPtr<SerializedScriptValue>& message, OwnPtr<MessagePortChannelArray>& channels)
-{
-    MutexLocker lock(m_channel->m_mutex);
-    OwnPtr<PlatformMessagePortChannel::EventData> result = m_channel->m_incomingQueue->tryGetMessage();
-    if (!result)
-        return false;
-
-    message = result->message();
-    channels = result->channels();
-
-    return true;
-}
-
-void MessagePortChannel::close()
-{
-    RefPtr<PlatformMessagePortChannel> remote = m_channel->entangledChannel();
-    if (!remote)
-        return;
-    m_channel->closeInternal();
-    remote->closeInternal();
-}
-
-bool MessagePortChannel::isConnectedTo(MessagePort* port)
-{
-    // FIXME: What guarantees that the result remains the same after we release the lock?
-    MutexLocker lock(m_channel->m_mutex);
-    return m_channel->m_remotePort == port;
-}
-
-bool MessagePortChannel::hasPendingActivity()
-{
-    // FIXME: What guarantees that the result remains the same after we release the lock?
-    MutexLocker lock(m_channel->m_mutex);
-    return !m_channel->m_incomingQueue->isEmpty();
-}
-
-MessagePort* MessagePortChannel::locallyEntangledPort(const ScriptExecutionContext* context)
-{
-    MutexLocker lock(m_channel->m_mutex);
-    // See if both contexts are run by the same thread (are the same context, or are both documents).
-    if (m_channel->m_remotePort) {
-        // The remote port's ScriptExecutionContext is guaranteed not to change here - MessagePort::contextDestroyed()
-        // will close the port before the context goes away, and close() will block because we are holding the mutex.
-        ScriptExecutionContext* remoteContext = m_channel->m_remotePort->scriptExecutionContext();
-        if (remoteContext == context || (remoteContext && remoteContext->isDocument() && context->isDocument()))
-            return m_channel->m_remotePort;
-    }
-    return 0;
-}
-
-PassRefPtr<PlatformMessagePortChannel> PlatformMessagePortChannel::create(PassRefPtr<MessagePortQueue> incoming, PassRefPtr<MessagePortQueue> outgoing)
-{
-    return adoptRef(new PlatformMessagePortChannel(incoming, outgoing));
-}
-
-PlatformMessagePortChannel::PlatformMessagePortChannel(PassRefPtr<MessagePortQueue> incoming, PassRefPtr<MessagePortQueue> outgoing)
-    : m_incomingQueue(incoming)
-    , m_outgoingQueue(outgoing)
-    , m_remotePort(0)
-{
-}
-
-PlatformMessagePortChannel::~PlatformMessagePortChannel()
-{
-}
-
-void PlatformMessagePortChannel::setRemotePort(MessagePort* port)
-{
-    MutexLocker lock(m_mutex);
-    // Should never set port if it is already set.
-    ASSERT(!port || !m_remotePort);
-    m_remotePort = port;
-}
-
-PassRefPtr<PlatformMessagePortChannel> PlatformMessagePortChannel::entangledChannel()
-{
-    // FIXME: What guarantees that the result remains the same after we release the lock?
-    // This lock only guarantees that the returned pointer will not be pointing to released memory,
-    // but not that it will still be pointing to this object's entangled port channel.
-    MutexLocker lock(m_mutex);
-    return m_entangledChannel;
-}
-
-void PlatformMessagePortChannel::closeInternal()
-{
-    MutexLocker lock(m_mutex);
-    // Disentangle ourselves from the other end. We still maintain a reference to our incoming queue, since previously-existing messages should still be delivered.
-    m_remotePort = 0;
-    m_entangledChannel = 0;
-    m_outgoingQueue = 0;
-}
-
-} // namespace WebCore
diff --git a/Source/core/dom/default/PlatformMessagePortChannel.h b/Source/core/dom/default/PlatformMessagePortChannel.h
deleted file mode 100644
index f8dffd0..0000000
--- a/Source/core/dom/default/PlatformMessagePortChannel.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Copyright (C) 2009 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.
- */
-
-#ifndef PlatformMessagePortChannel_h
-#define PlatformMessagePortChannel_h
-
-#include "core/dom/MessagePortChannel.h"
-
-#include "wtf/MessageQueue.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/Threading.h"
-
-namespace WebCore {
-
-    class MessagePort;
-
-    // PlatformMessagePortChannel is a platform-dependent interface to the remote side of a message channel.
-    // This default implementation supports multiple threads running within a single process. Implementations for multi-process platforms should define these public APIs in their own platform-specific PlatformMessagePortChannel file.
-    // The goal of this implementation is to eliminate contention except when cloning or closing the port, so each side of the channel has its own separate mutex.
-    class PlatformMessagePortChannel : public ThreadSafeRefCounted<PlatformMessagePortChannel> {
-    public:
-        class EventData {
-            WTF_MAKE_NONCOPYABLE(EventData); WTF_MAKE_FAST_ALLOCATED;
-        public:
-            static PassOwnPtr<EventData> create(PassRefPtr<SerializedScriptValue>, PassOwnPtr<MessagePortChannelArray>);
-
-            PassRefPtr<SerializedScriptValue> message() { return m_message; }
-            PassOwnPtr<MessagePortChannelArray> channels() { return m_channels.release(); }
-
-        private:
-            EventData(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray>);
-            RefPtr<SerializedScriptValue> m_message;
-            OwnPtr<MessagePortChannelArray> m_channels;
-        };
-
-        // Wrapper for MessageQueue that allows us to do thread safe sharing by two proxies.
-        class MessagePortQueue : public ThreadSafeRefCounted<MessagePortQueue> {
-        public:
-            static PassRefPtr<MessagePortQueue> create() { return adoptRef(new MessagePortQueue()); }
-
-            PassOwnPtr<PlatformMessagePortChannel::EventData> tryGetMessage()
-            {
-                return m_queue.tryGetMessage();
-            }
-
-            bool appendAndCheckEmpty(PassOwnPtr<PlatformMessagePortChannel::EventData> message)
-            {
-                return m_queue.appendAndCheckEmpty(message);
-            }
-
-            bool isEmpty()
-            {
-                return m_queue.isEmpty();
-            }
-
-        private:
-            MessagePortQueue() { }
-
-            MessageQueue<PlatformMessagePortChannel::EventData> m_queue;
-        };
-
-        ~PlatformMessagePortChannel();
-
-        static PassRefPtr<PlatformMessagePortChannel> create(PassRefPtr<MessagePortQueue> incoming, PassRefPtr<MessagePortQueue> outgoing);
-        PlatformMessagePortChannel(PassRefPtr<MessagePortQueue> incoming, PassRefPtr<MessagePortQueue> outgoing);
-
-        PassRefPtr<PlatformMessagePortChannel> entangledChannel();
-
-        void setRemotePort(MessagePort*);
-        void closeInternal();
-
-        // Mutex used to ensure exclusive access to the object internals.
-        Mutex m_mutex;
-
-        // Pointer to our entangled pair - cleared when close() is called.
-        RefPtr<PlatformMessagePortChannel> m_entangledChannel;
-
-        // Reference to the message queue for the (local) entangled port.
-        RefPtr<MessagePortQueue> m_incomingQueue;
-        RefPtr<MessagePortQueue> m_outgoingQueue;
-
-        // The port we are connected to (the remote port) - this is the port that is notified when new messages arrive.
-        MessagePort* m_remotePort;
-    };
-
-} // namespace WebCore
-
-#endif // PlatformMessagePortChannel_h
diff --git a/Source/core/dom/shadow/ContentDistribution.cpp b/Source/core/dom/shadow/ContentDistribution.cpp
index 8333841..e0527ad 100644
--- a/Source/core/dom/shadow/ContentDistribution.cpp
+++ b/Source/core/dom/shadow/ContentDistribution.cpp
@@ -49,7 +49,7 @@
 {
     HashMap<const Node*, size_t>::const_iterator it = m_indices.find(node);
     if (it == m_indices.end())
-        return notFound;
+        return kNotFound;
 
     return it.get()->value;
 }
@@ -57,7 +57,7 @@
 Node* ContentDistribution::nextTo(const Node* node) const
 {
     size_t index = find(node);
-    if (index == notFound || index + 1 == size())
+    if (index == kNotFound || index + 1 == size())
         return 0;
     return at(index + 1).get();
 }
@@ -65,7 +65,7 @@
 Node* ContentDistribution::previousTo(const Node* node) const
 {
     size_t index = find(node);
-    if (index == notFound || !index)
+    if (index == kNotFound || !index)
         return 0;
     return at(index - 1).get();
 }
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index 43cc1dd..ba5921b 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -759,10 +759,12 @@
                 break;
             // Add to this element's inline style and skip over its contents.
             HTMLElement* element = toHTMLElement(node.get());
+            next = NodeTraversal::nextSkippingChildren(node.get());
+            if (!style->style())
+                continue;
             RefPtr<MutableStylePropertySet> inlineStyle = copyStyleOrCreateEmpty(element->inlineStyle());
             inlineStyle->mergeAndOverrideOnConflict(style->style());
             setNodeAttribute(element, styleAttr, inlineStyle->asText());
-            next = NodeTraversal::nextSkippingChildren(node.get());
             continue;
         }
 
diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp
index 85ffd92..db18b11 100644
--- a/Source/core/editing/CompositeEditCommand.cpp
+++ b/Source/core/editing/CompositeEditCommand.cpp
@@ -33,7 +33,7 @@
 #include "core/dom/DocumentMarkerController.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Range.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/Text.h"
 #include "core/editing/AppendNodeCommand.h"
 #include "core/editing/ApplyStyleCommand.h"
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 16a9e01..c185151 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -34,15 +34,15 @@
 #include "core/css/CSSComputedStyleDeclaration.h"
 #include "core/css/StylePropertySet.h"
 #include "core/dom/Clipboard.h"
-#include "core/dom/ClipboardEvent.h"
+#include "core/events/ClipboardEvent.h"
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/DocumentMarkerController.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeList.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Text.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/TextEvent.h"
 #include "core/editing/ApplyStyleCommand.h"
 #include "core/editing/DeleteSelectionCommand.h"
 #include "core/editing/IndentOutdentCommand.h"
@@ -75,6 +75,7 @@
 #include "core/platform/KillRing.h"
 #include "core/platform/Pasteboard.h"
 #include "core/platform/Sound.h"
+#include "core/platform/chromium/ChromiumDataObject.h"
 #include "core/platform/chromium/ClipboardChromium.h"
 #include "core/platform/text/TextCheckerClient.h"
 #include "core/rendering/HitTestResult.h"
@@ -367,9 +368,25 @@
     target->dispatchEvent(TextEvent::createForFragmentPaste(m_frame->domWindow(), pastingFragment, smartReplace, matchStyle), IGNORE_EXCEPTION);
 }
 
-void Editor::pasteAsPlainTextBypassingDHTML()
+bool Editor::tryDHTMLCopy()
 {
-    pasteAsPlainTextWithPasteboard(Pasteboard::generalPasteboard());
+    if (m_frame->selection().isInPasswordField())
+        return false;
+
+    return !dispatchCPPEvent(eventNames().copyEvent, ClipboardWritable);
+}
+
+bool Editor::tryDHTMLCut()
+{
+    if (m_frame->selection().isInPasswordField())
+        return false;
+
+    return !dispatchCPPEvent(eventNames().cutEvent, ClipboardWritable);
+}
+
+bool Editor::tryDHTMLPaste(PasteMode pasteMode)
+{
+    return !dispatchCPPEvent(eventNames().pasteEvent, ClipboardReadable, pasteMode);
 }
 
 void Editor::pasteAsPlainTextWithPasteboard(Pasteboard* pasteboard)
@@ -388,6 +405,36 @@
         pasteAsFragment(fragment, canSmartReplaceWithPasteboard(pasteboard), chosePlainText);
 }
 
+// Returns whether caller should continue with "the default processing", which is the same as
+// the event handler NOT setting the return value to false
+bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy, PasteMode pasteMode)
+{
+    Node* target = findEventTargetFromSelection();
+    if (!target)
+        return true;
+
+    RefPtr<Clipboard> clipboard = ClipboardChromium::create(
+        Clipboard::CopyAndPaste,
+        policy == ClipboardWritable
+            ? ChromiumDataObject::create()
+            : ChromiumDataObject::createFromPasteboard(pasteMode),
+        policy,
+        m_frame);
+
+    RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard);
+    target->dispatchEvent(evt, IGNORE_EXCEPTION);
+    bool noDefaultProcessing = evt->defaultPrevented();
+    if (noDefaultProcessing && policy == ClipboardWritable) {
+        RefPtr<ChromiumDataObject> dataObject = static_cast<ClipboardChromium*>(clipboard.get())->dataObject();
+        Pasteboard::generalPasteboard()->writeDataObject(dataObject.release());
+    }
+
+    // invalidate clipboard here for security
+    clipboard->setAccessPolicy(ClipboardNumb);
+
+    return !noDefaultProcessing;
+}
+
 bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard)
 {
     return client().smartInsertDeleteEnabled() && pasteboard->canSmartReplace();
@@ -455,27 +502,6 @@
     return client().shouldDeleteRange(range);
 }
 
-bool Editor::tryDHTMLCopy()
-{
-    if (m_frame->selection().isInPasswordField())
-        return false;
-
-    return !dispatchCPPEvent(eventNames().copyEvent, ClipboardWritable);
-}
-
-bool Editor::tryDHTMLCut()
-{
-    if (m_frame->selection().isInPasswordField())
-        return false;
-
-    return !dispatchCPPEvent(eventNames().cutEvent, ClipboardWritable);
-}
-
-bool Editor::tryDHTMLPaste()
-{
-    return !dispatchCPPEvent(eventNames().pasteEvent, ClipboardReadable);
-}
-
 bool Editor::shouldInsertText(const String& text, Range* range, EditorInsertAction action) const
 {
     return client().shouldInsertText(text, range, action);
@@ -617,30 +643,6 @@
     m_lastEditCommand.clear();
 }
 
-// Returns whether caller should continue with "the default processing", which is the same as
-// the event handler NOT setting the return value to false
-bool Editor::dispatchCPPEvent(const AtomicString &eventType, ClipboardAccessPolicy policy)
-{
-    Node* target = findEventTargetFromSelection();
-    if (!target)
-        return true;
-
-    RefPtr<Clipboard> clipboard = newGeneralClipboard(policy, m_frame);
-
-    RefPtr<Event> evt = ClipboardEvent::create(eventType, true, true, clipboard);
-    target->dispatchEvent(evt, IGNORE_EXCEPTION);
-    bool noDefaultProcessing = evt->defaultPrevented();
-    if (noDefaultProcessing && policy == ClipboardWritable) {
-        RefPtr<ChromiumDataObject> dataObject = static_cast<ClipboardChromium*>(clipboard.get())->dataObject();
-        Pasteboard::generalPasteboard()->writeDataObject(dataObject.release());
-    }
-
-    // invalidate clipboard here for security
-    clipboard->setAccessPolicy(ClipboardNumb);
-
-    return !noDefaultProcessing;
-}
-
 Node* Editor::findEventTargetFrom(const VisibleSelection& selection) const
 {
     Node* target = selection.start().element();
@@ -966,7 +968,7 @@
 void Editor::paste()
 {
     ASSERT(m_frame->document());
-    if (tryDHTMLPaste())
+    if (tryDHTMLPaste(AllMimeTypes))
         return; // DHTML did the whole operation
     if (!canPaste())
         return;
@@ -981,7 +983,7 @@
 
 void Editor::pasteAsPlainText()
 {
-    if (tryDHTMLPaste())
+    if (tryDHTMLPaste(PlainTextOnly))
         return;
     if (!canPaste())
         return;
@@ -1387,10 +1389,8 @@
 void Editor::clearMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
 {
     RefPtr<Range> selectedRange = movingSelection.toNormalizedRange();
-    if (selectedRange) {
-        frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Spelling);
-        frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::Grammar);
-    }
+    if (selectedRange)
+        frame().document()->markers()->removeMarkers(selectedRange.get(), DocumentMarker::MisspellingMarkers());
 }
 
 void Editor::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
@@ -1752,7 +1752,7 @@
     ASSERT(document);
     RefPtr<Range> wordRange = Range::create(*document, startOfFirstWord.deepEquivalent(), endOfLastWord.deepEquivalent());
 
-    document->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar, DocumentMarkerController::RemovePartiallyOverlappingMarker);
+    document->markers()->removeMarkers(wordRange.get(), DocumentMarker::MisspellingMarkers(), DocumentMarkerController::RemovePartiallyOverlappingMarker);
 }
 
 PassRefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint)
diff --git a/Source/core/editing/Editor.h b/Source/core/editing/Editor.h
index bca72bb..d53afe4 100644
--- a/Source/core/editing/Editor.h
+++ b/Source/core/editing/Editor.h
@@ -37,6 +37,7 @@
 #include "core/editing/VisibleSelection.h"
 #include "core/editing/WritingDirection.h"
 #include "core/page/FrameDestructionObserver.h"
+#include "core/platform/chromium/PasteMode.h"
 #include "core/platform/text/TextChecking.h"
 
 namespace WebCore {
@@ -87,9 +88,6 @@
     bool canDHTMLCut();
     bool canDHTMLCopy();
     bool canDHTMLPaste();
-    bool tryDHTMLCopy();
-    bool tryDHTMLCut();
-    bool tryDHTMLPaste();
 
     bool canCut() const;
     bool canCopy() const;
@@ -138,7 +136,6 @@
 
     bool deleteWithDirection(SelectionDirection, TextGranularity, bool killRing, bool isTypingAction);
     void deleteSelectionWithSmartDelete(bool smartDelete);
-    bool dispatchCPPEvent(const AtomicString&, ClipboardAccessPolicy);
 
     Node* removedAnchor() const { return m_removedAnchor.get(); }
     void setRemovedAnchor(PassRefPtr<Node> n) { m_removedAnchor = n; }
@@ -249,9 +246,6 @@
     void pasteAsFragment(PassRefPtr<DocumentFragment>, bool smartReplace, bool matchStyle);
     void pasteAsPlainText(const String&, bool smartReplace);
 
-    // This is only called on the mac where paste is implemented primarily at the WebKit level.
-    void pasteAsPlainTextBypassingDHTML();
-
     void clearMisspellingsAndBadGrammar(const VisibleSelection&);
     void markMisspellingsAndBadGrammar(const VisibleSelection&);
 
@@ -324,10 +318,15 @@
     bool m_overwriteModeEnabled;
 
     bool canDeleteRange(Range*) const;
+
+    bool tryDHTMLCopy();
+    bool tryDHTMLCut();
+    bool tryDHTMLPaste(PasteMode);
+
     bool canSmartReplaceWithPasteboard(Pasteboard*);
-    PassRefPtr<Clipboard> newGeneralClipboard(ClipboardAccessPolicy, Frame*);
     void pasteAsPlainTextWithPasteboard(Pasteboard*);
     void pasteWithPasteboard(Pasteboard*, bool allowPlainText);
+    bool dispatchCPPEvent(const AtomicString&, ClipboardAccessPolicy, PasteMode = AllMimeTypes);
 
     void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent);
     void markMisspellingsOrBadGrammar(const VisibleSelection&, bool checkSpelling, RefPtr<Range>& firstMisspellingRange);
diff --git a/Source/core/editing/EditorCommand.cpp b/Source/core/editing/EditorCommand.cpp
index 8c86f04..93c8f2d 100644
--- a/Source/core/editing/EditorCommand.cpp
+++ b/Source/core/editing/EditorCommand.cpp
@@ -36,7 +36,7 @@
 #include "core/css/CSSValueList.h"
 #include "core/css/StylePropertySet.h"
 #include "core/dom/DocumentFragment.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/UserTypingGestureIndicator.h"
 #include "core/editing/CreateLinkCommand.h"
 #include "core/editing/FormatBlockCommand.h"
@@ -972,17 +972,6 @@
     return true;
 }
 
-static bool executePasteAsPlainText(Frame& frame, Event*, EditorCommandSource source, const String&)
-{
-    if (source == CommandFromMenuOrKeyBinding) {
-        UserTypingGestureIndicator typingGestureIndicator(&frame);
-        frame.editor().pasteAsPlainText();
-    } else {
-        frame.editor().pasteAsPlainText();
-    }
-    return true;
-}
-
 static bool executePrint(Frame& frame, Event*, EditorCommandSource, const String&)
 {
     Page* page = frame.page();
@@ -1575,7 +1564,6 @@
         { "OverWrite", { executeToggleOverwrite, supportedFromMenuOrKeyBinding, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "Paste", { executePaste, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
         { "PasteAndMatchStyle", { executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
-        { "PasteAsPlainText", { executePasteAsPlainText, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
         { "PasteGlobalSelection", { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
         { "Print", { executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
         { "Redo", { executeRedo, supported, enabledRedo, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index f9d1816..2612860 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -430,6 +430,34 @@
     updateSelectionIfNeeded(base, extent, start, end);
 }
 
+static Position updatePostionAfterAdoptingTextNodesMerged(const Position& position, const Text& oldNode, unsigned offset)
+{
+    if (!position.anchorNode() || position.anchorType() != Position::PositionIsOffsetInAnchor)
+        return position;
+
+    ASSERT(position.offsetInContainerNode() >= 0);
+    unsigned positionOffset = static_cast<unsigned>(position.offsetInContainerNode());
+
+    if (position.anchorNode() == &oldNode)
+        return Position(toText(oldNode.previousSibling()), positionOffset + offset);
+
+    if (position.anchorNode() == oldNode.parentNode() && positionOffset == offset)
+        return Position(toText(oldNode.previousSibling()), offset);
+
+    return position;
+}
+
+void FrameSelection::didMergeTextNodes(const Text& oldNode, unsigned offset)
+{
+    if (isNone() || nodeIsDetachedFromDocument(oldNode))
+        return;
+    Position base = updatePostionAfterAdoptingTextNodesMerged(m_selection.base(), oldNode, offset);
+    Position extent = updatePostionAfterAdoptingTextNodesMerged(m_selection.extent(), oldNode, offset);
+    Position start = updatePostionAfterAdoptingTextNodesMerged(m_selection.start(), oldNode, offset);
+    Position end = updatePostionAfterAdoptingTextNodesMerged(m_selection.end(), oldNode, offset);
+    updateSelectionIfNeeded(base, extent, start, end);
+}
+
 static Position updatePostionAfterAdoptingTextNodeSplit(const Position& position, const Text& oldNode)
 {
     if (!position.anchorNode() || position.anchorNode() != &oldNode || position.anchorType() != Position::PositionIsOffsetInAnchor)
diff --git a/Source/core/editing/FrameSelection.h b/Source/core/editing/FrameSelection.h
index feb16e0..470dce0 100644
--- a/Source/core/editing/FrameSelection.h
+++ b/Source/core/editing/FrameSelection.h
@@ -156,6 +156,7 @@
 
     void nodeWillBeRemoved(Node*);
     void didUpdateCharacterData(CharacterData*, unsigned offset, unsigned oldLength, unsigned newLength);
+    void didMergeTextNodes(const Text& oldNode, unsigned offset);
     void didSplitTextNode(const Text& oldNode);
 
     void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden); }
diff --git a/Source/core/editing/InputMethodController.cpp b/Source/core/editing/InputMethodController.cpp
index ed53479..dc90969 100644
--- a/Source/core/editing/InputMethodController.cpp
+++ b/Source/core/editing/InputMethodController.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "core/editing/InputMethodController.h"
 
-#include "core/dom/CompositionEvent.h"
+#include "core/events/CompositionEvent.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/dom/Range.h"
@@ -44,8 +44,8 @@
 namespace WebCore {
 
 PlainTextOffsets::PlainTextOffsets()
-    : m_start(notFound)
-    , m_end(notFound)
+    : m_start(kNotFound)
+    , m_end(kNotFound)
 {
 }
 
@@ -53,8 +53,8 @@
     : m_start(start)
     , m_end(end)
 {
-    ASSERT(start != notFound);
-    ASSERT(end != notFound);
+    ASSERT(start != kNotFound);
+    ASSERT(end != kNotFound);
     ASSERT(start <= end);
 }
 
diff --git a/Source/core/editing/InputMethodController.h b/Source/core/editing/InputMethodController.h
index f62cc43..5fd3dd2 100644
--- a/Source/core/editing/InputMethodController.h
+++ b/Source/core/editing/InputMethodController.h
@@ -45,7 +45,7 @@
     PlainTextOffsets(int start, int length);
     size_t end() const { return m_end; }
     size_t start() const { return m_start; }
-    bool isNull() const { return m_start == notFound; }
+    bool isNull() const { return m_start == kNotFound; }
 private:
     size_t m_start;
     size_t m_end;
diff --git a/Source/core/editing/InsertParagraphSeparatorCommand.cpp b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
index 475bb8a..5c12948 100644
--- a/Source/core/editing/InsertParagraphSeparatorCommand.cpp
+++ b/Source/core/editing/InsertParagraphSeparatorCommand.cpp
@@ -164,6 +164,8 @@
 
     // FIXME: The parentAnchoredEquivalent conversion needs to be moved into enclosingBlock.
     RefPtr<Element> startBlock = enclosingBlock(insertionPosition.parentAnchoredEquivalent().containerNode());
+    Node* listChildNode = enclosingListChild(insertionPosition.parentAnchoredEquivalent().containerNode());
+    RefPtr<Element> listChild = listChildNode && listChildNode->isHTMLElement() ? toHTMLElement(listChildNode) : 0;
     Position canonicalPos = VisiblePosition(insertionPosition).deepEquivalent();
     if (!startBlock
         || !startBlock->nonShadowBoundaryParentNode()
@@ -230,12 +232,18 @@
                     startBlock = toElement(highestBlockquote);
             }
 
-            // Most of the time we want to stay at the nesting level of the startBlock (e.g., when nesting within lists).  However,
-            // for div nodes, this can result in nested div tags that are hard to break out of.
-            Element* siblingNode = startBlock.get();
-            if (blockToInsert->hasTagName(divTag))
-                siblingNode = highestVisuallyEquivalentDivBelowRoot(startBlock.get());
-            insertNodeAfter(blockToInsert, siblingNode);
+            if (listChild && listChild != startBlock) {
+                RefPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren();
+                appendNode(blockToInsert, listChildToInsert.get());
+                insertNodeAfter(listChildToInsert.get(), listChild);
+            } else {
+                // Most of the time we want to stay at the nesting level of the startBlock (e.g., when nesting within lists). However,
+                // for div nodes, this can result in nested div tags that are hard to break out of.
+                Element* siblingNode = startBlock.get();
+                if (blockToInsert->hasTagName(divTag))
+                    siblingNode = highestVisuallyEquivalentDivBelowRoot(startBlock.get());
+                insertNodeAfter(blockToInsert, siblingNode);
+            }
         }
 
         // Recreate the same structure in the new paragraph.
@@ -255,13 +263,18 @@
     // Handle case when position is in the first visible position in its block, and
     // similar case where previous position is in another, presumeably nested, block.
     if (isFirstInBlock || !inSameBlock(visiblePos, visiblePos.previous())) {
-        Node *refNode;
-
+        Node* refNode = 0;
         insertionPosition = positionOutsideTabSpan(insertionPosition);
 
-        if (isFirstInBlock && !nestNewBlock)
-            refNode = startBlock.get();
-        else if (isFirstInBlock && nestNewBlock) {
+        if (isFirstInBlock && !nestNewBlock) {
+            if (listChild && listChild != startBlock) {
+                RefPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren();
+                appendNode(blockToInsert, listChildToInsert.get());
+                insertNodeBefore(listChildToInsert.get(), listChild);
+            } else {
+                refNode = startBlock.get();
+            }
+        } else if (isFirstInBlock && nestNewBlock) {
             // startBlock should always have children, otherwise isLastInBlock would be true and it's handled above.
             ASSERT(startBlock->firstChild());
             refNode = startBlock->firstChild();
@@ -275,7 +288,8 @@
         // find ending selection position easily before inserting the paragraph
         insertionPosition = insertionPosition.downstream();
 
-        insertNodeBefore(blockToInsert, refNode);
+        if (refNode)
+            insertNodeBefore(blockToInsert, refNode);
 
         // Recreate the same structure in the new paragraph.
 
@@ -355,10 +369,15 @@
         return;
 
     // Put the added block in the tree.
-    if (nestNewBlock)
+    if (nestNewBlock) {
         appendNode(blockToInsert.get(), startBlock);
-    else
+    } else if (listChild && listChild != startBlock) {
+        RefPtr<Element> listChildToInsert = listChild->cloneElementWithoutChildren();
+        appendNode(blockToInsert.get(), listChildToInsert.get());
+        insertNodeAfter(listChildToInsert.get(), listChild);
+    } else {
         insertNodeAfter(blockToInsert.get(), startBlock);
+    }
 
     document().updateLayoutIgnorePendingStylesheets();
 
diff --git a/Source/core/editing/InsertTextCommand.cpp b/Source/core/editing/InsertTextCommand.cpp
index 2e3c45f..639b518 100644
--- a/Source/core/editing/InsertTextCommand.cpp
+++ b/Source/core/editing/InsertTextCommand.cpp
@@ -129,7 +129,7 @@
 
 void InsertTextCommand::doApply()
 {
-    ASSERT(m_text.find('\n') == notFound);
+    ASSERT(m_text.find('\n') == kNotFound);
 
     if (!endingSelection().isNonOrphanedCaretOrRange())
         return;
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 16b7262..41a7bde 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -32,11 +32,11 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/CSSStyleDeclaration.h"
 #include "core/css/StylePropertySet.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
 #include "core/dom/Document.h"
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Text.h"
 #include "core/editing/ApplyStyleCommand.h"
diff --git a/Source/core/editing/SpellCheckRequester.cpp b/Source/core/editing/SpellCheckRequester.cpp
index 023cf34..5ca2367 100644
--- a/Source/core/editing/SpellCheckRequester.cpp
+++ b/Source/core/editing/SpellCheckRequester.cpp
@@ -71,7 +71,7 @@
     if (!text.length())
         return PassRefPtr<SpellCheckRequest>();
 
-    const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().markers()->markersInRange(checkingRange.get(), DocumentMarker::Spelling | DocumentMarker::Grammar);
+    const Vector<DocumentMarker*>& markers = checkingRange->ownerDocument().markers()->markersInRange(checkingRange.get(), DocumentMarker::MisspellingMarkers());
     Vector<uint32_t> hashes(markers.size());
     Vector<unsigned> offsets(markers.size());
     for (size_t i = 0; i < markers.size(); i++) {
diff --git a/Source/core/editing/TextInsertionBaseCommand.cpp b/Source/core/editing/TextInsertionBaseCommand.cpp
index 380b27f..4c14a9b 100644
--- a/Source/core/editing/TextInsertionBaseCommand.cpp
+++ b/Source/core/editing/TextInsertionBaseCommand.cpp
@@ -27,7 +27,7 @@
 #include "core/editing/TextInsertionBaseCommand.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
 #include "core/dom/Element.h"
 #include "core/dom/Node.h"
 #include "core/editing/FrameSelection.h"
diff --git a/Source/core/editing/TextInsertionBaseCommand.h b/Source/core/editing/TextInsertionBaseCommand.h
index aa10fcf..6f2f355 100644
--- a/Source/core/editing/TextInsertionBaseCommand.h
+++ b/Source/core/editing/TextInsertionBaseCommand.h
@@ -53,7 +53,7 @@
 {
     unsigned offset = 0;
     size_t newline;
-    while ((newline = string.find('\n', offset)) != notFound) {
+    while ((newline = string.find('\n', offset)) != kNotFound) {
         operation(offset, newline - offset, false);
         offset = newline + 1;
     }
diff --git a/Source/core/editing/TextIterator.cpp b/Source/core/editing/TextIterator.cpp
index 2b4b8e5..668fde6 100644
--- a/Source/core/editing/TextIterator.cpp
+++ b/Source/core/editing/TextIterator.cpp
@@ -586,7 +586,7 @@
                 m_offset = runStart + 1;
             } else {
                 size_t subrunEnd = str.find('\n', runStart);
-                if (subrunEnd == notFound || subrunEnd > runEnd)
+                if (subrunEnd == kNotFound || subrunEnd > runEnd)
                     subrunEnd = runEnd;
 
                 m_offset = subrunEnd;
@@ -2321,7 +2321,7 @@
 
 bool TextIterator::getLocationAndLengthFromRange(Node* scope, const Range* range, size_t& location, size_t& length)
 {
-    location = notFound;
+    location = kNotFound;
     length = 0;
 
     if (!range->startContainer())
diff --git a/Source/core/editing/chromium/EditorChromium.cpp b/Source/core/editing/chromium/EditorChromium.cpp
deleted file mode 100644
index f8b8be7..0000000
--- a/Source/core/editing/chromium/EditorChromium.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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.
- */
-
-#include "config.h"
-#include "core/editing/Editor.h"
-
-#include "core/platform/chromium/ChromiumDataObject.h"
-#include "core/platform/chromium/ClipboardChromium.h"
-
-namespace WebCore {
-
-PassRefPtr<Clipboard> Editor::newGeneralClipboard(ClipboardAccessPolicy policy, Frame* frame)
-{
-    return ClipboardChromium::create(
-        Clipboard::CopyAndPaste,
-        policy == ClipboardWritable ? ChromiumDataObject::create() : ChromiumDataObject::createFromPasteboard(),
-        policy,
-        frame);
-
-}
-
-} // namespace WebCore
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 36dac24..437ffb8 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -752,7 +752,7 @@
         return;
     }
 
-    ASSERT(string.find('\n') == notFound);
+    ASSERT(string.find('\n') == kNotFound);
 
     Vector<String> tabList;
     string.split('\t', true, tabList);
@@ -835,7 +835,7 @@
     }
 
     // A string with no newlines gets added inline, rather than being put into a paragraph.
-    if (string.find('\n') == notFound) {
+    if (string.find('\n') == kNotFound) {
         fillContainerFromString(fragment.get(), string);
         return fragment.release();
     }
@@ -951,7 +951,7 @@
 
     bool wasValid = fragment->parseXML(markup, contextElement, parserContentPolicy);
     if (!wasValid) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
     return fragment.release();
@@ -996,13 +996,13 @@
 {
     ASSERT(element);
     if (element->ieForbidsInsertHTML()) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
     if (element->hasLocalName(colTag) || element->hasLocalName(colgroupTag) || element->hasLocalName(framesetTag)
         || element->hasLocalName(headTag) || element->hasLocalName(styleTag) || element->hasLocalName(titleTag)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
diff --git a/Source/core/dom/AutocompleteErrorEvent.h b/Source/core/events/AutocompleteErrorEvent.h
similarity index 97%
rename from Source/core/dom/AutocompleteErrorEvent.h
rename to Source/core/events/AutocompleteErrorEvent.h
index 2f36cc7..fa02b5c 100644
--- a/Source/core/dom/AutocompleteErrorEvent.h
+++ b/Source/core/events/AutocompleteErrorEvent.h
@@ -25,8 +25,8 @@
 #ifndef AutocompleteErrorEvent_h
 #define AutocompleteErrorEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/AutocompleteErrorEvent.idl b/Source/core/events/AutocompleteErrorEvent.idl
similarity index 100%
rename from Source/core/dom/AutocompleteErrorEvent.idl
rename to Source/core/events/AutocompleteErrorEvent.idl
diff --git a/Source/core/dom/BeforeLoadEvent.h b/Source/core/events/BeforeLoadEvent.h
similarity index 97%
rename from Source/core/dom/BeforeLoadEvent.h
rename to Source/core/events/BeforeLoadEvent.h
index 1e6d5fc..b48e66e 100644
--- a/Source/core/dom/BeforeLoadEvent.h
+++ b/Source/core/events/BeforeLoadEvent.h
@@ -27,8 +27,8 @@
 #ifndef BeforeLoadEvent_h
 #define BeforeLoadEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/BeforeLoadEvent.idl b/Source/core/events/BeforeLoadEvent.idl
similarity index 100%
rename from Source/core/dom/BeforeLoadEvent.idl
rename to Source/core/events/BeforeLoadEvent.idl
diff --git a/Source/core/dom/BeforeTextInsertedEvent.cpp b/Source/core/events/BeforeTextInsertedEvent.cpp
similarity index 95%
rename from Source/core/dom/BeforeTextInsertedEvent.cpp
rename to Source/core/events/BeforeTextInsertedEvent.cpp
index 72e4780..057bacd 100644
--- a/Source/core/dom/BeforeTextInsertedEvent.cpp
+++ b/Source/core/events/BeforeTextInsertedEvent.cpp
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/BeforeTextInsertedEvent.h b/Source/core/events/BeforeTextInsertedEvent.h
similarity index 98%
rename from Source/core/dom/BeforeTextInsertedEvent.h
rename to Source/core/events/BeforeTextInsertedEvent.h
index a08e2de..546c4fb 100644
--- a/Source/core/dom/BeforeTextInsertedEvent.h
+++ b/Source/core/events/BeforeTextInsertedEvent.h
@@ -26,7 +26,7 @@
 #ifndef BeforeTextInsertedEvent_h
 #define BeforeTextInsertedEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/BeforeUnloadEvent.cpp b/Source/core/events/BeforeUnloadEvent.cpp
similarity index 94%
rename from Source/core/dom/BeforeUnloadEvent.cpp
rename to Source/core/events/BeforeUnloadEvent.cpp
index a22374c..5581765 100644
--- a/Source/core/dom/BeforeUnloadEvent.cpp
+++ b/Source/core/events/BeforeUnloadEvent.cpp
@@ -22,9 +22,9 @@
  */
 
 #include "config.h"
-#include "core/dom/BeforeUnloadEvent.h"
+#include "core/events/BeforeUnloadEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/BeforeUnloadEvent.h b/Source/core/events/BeforeUnloadEvent.h
similarity index 96%
rename from Source/core/dom/BeforeUnloadEvent.h
rename to Source/core/events/BeforeUnloadEvent.h
index a76ad52..be19940 100644
--- a/Source/core/dom/BeforeUnloadEvent.h
+++ b/Source/core/events/BeforeUnloadEvent.h
@@ -25,8 +25,8 @@
 #ifndef BeforeUnloadEvent_h
 #define BeforeUnloadEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/BeforeUnloadEvent.idl b/Source/core/events/BeforeUnloadEvent.idl
similarity index 100%
rename from Source/core/dom/BeforeUnloadEvent.idl
rename to Source/core/events/BeforeUnloadEvent.idl
diff --git a/Source/core/dom/ClipboardEvent.cpp b/Source/core/events/ClipboardEvent.cpp
similarity index 95%
rename from Source/core/dom/ClipboardEvent.cpp
rename to Source/core/events/ClipboardEvent.cpp
index bda69f2..30bdb42 100644
--- a/Source/core/dom/ClipboardEvent.cpp
+++ b/Source/core/events/ClipboardEvent.cpp
@@ -21,10 +21,10 @@
  */
 
 #include "config.h"
-#include "core/dom/ClipboardEvent.h"
+#include "core/events/ClipboardEvent.h"
 
 #include "core/dom/Clipboard.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ClipboardEvent.h b/Source/core/events/ClipboardEvent.h
similarity index 98%
rename from Source/core/dom/ClipboardEvent.h
rename to Source/core/events/ClipboardEvent.h
index 87bd13d..671315b 100644
--- a/Source/core/dom/ClipboardEvent.h
+++ b/Source/core/events/ClipboardEvent.h
@@ -24,7 +24,7 @@
 #ifndef ClipboardEvent_h
 #define ClipboardEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CompositionEvent.cpp b/Source/core/events/CompositionEvent.cpp
similarity index 96%
rename from Source/core/dom/CompositionEvent.cpp
rename to Source/core/events/CompositionEvent.cpp
index 45c61c0..c73be9e 100644
--- a/Source/core/dom/CompositionEvent.cpp
+++ b/Source/core/events/CompositionEvent.cpp
@@ -25,9 +25,9 @@
  */
 
 #include "config.h"
-#include "core/dom/CompositionEvent.h"
+#include "core/events/CompositionEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CompositionEvent.h b/Source/core/events/CompositionEvent.h
similarity index 98%
rename from Source/core/dom/CompositionEvent.h
rename to Source/core/events/CompositionEvent.h
index cf39f9b..c06da88 100644
--- a/Source/core/dom/CompositionEvent.h
+++ b/Source/core/events/CompositionEvent.h
@@ -27,7 +27,7 @@
 #ifndef CompositionEvent_h
 #define CompositionEvent_h
 
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CompositionEvent.idl b/Source/core/events/CompositionEvent.idl
similarity index 100%
rename from Source/core/dom/CompositionEvent.idl
rename to Source/core/events/CompositionEvent.idl
diff --git a/Source/core/dom/CustomEvent.cpp b/Source/core/events/CustomEvent.cpp
similarity index 96%
rename from Source/core/dom/CustomEvent.cpp
rename to Source/core/events/CustomEvent.cpp
index c46919d..7b57947 100644
--- a/Source/core/dom/CustomEvent.cpp
+++ b/Source/core/events/CustomEvent.cpp
@@ -24,10 +24,10 @@
  */
 
 #include "config.h"
-#include "core/dom/CustomEvent.h"
+#include "core/events/CustomEvent.h"
 
 #include "bindings/v8/SerializedScriptValue.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CustomEvent.h b/Source/core/events/CustomEvent.h
similarity index 98%
rename from Source/core/dom/CustomEvent.h
rename to Source/core/events/CustomEvent.h
index d67c8c7..9be0e11 100644
--- a/Source/core/dom/CustomEvent.h
+++ b/Source/core/events/CustomEvent.h
@@ -26,7 +26,7 @@
 #ifndef CustomEvent_h
 #define CustomEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CustomEvent.idl b/Source/core/events/CustomEvent.idl
similarity index 100%
rename from Source/core/dom/CustomEvent.idl
rename to Source/core/events/CustomEvent.idl
diff --git a/Source/core/dom/DocumentEventQueue.cpp b/Source/core/events/DocumentEventQueue.cpp
similarity index 97%
rename from Source/core/dom/DocumentEventQueue.cpp
rename to Source/core/events/DocumentEventQueue.cpp
index eba99c1..e5532d2 100644
--- a/Source/core/dom/DocumentEventQueue.cpp
+++ b/Source/core/events/DocumentEventQueue.cpp
@@ -25,11 +25,11 @@
  */
 
 #include "config.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/page/DOMWindow.h"
 #include "core/page/SuspendableTimer.h"
 
diff --git a/Source/core/dom/DocumentEventQueue.h b/Source/core/events/DocumentEventQueue.h
similarity index 98%
rename from Source/core/dom/DocumentEventQueue.h
rename to Source/core/events/DocumentEventQueue.h
index bd8fb76..b871164 100644
--- a/Source/core/dom/DocumentEventQueue.h
+++ b/Source/core/events/DocumentEventQueue.h
@@ -27,7 +27,7 @@
 #ifndef DocumentEventQueue_h
 #define DocumentEventQueue_h
 
-#include "core/dom/EventQueue.h"
+#include "core/events/EventQueue.h"
 #include "wtf/Forward.h"
 #include "wtf/HashSet.h"
 #include "wtf/ListHashSet.h"
diff --git a/Source/core/dom/ErrorEvent.cpp b/Source/core/events/ErrorEvent.cpp
similarity index 97%
rename from Source/core/dom/ErrorEvent.cpp
rename to Source/core/events/ErrorEvent.cpp
index dc15aec..a75cb60 100644
--- a/Source/core/dom/ErrorEvent.cpp
+++ b/Source/core/events/ErrorEvent.cpp
@@ -29,9 +29,9 @@
  */
 
 #include "config.h"
-#include "core/dom/ErrorEvent.h"
+#include "core/events/ErrorEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ErrorEvent.h b/Source/core/events/ErrorEvent.h
similarity index 98%
rename from Source/core/dom/ErrorEvent.h
rename to Source/core/events/ErrorEvent.h
index 34b8a42..e0643e4 100644
--- a/Source/core/dom/ErrorEvent.h
+++ b/Source/core/events/ErrorEvent.h
@@ -32,7 +32,7 @@
 #define ErrorEvent_h
 
 #include "bindings/v8/DOMWrapperWorld.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "wtf/RefPtr.h"
 #include "wtf/text/WTFString.h"
 
diff --git a/Source/core/dom/ErrorEvent.idl b/Source/core/events/ErrorEvent.idl
similarity index 100%
rename from Source/core/dom/ErrorEvent.idl
rename to Source/core/events/ErrorEvent.idl
diff --git a/Source/core/dom/Event.cpp b/Source/core/events/Event.cpp
similarity index 97%
rename from Source/core/dom/Event.cpp
rename to Source/core/events/Event.cpp
index 5b653df..2e5faed 100644
--- a/Source/core/dom/Event.cpp
+++ b/Source/core/events/Event.cpp
@@ -21,10 +21,10 @@
  */
 
 #include "config.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/StaticNodeList.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/text/AtomicString.h"
diff --git a/Source/core/dom/Event.h b/Source/core/events/Event.h
similarity index 99%
rename from Source/core/dom/Event.h
rename to Source/core/events/Event.h
index 56dd5f9..b825f70 100644
--- a/Source/core/dom/Event.h
+++ b/Source/core/events/Event.h
@@ -26,7 +26,7 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/DOMTimeStamp.h"
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 #include "wtf/RefCounted.h"
 #include "wtf/text/AtomicString.h"
 
diff --git a/Source/core/dom/Event.idl b/Source/core/events/Event.idl
similarity index 100%
rename from Source/core/dom/Event.idl
rename to Source/core/events/Event.idl
diff --git a/Source/core/dom/EventAliases.in b/Source/core/events/EventAliases.in
similarity index 100%
rename from Source/core/dom/EventAliases.in
rename to Source/core/events/EventAliases.in
diff --git a/Source/core/dom/EventContext.cpp b/Source/core/events/EventContext.cpp
similarity index 95%
rename from Source/core/dom/EventContext.cpp
rename to Source/core/events/EventContext.cpp
index b1d2fe8..dd0a1c0 100644
--- a/Source/core/dom/EventContext.cpp
+++ b/Source/core/events/EventContext.cpp
@@ -25,14 +25,14 @@
  */
 
 #include "config.h"
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/FocusEvent.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/Event.h"
+#include "core/events/FocusEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/Node.h"
 #include "core/dom/StaticNodeList.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/TouchList.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/EventContext.h b/Source/core/events/EventContext.h
similarity index 98%
rename from Source/core/dom/EventContext.h
rename to Source/core/events/EventContext.h
index 748fff0..8ebfc36 100644
--- a/Source/core/dom/EventContext.h
+++ b/Source/core/events/EventContext.h
@@ -27,7 +27,7 @@
 #ifndef EventContext_h
 #define EventContext_h
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/Node.h"
 #include "core/dom/StaticNodeList.h"
 #include "core/dom/TreeScope.h"
diff --git a/Source/core/dom/EventDispatchMediator.cpp b/Source/core/events/EventDispatchMediator.cpp
similarity index 94%
rename from Source/core/dom/EventDispatchMediator.cpp
rename to Source/core/events/EventDispatchMediator.cpp
index 45c9206..032d0b8 100644
--- a/Source/core/dom/EventDispatchMediator.cpp
+++ b/Source/core/events/EventDispatchMediator.cpp
@@ -29,10 +29,10 @@
  */
 
 #include "config.h"
-#include "core/dom/EventDispatchMediator.h"
+#include "core/events/EventDispatchMediator.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventDispatcher.h"
+#include "core/events/Event.h"
+#include "core/events/EventDispatcher.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/EventDispatchMediator.h b/Source/core/events/EventDispatchMediator.h
similarity index 100%
rename from Source/core/dom/EventDispatchMediator.h
rename to Source/core/events/EventDispatchMediator.h
diff --git a/Source/core/dom/EventDispatcher.cpp b/Source/core/events/EventDispatcher.cpp
similarity index 96%
rename from Source/core/dom/EventDispatcher.cpp
rename to Source/core/events/EventDispatcher.cpp
index 9bcfb11..20bc658 100644
--- a/Source/core/dom/EventDispatcher.cpp
+++ b/Source/core/events/EventDispatcher.cpp
@@ -24,15 +24,15 @@
  */
 
 #include "config.h"
-#include "core/dom/EventDispatcher.h"
+#include "core/events/EventDispatcher.h"
 
 #include "core/dom/ContainerNode.h"
-#include "core/dom/EventContext.h"
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/EventRetargeter.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/ScopedEventQueue.h"
-#include "core/dom/WindowEventContext.h"
+#include "core/events/EventContext.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/EventRetargeter.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/ScopedEventQueue.h"
+#include "core/events/WindowEventContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/FrameView.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/dom/EventDispatcher.h b/Source/core/events/EventDispatcher.h
similarity index 98%
rename from Source/core/dom/EventDispatcher.h
rename to Source/core/events/EventDispatcher.h
index 5587132..6607627 100644
--- a/Source/core/dom/EventDispatcher.h
+++ b/Source/core/events/EventDispatcher.h
@@ -26,7 +26,7 @@
 #ifndef EventDispatcher_h
 #define EventDispatcher_h
 
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 #include "core/dom/SimulatedClickOptions.h"
 #include "wtf/Forward.h"
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/dom/EventFactory.h b/Source/core/events/EventFactory.h
similarity index 100%
rename from Source/core/dom/EventFactory.h
rename to Source/core/events/EventFactory.h
diff --git a/Source/core/dom/EventListener.h b/Source/core/events/EventListener.h
similarity index 100%
rename from Source/core/dom/EventListener.h
rename to Source/core/events/EventListener.h
diff --git a/Source/core/dom/EventListener.idl b/Source/core/events/EventListener.idl
similarity index 100%
rename from Source/core/dom/EventListener.idl
rename to Source/core/events/EventListener.idl
diff --git a/Source/core/dom/EventListenerMap.cpp b/Source/core/events/EventListenerMap.cpp
similarity index 97%
rename from Source/core/dom/EventListenerMap.cpp
rename to Source/core/events/EventListenerMap.cpp
index 35af02f..901f063 100644
--- a/Source/core/dom/EventListenerMap.cpp
+++ b/Source/core/events/EventListenerMap.cpp
@@ -31,9 +31,9 @@
  */
 
 #include "config.h"
-#include "core/dom/EventListenerMap.h"
+#include "core/events/EventListenerMap.h"
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/Vector.h"
 
@@ -111,7 +111,7 @@
 {
     RegisteredEventListener registeredListener(listener, useCapture);
 
-    if (vector->find(registeredListener) != notFound)
+    if (vector->find(registeredListener) != kNotFound)
         return false; // Duplicate listener.
 
     vector->append(registeredListener);
@@ -135,7 +135,7 @@
 {
     RegisteredEventListener registeredListener(listener, useCapture);
     indexOfRemovedListener = listenerVector->find(registeredListener);
-    if (indexOfRemovedListener == notFound)
+    if (indexOfRemovedListener == kNotFound)
         return false;
     listenerVector->remove(indexOfRemovedListener);
     return true;
diff --git a/Source/core/dom/EventListenerMap.h b/Source/core/events/EventListenerMap.h
similarity index 98%
rename from Source/core/dom/EventListenerMap.h
rename to Source/core/events/EventListenerMap.h
index 4889d94..fa39f2b 100644
--- a/Source/core/dom/EventListenerMap.h
+++ b/Source/core/events/EventListenerMap.h
@@ -33,7 +33,7 @@
 #ifndef EventListenerMap_h
 #define EventListenerMap_h
 
-#include "core/dom/RegisteredEventListener.h"
+#include "core/events/RegisteredEventListener.h"
 #include "wtf/Forward.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/text/AtomicStringHash.h"
diff --git a/Source/core/dom/EventNames.cpp b/Source/core/events/EventNames.cpp
similarity index 96%
rename from Source/core/dom/EventNames.cpp
rename to Source/core/events/EventNames.cpp
index 9821d03..94db381 100644
--- a/Source/core/dom/EventNames.cpp
+++ b/Source/core/events/EventNames.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/EventNames.h b/Source/core/events/EventNames.h
similarity index 100%
rename from Source/core/dom/EventNames.h
rename to Source/core/events/EventNames.h
diff --git a/Source/core/dom/EventPathWalker.cpp b/Source/core/events/EventPathWalker.cpp
similarity index 98%
rename from Source/core/dom/EventPathWalker.cpp
rename to Source/core/events/EventPathWalker.cpp
index aea6933..a322bda 100644
--- a/Source/core/dom/EventPathWalker.cpp
+++ b/Source/core/events/EventPathWalker.cpp
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "core/dom/EventPathWalker.h"
+#include "core/events/EventPathWalker.h"
 
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/InsertionPoint.h"
diff --git a/Source/core/dom/EventPathWalker.h b/Source/core/events/EventPathWalker.h
similarity index 100%
rename from Source/core/dom/EventPathWalker.h
rename to Source/core/events/EventPathWalker.h
diff --git a/Source/core/dom/EventQueue.h b/Source/core/events/EventQueue.h
similarity index 100%
rename from Source/core/dom/EventQueue.h
rename to Source/core/events/EventQueue.h
diff --git a/Source/core/dom/EventRetargeter.cpp b/Source/core/events/EventRetargeter.cpp
similarity index 97%
rename from Source/core/dom/EventRetargeter.cpp
rename to Source/core/events/EventRetargeter.cpp
index da3e829..00caedc 100644
--- a/Source/core/dom/EventRetargeter.cpp
+++ b/Source/core/events/EventRetargeter.cpp
@@ -18,17 +18,17 @@
  */
 
 #include "config.h"
-#include "core/dom/EventRetargeter.h"
+#include "core/events/EventRetargeter.h"
 
 #include "RuntimeEnabledFeatures.h"
 #include "core/dom/ContainerNode.h"
-#include "core/dom/EventContext.h"
-#include "core/dom/EventPathWalker.h"
-#include "core/dom/FocusEvent.h"
+#include "core/events/EventContext.h"
+#include "core/events/EventPathWalker.h"
+#include "core/events/FocusEvent.h"
 #include "core/dom/FullscreenElementStack.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/Touch.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/TouchList.h"
 #include "core/dom/TreeScope.h"
 #include "core/dom/shadow/ShadowRoot.h"
diff --git a/Source/core/dom/EventRetargeter.h b/Source/core/events/EventRetargeter.h
similarity index 98%
rename from Source/core/dom/EventRetargeter.h
rename to Source/core/events/EventRetargeter.h
index ea5b36e..e61955e 100644
--- a/Source/core/dom/EventRetargeter.h
+++ b/Source/core/events/EventRetargeter.h
@@ -22,7 +22,7 @@
 
 #include "SVGNames.h"
 #include "core/dom/ContainerNode.h"
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/SVGUseElement.h"
diff --git a/Source/core/dom/EventSender.h b/Source/core/events/EventSender.h
similarity index 96%
rename from Source/core/dom/EventSender.h
rename to Source/core/events/EventSender.h
index d738901..51d4c78 100644
--- a/Source/core/dom/EventSender.h
+++ b/Source/core/events/EventSender.h
@@ -45,7 +45,7 @@
 #ifndef NDEBUG
     bool hasPendingEvents(T* sender) const
     {
-        return m_dispatchSoonList.find(sender) != notFound || m_dispatchingList.find(sender) != notFound;
+        return m_dispatchSoonList.find(sender) != kNotFound || m_dispatchingList.find(sender) != kNotFound;
     }
 #endif
 
diff --git a/Source/core/dom/EventTarget.cpp b/Source/core/events/EventTarget.cpp
similarity index 98%
rename from Source/core/dom/EventTarget.cpp
rename to Source/core/events/EventTarget.cpp
index 5745d7f..b8ab146 100644
--- a/Source/core/dom/EventTarget.cpp
+++ b/Source/core/events/EventTarget.cpp
@@ -30,13 +30,13 @@
  */
 
 #include "config.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/DOMWrapperWorld.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptController.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/DOMWindow.h"
@@ -158,7 +158,7 @@
 bool EventTarget::dispatchEvent(PassRefPtr<Event> event, ExceptionState& es)
 {
     if (!event || event->type().isEmpty() || event->isBeingDispatched()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return false;
     }
 
diff --git a/Source/core/dom/EventTarget.h b/Source/core/events/EventTarget.h
similarity index 91%
rename from Source/core/dom/EventTarget.h
rename to Source/core/events/EventTarget.h
index 3a5dc0a..4127132 100644
--- a/Source/core/dom/EventTarget.h
+++ b/Source/core/events/EventTarget.h
@@ -32,8 +32,8 @@
 #ifndef EventTarget_h
 #define EventTarget_h
 
-#include "core/dom/EventListenerMap.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListenerMap.h"
+#include "core/events/EventNames.h"
 #include "wtf/Forward.h"
 
 namespace WebCore {
@@ -119,8 +119,8 @@
         bool setAttributeEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, DOMWrapperWorld* isolatedWorld = 0);
         EventListener* getAttributeEventListener(const AtomicString& eventType, DOMWrapperWorld* isolatedWorld = 0);
 
-        bool hasEventListeners();
-        bool hasEventListeners(const AtomicString& eventType);
+        bool hasEventListeners() const;
+        bool hasEventListeners(const AtomicString& eventType) const;
         bool hasCapturingEventListeners(const AtomicString& eventType);
         const EventListenerVector& getEventListeners(const AtomicString& eventType);
 
@@ -184,20 +184,20 @@
         return d->firingEventIterators && !d->firingEventIterators->isEmpty();
     }
 
-    inline bool EventTarget::hasEventListeners()
+    inline bool EventTarget::hasEventListeners() const
     {
-        EventTargetData* d = eventTargetData();
-        if (!d)
-            return false;
-        return !d->eventListenerMap.isEmpty();
+        // FIXME: We should have a const version of eventTargetData.
+        if (const EventTargetData* d = const_cast<EventTarget*>(this)->eventTargetData())
+            return !d->eventListenerMap.isEmpty();
+        return false;
     }
 
-    inline bool EventTarget::hasEventListeners(const AtomicString& eventType)
+    inline bool EventTarget::hasEventListeners(const AtomicString& eventType) const
     {
-        EventTargetData* d = eventTargetData();
-        if (!d)
-            return false;
-        return d->eventListenerMap.contains(eventType);
+        // FIXME: We should have const version of eventTargetData.
+        if (const EventTargetData* d = const_cast<EventTarget*>(this)->eventTargetData())
+            return d->eventListenerMap.contains(eventType);
+        return false;
     }
 
     inline bool EventTarget::hasCapturingEventListeners(const AtomicString& eventType)
diff --git a/Source/core/dom/EventTarget.idl b/Source/core/events/EventTarget.idl
similarity index 100%
rename from Source/core/dom/EventTarget.idl
rename to Source/core/events/EventTarget.idl
diff --git a/Source/core/dom/EventTargetFactory.in b/Source/core/events/EventTargetFactory.in
similarity index 100%
rename from Source/core/dom/EventTargetFactory.in
rename to Source/core/events/EventTargetFactory.in
diff --git a/Source/core/dom/FocusEvent.cpp b/Source/core/events/FocusEvent.cpp
similarity index 95%
rename from Source/core/dom/FocusEvent.cpp
rename to Source/core/events/FocusEvent.cpp
index 6d9569d..9251f57 100644
--- a/Source/core/dom/FocusEvent.cpp
+++ b/Source/core/events/FocusEvent.cpp
@@ -24,12 +24,12 @@
  */
 
 #include "config.h"
-#include "core/dom/FocusEvent.h"
+#include "core/events/FocusEvent.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventRetargeter.h"
+#include "core/events/Event.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventRetargeter.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/FocusEvent.h b/Source/core/events/FocusEvent.h
similarity index 98%
rename from Source/core/dom/FocusEvent.h
rename to Source/core/events/FocusEvent.h
index f96c076..380658f 100644
--- a/Source/core/dom/FocusEvent.h
+++ b/Source/core/events/FocusEvent.h
@@ -26,8 +26,8 @@
 #ifndef FocusEvent_h
 #define FocusEvent_h
 
-#include "core/dom/EventTarget.h"
-#include "core/dom/UIEvent.h"
+#include "core/events/EventTarget.h"
+#include "core/events/UIEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/FocusEvent.idl b/Source/core/events/FocusEvent.idl
similarity index 100%
rename from Source/core/dom/FocusEvent.idl
rename to Source/core/events/FocusEvent.idl
diff --git a/Source/core/dom/GenericEventQueue.cpp b/Source/core/events/GenericEventQueue.cpp
similarity index 97%
rename from Source/core/dom/GenericEventQueue.cpp
rename to Source/core/events/GenericEventQueue.cpp
index b002fd6..28a2c25 100644
--- a/Source/core/dom/GenericEventQueue.cpp
+++ b/Source/core/events/GenericEventQueue.cpp
@@ -25,9 +25,9 @@
 
 #include "config.h"
 
-#include "core/dom/GenericEventQueue.h"
+#include "core/events/GenericEventQueue.h"
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/GenericEventQueue.h b/Source/core/events/GenericEventQueue.h
similarity index 96%
rename from Source/core/dom/GenericEventQueue.h
rename to Source/core/events/GenericEventQueue.h
index a4d1c20..89aaccf 100644
--- a/Source/core/dom/GenericEventQueue.h
+++ b/Source/core/events/GenericEventQueue.h
@@ -26,8 +26,8 @@
 #ifndef GenericEventQueue_h
 #define GenericEventQueue_h
 
-#include "core/dom/EventQueue.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventQueue.h"
+#include "core/events/EventTarget.h"
 #include "core/platform/Timer.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/dom/GestureEvent.cpp b/Source/core/events/GestureEvent.cpp
similarity index 98%
rename from Source/core/dom/GestureEvent.cpp
rename to Source/core/events/GestureEvent.cpp
index 6423c0a..0bb01af 100644
--- a/Source/core/dom/GestureEvent.cpp
+++ b/Source/core/events/GestureEvent.cpp
@@ -25,7 +25,7 @@
 
 #include "config.h"
 #include "core/dom/Element.h"
-#include "core/dom/GestureEvent.h"
+#include "core/events/GestureEvent.h"
 #include "wtf/text/AtomicString.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/GestureEvent.h b/Source/core/events/GestureEvent.h
similarity index 96%
rename from Source/core/dom/GestureEvent.h
rename to Source/core/events/GestureEvent.h
index a0d6f2e..51a87df 100644
--- a/Source/core/dom/GestureEvent.h
+++ b/Source/core/events/GestureEvent.h
@@ -26,8 +26,8 @@
 #ifndef GestureEvent_h
 #define GestureEvent_h
 
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/MouseRelatedEvent.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/MouseRelatedEvent.h"
 #include "core/platform/PlatformGestureEvent.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/HashChangeEvent.h b/Source/core/events/HashChangeEvent.h
similarity index 97%
rename from Source/core/dom/HashChangeEvent.h
rename to Source/core/events/HashChangeEvent.h
index dee8c10..4eb66bb 100644
--- a/Source/core/dom/HashChangeEvent.h
+++ b/Source/core/events/HashChangeEvent.h
@@ -21,8 +21,8 @@
 #ifndef HashChangeEvent_h
 #define HashChangeEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/HashChangeEvent.idl b/Source/core/events/HashChangeEvent.idl
similarity index 100%
rename from Source/core/dom/HashChangeEvent.idl
rename to Source/core/events/HashChangeEvent.idl
diff --git a/Source/core/dom/KeyboardEvent.cpp b/Source/core/events/KeyboardEvent.cpp
similarity index 98%
rename from Source/core/dom/KeyboardEvent.cpp
rename to Source/core/events/KeyboardEvent.cpp
index b20d77a..bb302b9 100644
--- a/Source/core/dom/KeyboardEvent.cpp
+++ b/Source/core/events/KeyboardEvent.cpp
@@ -21,9 +21,9 @@
  */
 
 #include "config.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/platform/PlatformKeyboardEvent.h"
 #include "core/platform/WindowsKeyboardCodes.h"
 
diff --git a/Source/core/dom/KeyboardEvent.h b/Source/core/events/KeyboardEvent.h
similarity index 97%
rename from Source/core/dom/KeyboardEvent.h
rename to Source/core/events/KeyboardEvent.h
index 3cbeb06..7ee78e5 100644
--- a/Source/core/dom/KeyboardEvent.h
+++ b/Source/core/events/KeyboardEvent.h
@@ -24,8 +24,8 @@
 #ifndef KeyboardEvent_h
 #define KeyboardEvent_h
 
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/UIEventWithKeyState.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/UIEventWithKeyState.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/KeyboardEvent.idl b/Source/core/events/KeyboardEvent.idl
similarity index 100%
rename from Source/core/dom/KeyboardEvent.idl
rename to Source/core/events/KeyboardEvent.idl
diff --git a/Source/core/dom/MessageEvent.cpp b/Source/core/events/MessageEvent.cpp
similarity index 97%
rename from Source/core/dom/MessageEvent.cpp
rename to Source/core/events/MessageEvent.cpp
index 351275c..0608a18 100644
--- a/Source/core/dom/MessageEvent.cpp
+++ b/Source/core/events/MessageEvent.cpp
@@ -26,9 +26,9 @@
  */
 
 #include "config.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/MessageEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/page/DOMWindow.h"
 
 namespace WebCore {
@@ -92,7 +92,6 @@
     , m_dataType(DataTypeString)
     , m_dataAsString(data)
     , m_origin(origin)
-    , m_lastEventId("")
 {
     ScriptWrappable::init(this);
 }
@@ -102,7 +101,6 @@
     , m_dataType(DataTypeBlob)
     , m_dataAsBlob(data)
     , m_origin(origin)
-    , m_lastEventId("")
 {
     ScriptWrappable::init(this);
 }
@@ -112,7 +110,6 @@
     , m_dataType(DataTypeArrayBuffer)
     , m_dataAsArrayBuffer(data)
     , m_origin(origin)
-    , m_lastEventId("")
 {
     ScriptWrappable::init(this);
 }
diff --git a/Source/core/dom/MessageEvent.h b/Source/core/events/MessageEvent.h
similarity index 93%
rename from Source/core/dom/MessageEvent.h
rename to Source/core/events/MessageEvent.h
index e6647c1..3c07d5e 100644
--- a/Source/core/dom/MessageEvent.h
+++ b/Source/core/events/MessageEvent.h
@@ -29,8 +29,8 @@
 #define MessageEvent_h
 
 #include "bindings/v8/SerializedScriptValue.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/Event.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/MessagePort.h"
 #include "core/fileapi/Blob.h"
 #include "core/page/DOMWindow.h"
@@ -53,23 +53,23 @@
     {
         return adoptRef(new MessageEvent);
     }
-    static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, const String& origin = "", const String& lastEventId = "", PassRefPtr<EventTarget> source = 0)
+    static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
     {
         return adoptRef(new MessageEvent(origin, lastEventId, source, ports));
     }
-    static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = "", const String& lastEventId = "", PassRefPtr<EventTarget> source = 0)
+    static PassRefPtr<MessageEvent> create(PassOwnPtr<MessagePortArray> ports, PassRefPtr<SerializedScriptValue> data, const String& origin = String(), const String& lastEventId = String(), PassRefPtr<EventTarget> source = 0)
     {
         return adoptRef(new MessageEvent(data, origin, lastEventId, source, ports));
     }
-    static PassRefPtr<MessageEvent> create(const String& data, const String& origin = "")
+    static PassRefPtr<MessageEvent> create(const String& data, const String& origin = String())
     {
         return adoptRef(new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(PassRefPtr<Blob> data, const String& origin = "")
+    static PassRefPtr<MessageEvent> create(PassRefPtr<Blob> data, const String& origin = String())
     {
         return adoptRef(new MessageEvent(data, origin));
     }
-    static PassRefPtr<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const String& origin = "")
+    static PassRefPtr<MessageEvent> create(PassRefPtr<ArrayBuffer> data, const String& origin = String())
     {
         return adoptRef(new MessageEvent(data, origin));
     }
diff --git a/Source/core/dom/MessageEvent.idl b/Source/core/events/MessageEvent.idl
similarity index 100%
rename from Source/core/dom/MessageEvent.idl
rename to Source/core/events/MessageEvent.idl
diff --git a/Source/core/dom/MouseEvent.cpp b/Source/core/events/MouseEvent.cpp
similarity index 98%
rename from Source/core/dom/MouseEvent.cpp
rename to Source/core/events/MouseEvent.cpp
index 6ae78a2..502b664 100644
--- a/Source/core/dom/MouseEvent.cpp
+++ b/Source/core/events/MouseEvent.cpp
@@ -21,12 +21,12 @@
  */
 
 #include "config.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 
 #include "core/dom/Clipboard.h"
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventRetargeter.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventRetargeter.h"
 #include "core/platform/PlatformMouseEvent.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/MouseEvent.h b/Source/core/events/MouseEvent.h
similarity index 98%
rename from Source/core/dom/MouseEvent.h
rename to Source/core/events/MouseEvent.h
index 5ef39b0..139cea8 100644
--- a/Source/core/dom/MouseEvent.h
+++ b/Source/core/events/MouseEvent.h
@@ -24,8 +24,8 @@
 #ifndef MouseEvent_h
 #define MouseEvent_h
 
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/MouseRelatedEvent.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/MouseRelatedEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/MouseEvent.idl b/Source/core/events/MouseEvent.idl
similarity index 100%
rename from Source/core/dom/MouseEvent.idl
rename to Source/core/events/MouseEvent.idl
diff --git a/Source/core/dom/MouseRelatedEvent.cpp b/Source/core/events/MouseRelatedEvent.cpp
similarity index 99%
rename from Source/core/dom/MouseRelatedEvent.cpp
rename to Source/core/events/MouseRelatedEvent.cpp
index 147ba2d..f255841 100644
--- a/Source/core/dom/MouseRelatedEvent.cpp
+++ b/Source/core/events/MouseRelatedEvent.cpp
@@ -21,7 +21,7 @@
  */
 
 #include "config.h"
-#include "core/dom/MouseRelatedEvent.h"
+#include "core/events/MouseRelatedEvent.h"
 
 #include "core/dom/Document.h"
 #include "core/page/DOMWindow.h"
diff --git a/Source/core/dom/MouseRelatedEvent.h b/Source/core/events/MouseRelatedEvent.h
similarity index 98%
rename from Source/core/dom/MouseRelatedEvent.h
rename to Source/core/events/MouseRelatedEvent.h
index a33ddf8..de546d6 100644
--- a/Source/core/dom/MouseRelatedEvent.h
+++ b/Source/core/events/MouseRelatedEvent.h
@@ -24,7 +24,7 @@
 #ifndef MouseRelatedEvent_h
 #define MouseRelatedEvent_h
 
-#include "core/dom/UIEventWithKeyState.h"
+#include "core/events/UIEventWithKeyState.h"
 #include "core/platform/graphics/LayoutPoint.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/MutationEvent.cpp b/Source/core/events/MutationEvent.cpp
similarity index 96%
rename from Source/core/dom/MutationEvent.cpp
rename to Source/core/events/MutationEvent.cpp
index fcb19b9..290ce2d 100644
--- a/Source/core/dom/MutationEvent.cpp
+++ b/Source/core/events/MutationEvent.cpp
@@ -21,9 +21,9 @@
  */
 
 #include "config.h"
-#include "core/dom/MutationEvent.h"
+#include "core/events/MutationEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/MutationEvent.h b/Source/core/events/MutationEvent.h
similarity index 98%
rename from Source/core/dom/MutationEvent.h
rename to Source/core/events/MutationEvent.h
index 15e3da1..f0ef13e 100644
--- a/Source/core/dom/MutationEvent.h
+++ b/Source/core/events/MutationEvent.h
@@ -24,7 +24,7 @@
 #ifndef MutationEvent_h
 #define MutationEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/Node.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/MutationEvent.idl b/Source/core/events/MutationEvent.idl
similarity index 100%
rename from Source/core/dom/MutationEvent.idl
rename to Source/core/events/MutationEvent.idl
diff --git a/Source/core/dom/OverflowEvent.cpp b/Source/core/events/OverflowEvent.cpp
similarity index 97%
rename from Source/core/dom/OverflowEvent.cpp
rename to Source/core/events/OverflowEvent.cpp
index 63ee454..eec8c48 100644
--- a/Source/core/dom/OverflowEvent.cpp
+++ b/Source/core/events/OverflowEvent.cpp
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "core/dom/OverflowEvent.h"
+#include "core/events/OverflowEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/OverflowEvent.h b/Source/core/events/OverflowEvent.h
similarity index 98%
rename from Source/core/dom/OverflowEvent.h
rename to Source/core/events/OverflowEvent.h
index 7509469..96c220b 100644
--- a/Source/core/dom/OverflowEvent.h
+++ b/Source/core/events/OverflowEvent.h
@@ -26,7 +26,7 @@
 #ifndef OverflowEvent_h
 #define OverflowEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/OverflowEvent.idl b/Source/core/events/OverflowEvent.idl
similarity index 100%
rename from Source/core/dom/OverflowEvent.idl
rename to Source/core/events/OverflowEvent.idl
diff --git a/Source/core/dom/PageTransitionEvent.cpp b/Source/core/events/PageTransitionEvent.cpp
similarity index 96%
rename from Source/core/dom/PageTransitionEvent.cpp
rename to Source/core/events/PageTransitionEvent.cpp
index b351ef4..61b505a 100644
--- a/Source/core/dom/PageTransitionEvent.cpp
+++ b/Source/core/events/PageTransitionEvent.cpp
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "core/dom/PageTransitionEvent.h"
+#include "core/events/PageTransitionEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/PageTransitionEvent.h b/Source/core/events/PageTransitionEvent.h
similarity index 98%
rename from Source/core/dom/PageTransitionEvent.h
rename to Source/core/events/PageTransitionEvent.h
index 723dfff..1002f55 100644
--- a/Source/core/dom/PageTransitionEvent.h
+++ b/Source/core/events/PageTransitionEvent.h
@@ -26,7 +26,7 @@
 #ifndef PageTransitionEvent_h
 #define PageTransitionEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/PageTransitionEvent.idl b/Source/core/events/PageTransitionEvent.idl
similarity index 100%
rename from Source/core/dom/PageTransitionEvent.idl
rename to Source/core/events/PageTransitionEvent.idl
diff --git a/Source/core/dom/PopStateEvent.cpp b/Source/core/events/PopStateEvent.cpp
similarity index 97%
rename from Source/core/dom/PopStateEvent.cpp
rename to Source/core/events/PopStateEvent.cpp
index 652d9a2..73e3363 100644
--- a/Source/core/dom/PopStateEvent.cpp
+++ b/Source/core/events/PopStateEvent.cpp
@@ -25,10 +25,10 @@
  */
 
 #include "config.h"
-#include "core/dom/PopStateEvent.h"
+#include "core/events/PopStateEvent.h"
 
 #include "bindings/v8/SerializedScriptValue.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/page/History.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/PopStateEvent.h b/Source/core/events/PopStateEvent.h
similarity index 98%
rename from Source/core/dom/PopStateEvent.h
rename to Source/core/events/PopStateEvent.h
index 19abdd1..5f874ea 100644
--- a/Source/core/dom/PopStateEvent.h
+++ b/Source/core/events/PopStateEvent.h
@@ -27,7 +27,7 @@
 #ifndef PopStateEvent_h
 #define PopStateEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/PopStateEvent.idl b/Source/core/events/PopStateEvent.idl
similarity index 100%
rename from Source/core/dom/PopStateEvent.idl
rename to Source/core/events/PopStateEvent.idl
diff --git a/Source/core/dom/ProgressEvent.cpp b/Source/core/events/ProgressEvent.cpp
similarity index 96%
rename from Source/core/dom/ProgressEvent.cpp
rename to Source/core/events/ProgressEvent.cpp
index da8a3c1..3a590b7 100644
--- a/Source/core/dom/ProgressEvent.cpp
+++ b/Source/core/events/ProgressEvent.cpp
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "core/dom/ProgressEvent.h"
+#include "core/events/ProgressEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ProgressEvent.h b/Source/core/events/ProgressEvent.h
similarity index 98%
rename from Source/core/dom/ProgressEvent.h
rename to Source/core/events/ProgressEvent.h
index 035e23e..eb5edb7 100644
--- a/Source/core/dom/ProgressEvent.h
+++ b/Source/core/events/ProgressEvent.h
@@ -26,7 +26,7 @@
 #ifndef ProgressEvent_h
 #define ProgressEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ProgressEvent.idl b/Source/core/events/ProgressEvent.idl
similarity index 100%
rename from Source/core/dom/ProgressEvent.idl
rename to Source/core/events/ProgressEvent.idl
diff --git a/Source/core/dom/RegisteredEventListener.h b/Source/core/events/RegisteredEventListener.h
similarity index 97%
rename from Source/core/dom/RegisteredEventListener.h
rename to Source/core/events/RegisteredEventListener.h
index 7dde557..5da1fb9 100644
--- a/Source/core/dom/RegisteredEventListener.h
+++ b/Source/core/events/RegisteredEventListener.h
@@ -24,7 +24,7 @@
 #ifndef RegisteredEventListener_h
 #define RegisteredEventListener_h
 
-#include "core/dom/EventListener.h"
+#include "core/events/EventListener.h"
 #include "wtf/RefPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/ResourceProgressEvent.cpp b/Source/core/events/ResourceProgressEvent.cpp
similarity index 97%
rename from Source/core/dom/ResourceProgressEvent.cpp
rename to Source/core/events/ResourceProgressEvent.cpp
index 55310bb..50a9f43 100644
--- a/Source/core/dom/ResourceProgressEvent.cpp
+++ b/Source/core/events/ResourceProgressEvent.cpp
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "core/dom/ResourceProgressEvent.h"
+#include "core/events/ResourceProgressEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ResourceProgressEvent.h b/Source/core/events/ResourceProgressEvent.h
similarity index 98%
rename from Source/core/dom/ResourceProgressEvent.h
rename to Source/core/events/ResourceProgressEvent.h
index 50e7226..9c88b19 100644
--- a/Source/core/dom/ResourceProgressEvent.h
+++ b/Source/core/events/ResourceProgressEvent.h
@@ -31,7 +31,7 @@
 #ifndef ResourceProgressEvent_h
 #define ResourceProgressEvent_h
 
-#include "core/dom/ProgressEvent.h"
+#include "core/events/ProgressEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/ResourceProgressEvent.idl b/Source/core/events/ResourceProgressEvent.idl
similarity index 100%
rename from Source/core/dom/ResourceProgressEvent.idl
rename to Source/core/events/ResourceProgressEvent.idl
diff --git a/Source/core/dom/ScopedEventQueue.cpp b/Source/core/events/ScopedEventQueue.cpp
similarity index 93%
rename from Source/core/dom/ScopedEventQueue.cpp
rename to Source/core/events/ScopedEventQueue.cpp
index 8072c59..aba041a 100644
--- a/Source/core/dom/ScopedEventQueue.cpp
+++ b/Source/core/events/ScopedEventQueue.cpp
@@ -29,12 +29,12 @@
  */
 
 #include "config.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/Event.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/EventTarget.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/RefPtr.h"
 
diff --git a/Source/core/dom/ScopedEventQueue.h b/Source/core/events/ScopedEventQueue.h
similarity index 100%
rename from Source/core/dom/ScopedEventQueue.h
rename to Source/core/events/ScopedEventQueue.h
diff --git a/Source/core/dom/SecurityPolicyViolationEvent.h b/Source/core/events/SecurityPolicyViolationEvent.h
similarity index 98%
rename from Source/core/dom/SecurityPolicyViolationEvent.h
rename to Source/core/events/SecurityPolicyViolationEvent.h
index 40ff41b..bde8a28 100644
--- a/Source/core/dom/SecurityPolicyViolationEvent.h
+++ b/Source/core/events/SecurityPolicyViolationEvent.h
@@ -25,8 +25,8 @@
 #ifndef SecurityPolicyViolationEvent_h
 #define SecurityPolicyViolationEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/SecurityPolicyViolationEvent.idl b/Source/core/events/SecurityPolicyViolationEvent.idl
similarity index 100%
rename from Source/core/dom/SecurityPolicyViolationEvent.idl
rename to Source/core/events/SecurityPolicyViolationEvent.idl
diff --git a/Source/core/dom/TextEvent.cpp b/Source/core/events/TextEvent.cpp
similarity index 97%
rename from Source/core/dom/TextEvent.cpp
rename to Source/core/events/TextEvent.cpp
index e3ee3c8..a58ed60 100644
--- a/Source/core/dom/TextEvent.cpp
+++ b/Source/core/events/TextEvent.cpp
@@ -25,10 +25,10 @@
  */
 
 #include "config.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/TextEvent.h"
 
 #include "core/dom/DocumentFragment.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/TextEvent.h b/Source/core/events/TextEvent.h
similarity index 90%
rename from Source/core/dom/TextEvent.h
rename to Source/core/events/TextEvent.h
index c0dcb69..0037670 100644
--- a/Source/core/dom/TextEvent.h
+++ b/Source/core/events/TextEvent.h
@@ -27,8 +27,9 @@
 #ifndef TextEvent_h
 #define TextEvent_h
 
-#include "core/dom/TextEventInputType.h"
-#include "core/dom/UIEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/TextEventInputType.h"
+#include "core/events/UIEvent.h"
 
 namespace WebCore {
 
@@ -76,6 +77,12 @@
         bool m_shouldMatchStyle;
     };
 
+inline TextEvent* toTextEvent(Event* event)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!event || (event->type() == eventNames().textInputEvent && event->hasInterface(eventNames().interfaceForTextEvent)));
+    return static_cast<TextEvent*>(event);
+}
+
 } // namespace WebCore
 
 #endif // TextEvent_h
diff --git a/Source/core/dom/TextEvent.idl b/Source/core/events/TextEvent.idl
similarity index 100%
rename from Source/core/dom/TextEvent.idl
rename to Source/core/events/TextEvent.idl
diff --git a/Source/core/dom/TextEventInputType.h b/Source/core/events/TextEventInputType.h
similarity index 100%
rename from Source/core/dom/TextEventInputType.h
rename to Source/core/events/TextEventInputType.h
diff --git a/Source/core/dom/TouchEvent.cpp b/Source/core/events/TouchEvent.cpp
similarity index 94%
rename from Source/core/dom/TouchEvent.cpp
rename to Source/core/events/TouchEvent.cpp
index 019a5b5..1408e0e 100644
--- a/Source/core/dom/TouchEvent.cpp
+++ b/Source/core/events/TouchEvent.cpp
@@ -26,11 +26,11 @@
 
 #include "config.h"
 
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 
-#include "core/dom/EventDispatcher.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventRetargeter.h"
+#include "core/events/EventDispatcher.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventRetargeter.h"
 #include "core/dom/TouchList.h"
 
 namespace WebCore {
@@ -102,7 +102,7 @@
 
 TouchEvent* TouchEventDispatchMediator::event() const
 {
-    return static_cast<TouchEvent*>(EventDispatchMediator::event());
+    return toTouchEvent(EventDispatchMediator::event());
 }
 
 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
diff --git a/Source/core/dom/TouchEvent.h b/Source/core/events/TouchEvent.h
similarity index 97%
rename from Source/core/dom/TouchEvent.h
rename to Source/core/events/TouchEvent.h
index 45a38dd..11ad47f 100644
--- a/Source/core/dom/TouchEvent.h
+++ b/Source/core/events/TouchEvent.h
@@ -27,8 +27,8 @@
 #ifndef TouchEvent_h
 #define TouchEvent_h
 
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/MouseRelatedEvent.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/MouseRelatedEvent.h"
 #include "core/dom/TouchList.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/TouchEvent.idl b/Source/core/events/TouchEvent.idl
similarity index 100%
rename from Source/core/dom/TouchEvent.idl
rename to Source/core/events/TouchEvent.idl
diff --git a/Source/core/dom/TransitionEvent.cpp b/Source/core/events/TransitionEvent.cpp
similarity index 96%
rename from Source/core/dom/TransitionEvent.cpp
rename to Source/core/events/TransitionEvent.cpp
index 346a66f..3a00030 100644
--- a/Source/core/dom/TransitionEvent.cpp
+++ b/Source/core/events/TransitionEvent.cpp
@@ -25,9 +25,9 @@
  */
 
 #include "config.h"
-#include "core/dom/TransitionEvent.h"
+#include "core/events/TransitionEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/TransitionEvent.h b/Source/core/events/TransitionEvent.h
similarity index 98%
rename from Source/core/dom/TransitionEvent.h
rename to Source/core/events/TransitionEvent.h
index 9fe4ffb..e1d5fa2 100644
--- a/Source/core/dom/TransitionEvent.h
+++ b/Source/core/events/TransitionEvent.h
@@ -27,7 +27,7 @@
 #ifndef TransitionEvent_h
 #define TransitionEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/TransitionEvent.idl b/Source/core/events/TransitionEvent.idl
similarity index 100%
rename from Source/core/dom/TransitionEvent.idl
rename to Source/core/events/TransitionEvent.idl
diff --git a/Source/core/dom/UIEvent.cpp b/Source/core/events/UIEvent.cpp
similarity index 98%
rename from Source/core/dom/UIEvent.cpp
rename to Source/core/events/UIEvent.cpp
index ade3856..d0ef6f4 100644
--- a/Source/core/dom/UIEvent.cpp
+++ b/Source/core/events/UIEvent.cpp
@@ -21,7 +21,7 @@
  */
 
 #include "config.h"
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 
 #include "core/page/DOMWindow.h"
 
diff --git a/Source/core/dom/UIEvent.h b/Source/core/events/UIEvent.h
similarity index 96%
rename from Source/core/dom/UIEvent.h
rename to Source/core/events/UIEvent.h
index ae52a89..507185d 100644
--- a/Source/core/dom/UIEvent.h
+++ b/Source/core/events/UIEvent.h
@@ -24,8 +24,8 @@
 #ifndef UIEvent_h
 #define UIEvent_h
 
-#include "core/dom/Event.h"
-#include "core/dom/EventDispatchMediator.h"
+#include "core/events/Event.h"
+#include "core/events/EventDispatchMediator.h"
 #include "core/page/DOMWindow.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/UIEvent.idl b/Source/core/events/UIEvent.idl
similarity index 100%
rename from Source/core/dom/UIEvent.idl
rename to Source/core/events/UIEvent.idl
diff --git a/Source/core/dom/UIEventWithKeyState.cpp b/Source/core/events/UIEventWithKeyState.cpp
similarity index 95%
rename from Source/core/dom/UIEventWithKeyState.cpp
rename to Source/core/events/UIEventWithKeyState.cpp
index da510d9..9c8ab57 100644
--- a/Source/core/dom/UIEventWithKeyState.cpp
+++ b/Source/core/events/UIEventWithKeyState.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "core/dom/UIEventWithKeyState.h"
+#include "core/events/UIEventWithKeyState.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/UIEventWithKeyState.h b/Source/core/events/UIEventWithKeyState.h
similarity index 98%
rename from Source/core/dom/UIEventWithKeyState.h
rename to Source/core/events/UIEventWithKeyState.h
index bcf9a80..29c8c19 100644
--- a/Source/core/dom/UIEventWithKeyState.h
+++ b/Source/core/events/UIEventWithKeyState.h
@@ -24,7 +24,7 @@
 #ifndef UIEventWithKeyState_h
 #define UIEventWithKeyState_h
 
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/WebKitAnimationEvent.cpp b/Source/core/events/WebKitAnimationEvent.cpp
similarity index 96%
rename from Source/core/dom/WebKitAnimationEvent.cpp
rename to Source/core/events/WebKitAnimationEvent.cpp
index 777a5a4..b1ba493 100644
--- a/Source/core/dom/WebKitAnimationEvent.cpp
+++ b/Source/core/events/WebKitAnimationEvent.cpp
@@ -24,9 +24,9 @@
  */
 
 #include "config.h"
-#include "core/dom/WebKitAnimationEvent.h"
+#include "core/events/WebKitAnimationEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/WebKitAnimationEvent.h b/Source/core/events/WebKitAnimationEvent.h
similarity index 98%
rename from Source/core/dom/WebKitAnimationEvent.h
rename to Source/core/events/WebKitAnimationEvent.h
index 8f642bf..b91c980 100644
--- a/Source/core/dom/WebKitAnimationEvent.h
+++ b/Source/core/events/WebKitAnimationEvent.h
@@ -26,7 +26,7 @@
 #ifndef WebKitAnimationEvent_h
 #define WebKitAnimationEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/WebKitAnimationEvent.idl b/Source/core/events/WebKitAnimationEvent.idl
similarity index 100%
rename from Source/core/dom/WebKitAnimationEvent.idl
rename to Source/core/events/WebKitAnimationEvent.idl
diff --git a/Source/core/dom/WheelEvent.cpp b/Source/core/events/WheelEvent.cpp
similarity index 98%
rename from Source/core/dom/WheelEvent.cpp
rename to Source/core/events/WheelEvent.cpp
index f2b71f6..c252aa3 100644
--- a/Source/core/dom/WheelEvent.cpp
+++ b/Source/core/events/WheelEvent.cpp
@@ -22,10 +22,10 @@
  */
 
 #include "config.h"
-#include "core/dom/WheelEvent.h"
+#include "core/events/WheelEvent.h"
 
 #include "core/dom/Clipboard.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/platform/PlatformWheelEvent.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/WheelEvent.h b/Source/core/events/WheelEvent.h
similarity index 97%
rename from Source/core/dom/WheelEvent.h
rename to Source/core/events/WheelEvent.h
index c393f37..c8c5dec 100644
--- a/Source/core/dom/WheelEvent.h
+++ b/Source/core/events/WheelEvent.h
@@ -25,8 +25,8 @@
 #ifndef WheelEvent_h
 #define WheelEvent_h
 
-#include "core/dom/EventDispatchMediator.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventDispatchMediator.h"
+#include "core/events/MouseEvent.h"
 #include "core/platform/graphics/FloatPoint.h"
 
 namespace WebCore {
diff --git a/Source/core/dom/WheelEvent.idl b/Source/core/events/WheelEvent.idl
similarity index 100%
rename from Source/core/dom/WheelEvent.idl
rename to Source/core/events/WheelEvent.idl
diff --git a/Source/core/dom/WindowEventContext.cpp b/Source/core/events/WindowEventContext.cpp
similarity index 95%
rename from Source/core/dom/WindowEventContext.cpp
rename to Source/core/events/WindowEventContext.cpp
index b9cbaa9..7ab4a57 100644
--- a/Source/core/dom/WindowEventContext.cpp
+++ b/Source/core/events/WindowEventContext.cpp
@@ -25,11 +25,11 @@
  */
 
 #include "config.h"
-#include "core/dom/WindowEventContext.h"
+#include "core/events/WindowEventContext.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventContext.h"
+#include "core/events/Event.h"
+#include "core/events/EventContext.h"
 #include "core/dom/Node.h"
 #include "core/page/DOMWindow.h"
 
diff --git a/Source/core/dom/WindowEventContext.h b/Source/core/events/WindowEventContext.h
similarity index 100%
rename from Source/core/dom/WindowEventContext.h
rename to Source/core/events/WindowEventContext.h
diff --git a/Source/core/features.gypi b/Source/core/features.gypi
index e5d8d6b..979137d 100644
--- a/Source/core/features.gypi
+++ b/Source/core/features.gypi
@@ -63,7 +63,6 @@
           'ENABLE_MEDIA_CAPTURE=1',
           'ENABLE_ORIENTATION_EVENTS=1',
           'ENABLE_NAVIGATOR_CONTENT_UTILS=0',
-          'WTF_USE_NATIVE_FULLSCREEN_VIDEO=1',
         ],
         'enable_touch_icon_loading': 1,
       }, { # OS!="android"
@@ -97,11 +96,6 @@
           'ENABLE_OPENTYPE_VERTICAL=1',
         ],
       }],
-      ['OS=="mac"', {
-        'feature_defines': [
-          'ENABLE_RUBBER_BANDING=1',
-        ],
-      }],
       ['use_default_render_theme==1', {
         'feature_defines': [
           'ENABLE_DEFAULT_RENDER_THEME=1',
diff --git a/Source/core/fetch/FetchInitiatorTypeNames.in b/Source/core/fetch/FetchInitiatorTypeNames.in
index 7356271..5f429b0 100644
--- a/Source/core/fetch/FetchInitiatorTypeNames.in
+++ b/Source/core/fetch/FetchInitiatorTypeNames.in
@@ -1,6 +1,7 @@
 css
 document
 icon
+inspector
 link
 processinginstruction
 texttrack
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index e6e2114..0736d26 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -181,13 +181,9 @@
         request.setURL(url);
         m_fragmentIdentifierForRequest = String();
     }
-
-    m_loader = ResourceLoader::create(fetcher, this, request, options);
-    if (!m_loader) {
-        failBeforeStarting();
-        return;
-    }
     m_status = Pending;
+    m_loader = ResourceLoader::create(fetcher, this, request, options);
+    m_loader->start();
 }
 
 void Resource::checkNotify()
@@ -213,6 +209,15 @@
     setEncodedSize(m_data->size());
 }
 
+void Resource::setResourceBuffer(PassRefPtr<SharedBuffer> resourceBuffer)
+{
+    ASSERT(!m_resourceToRevalidate);
+    ASSERT(!errorOccurred());
+    ASSERT(m_options.dataBufferingPolicy == BufferData);
+    m_data = resourceBuffer;
+    setEncodedSize(m_data->size());
+}
+
 void Resource::error(Resource::Status status)
 {
     if (m_resourceToRevalidate)
diff --git a/Source/core/fetch/Resource.h b/Source/core/fetch/Resource.h
index bd9c37f..ba300c9 100644
--- a/Source/core/fetch/Resource.h
+++ b/Source/core/fetch/Resource.h
@@ -70,8 +70,7 @@
         LinkSubresource,
         TextTrack,
         Shader,
-        ImportResource,
-        NumberOfTypes,
+        ImportResource
     };
 
     enum Status {
@@ -183,6 +182,7 @@
     void clearLoader();
 
     SharedBuffer* resourceBuffer() const { ASSERT(!m_purgeableData); return m_data.get(); }
+    void setResourceBuffer(PassRefPtr<SharedBuffer>);
 
     virtual void willSendRequest(ResourceRequest&, const ResourceResponse&) { m_requestedFromNetworkingLayer = true; }
     virtual void responseReceived(const ResourceResponse&);
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 9652049..337a677 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -59,7 +59,6 @@
 #include "core/page/Performance.h"
 #include "core/page/ResourceTimingInfo.h"
 #include "core/page/Settings.h"
-#include "core/platform/HistogramSupport.h"
 #include "core/platform/Logging.h"
 #include "core/platform/chromium/TraceEvent.h"
 #include "public/platform/Platform.h"
@@ -73,16 +72,7 @@
 
 namespace WebCore {
 
-namespace {
-
-enum ActionUponResourceRequest {
-    LoadResource,
-    RevalidateResource,
-    UseResourceFromCache,
-    NumberOfResourceRequestActions,
-};
-
-Resource* createResource(Resource::Type type, const ResourceRequest& request, const String& charset)
+static Resource* createResource(Resource::Type type, const ResourceRequest& request, const String& charset)
 {
     switch (type) {
     case Resource::Image:
@@ -110,15 +100,13 @@
         return new ShaderResource(request);
     case Resource::ImportResource:
         return new RawResource(request, type);
-    case Resource::NumberOfTypes:
-        ASSERT_NOT_REACHED();
     }
 
     ASSERT_NOT_REACHED();
     return 0;
 }
 
-ResourceLoadPriority loadPriority(Resource::Type type, const FetchRequest& request)
+static ResourceLoadPriority loadPriority(Resource::Type type, const FetchRequest& request)
 {
     if (request.priority() != ResourceLoadPriorityUnresolved)
         return request.priority();
@@ -128,9 +116,10 @@
         return ResourceLoadPriorityVeryHigh;
     case Resource::CSSStyleSheet:
         return ResourceLoadPriorityHigh;
+    case Resource::Raw:
+        return request.options().synchronousPolicy == RequestSynchronously ? ResourceLoadPriorityVeryHigh : ResourceLoadPriorityMedium;
     case Resource::Script:
     case Resource::Font:
-    case Resource::Raw:
     case Resource::ImportResource:
         return ResourceLoadPriorityMedium;
     case Resource::Image:
@@ -147,14 +136,12 @@
         return ResourceLoadPriorityLow;
     case Resource::Shader:
         return ResourceLoadPriorityMedium;
-    case Resource::NumberOfTypes:
-        ASSERT_NOT_REACHED();
     }
     ASSERT_NOT_REACHED();
     return ResourceLoadPriorityUnresolved;
 }
 
-Resource* resourceFromDataURIRequest(const ResourceRequest& request)
+static Resource* resourceFromDataURIRequest(const ResourceRequest& request)
 {
     const KURL& url = request.url();
     ASSERT(url.protocolIsData());
@@ -175,8 +162,6 @@
     return resource;
 }
 
-} // namespace
-
 ResourceFetcher::ResourceFetcher(DocumentLoader* documentLoader)
     : m_document(0)
     , m_documentLoader(documentLoader)
@@ -227,20 +212,14 @@
     return FetchContext::nullInstance();
 }
 
-unsigned long ResourceFetcher::fetchSynchronously(const ResourceRequest& passedRequest, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
+ResourcePtr<Resource> ResourceFetcher::fetchSynchronously(FetchRequest& request)
 {
     ASSERT(document());
-    ResourceRequest request(passedRequest);
-    request.setTimeoutInterval(10);
-    addAdditionalRequestHeaders(request, Resource::Raw);
-
-    unsigned long identifier = createUniqueIdentifier();
-    context().dispatchWillSendRequest(m_documentLoader, identifier, request, ResourceResponse());
-    documentLoader()->applicationCacheHost()->willStartLoadingSynchronously(request);
-    ResourceLoader::loadResourceSynchronously(request, storedCredentials, error, response, data);
-    int encodedDataLength = response.resourceLoadInfo() ? static_cast<int>(response.resourceLoadInfo()->encodedDataLength) : -1;
-    context().sendRemainingDelegateMessages(m_documentLoader, identifier, response, data.data(), data.size(), encodedDataLength, error);
-    return identifier;
+    request.mutableResourceRequest().setTimeoutInterval(10);
+    ResourceLoaderOptions options(request.options());
+    options.synchronousPolicy = RequestSynchronously;
+    request.setOptions(options);
+    return requestResource(Resource::Raw, request);
 }
 
 ResourcePtr<ImageResource> ResourceFetcher::fetchImage(FetchRequest& request)
@@ -373,8 +352,6 @@
             // These cannot affect the current document.
             treatment = TreatAsAlwaysAllowedContent;
             break;
-        case Resource::NumberOfTypes:
-            ASSERT_NOT_REACHED();
         }
     }
     if (treatment == TreatAsActiveContent) {
@@ -435,8 +412,6 @@
             return false;
         }
         break;
-    case Resource::NumberOfTypes:
-        ASSERT_NOT_REACHED();
     }
 
     switch (type) {
@@ -484,8 +459,6 @@
         if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentSecurityPolicy()->allowMediaFromSource(url))
             return false;
         break;
-    case Resource::NumberOfTypes:
-        ASSERT_NOT_REACHED();
     }
 
     // Last of all, check for insecure content. We do this last so that when
@@ -537,6 +510,8 @@
 
 ResourcePtr<Resource> ResourceFetcher::requestResource(Resource::Type type, FetchRequest& request)
 {
+    ASSERT(request.options().synchronousPolicy == RequestAsynchronously || type == Resource::Raw);
+
     KURL url = request.resourceRequest().url();
 
     LOG(ResourceLoading, "ResourceFetcher::requestResource '%s', charset '%s', priority=%d, forPreload=%u", url.elidedString().latin1().data(), request.charset().latin1().data(), request.priority(), request.forPreload());
@@ -563,27 +538,13 @@
         // Fall through
     case Load:
         resource = loadResource(type, request, request.charset());
-        HistogramSupport::histogramEnumeration(
-            "WebCore.ResourceFetcher.ActionUponResourceRequest", LoadResource,
-            NumberOfResourceRequestActions);
         break;
     case Revalidate:
         resource = revalidateResource(request, resource.get());
-        HistogramSupport::histogramEnumeration(
-            "WebCore.ResourceFetcher.ActionUponResourceRequest", RevalidateResource,
-            NumberOfResourceRequestActions);
         break;
     case Use:
         resource->updateForAccess();
         notifyLoadedFromMemoryCache(resource.get());
-        HistogramSupport::histogramEnumeration(
-            "WebCore.ResourceFetcher.ActionUponResourceRequest", UseResourceFromCache,
-            NumberOfResourceRequestActions);
-        HistogramSupport::histogramEnumeration(
-            "WebCore.ResourceFetcher.ResourceHasClientUponCacheHit", resource->hasClients(), 2);
-        HistogramSupport::histogramEnumeration(
-            "WebCore.ResourceFetcher.ResourceTypeUponCacheHit", resource->type(),
-            Resource::NumberOfTypes);
         break;
     }
 
@@ -611,11 +572,16 @@
         if (!m_documentLoader || !m_documentLoader->scheduleArchiveLoad(resource.get(), request.resourceRequest()))
             resource->load(this, request.options());
 
-        // We don't support immediate loads, but we do support immediate failure.
+        // For asynchronous loads that immediately fail, it's sufficient to return a
+        // null Resource, as it indicates that something prevented the load from starting.
+        // If there's a network error, that failure will happen asynchronously. However, if
+        // a sync load receives a network error, it will have already happened by this point.
+        // In that case, the requester should have access to the relevant ResourceError, so
+        // we need to return a non-null Resource.
         if (resource->errorOccurred()) {
             if (resource->inCache())
                 memoryCache()->remove(resource.get());
-            return 0;
+            return request.options().synchronousPolicy == RequestSynchronously ? resource : 0;
         }
     }
 
diff --git a/Source/core/fetch/ResourceFetcher.h b/Source/core/fetch/ResourceFetcher.h
index d6cc106..3508cf2 100644
--- a/Source/core/fetch/ResourceFetcher.h
+++ b/Source/core/fetch/ResourceFetcher.h
@@ -81,8 +81,7 @@
     using RefCounted<ResourceFetcher>::ref;
     using RefCounted<ResourceFetcher>::deref;
 
-    unsigned long fetchSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>&);
-
+    ResourcePtr<Resource> fetchSynchronously(FetchRequest&);
     ResourcePtr<ImageResource> fetchImage(FetchRequest&);
     ResourcePtr<CSSStyleSheetResource> fetchCSSStyleSheet(FetchRequest&);
     ResourcePtr<CSSStyleSheetResource> fetchUserCSSStyleSheet(FetchRequest&);
@@ -131,9 +130,7 @@
     void preload(Resource::Type, FetchRequest&, const String& charset);
     void checkForPendingPreloads();
     void printPreloadStats();
-    bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, bool forPreload = false);
     bool canAccess(Resource*);
-    bool checkInsecureContent(Resource::Type, const KURL&, MixedContentBlockingTreatment) const;
 
     void setDefersLoading(bool);
     void stopFetching();
@@ -181,6 +178,9 @@
     ResourceRequestCachePolicy resourceRequestCachePolicy(const ResourceRequest&, Resource::Type);
     void addAdditionalRequestHeaders(ResourceRequest&, Resource::Type);
 
+    bool canRequest(Resource::Type, const KURL&, const ResourceLoaderOptions&, bool forPreload = false);
+    bool checkInsecureContent(Resource::Type, const KURL&, MixedContentBlockingTreatment) const;
+
     void notifyLoadedFromMemoryCache(Resource*);
 
     void garbageCollectDocumentResourcesTimerFired(Timer<ResourceFetcher>*);
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index be3b720..7ab572c 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -63,7 +63,6 @@
 {
     RefPtr<ResourceLoader> loader(adoptRef(new ResourceLoader(host, resource, options)));
     loader->init(request);
-    loader->start();
     return loader.release();
 }
 
@@ -132,6 +131,11 @@
 
     m_host->willStartLoadingResource(m_request);
 
+    if (m_options.synchronousPolicy == RequestSynchronously) {
+        requestSynchronously();
+        return;
+    }
+
     if (m_defersLoading) {
         m_deferredRequest = m_request;
         return;
@@ -388,24 +392,30 @@
     return m_host->isLoadedBy(loader);
 }
 
-void ResourceLoader::loadResourceSynchronously(const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, Vector<char>& data)
+void ResourceLoader::requestSynchronously()
 {
     OwnPtr<WebKit::WebURLLoader> loader = adoptPtr(WebKit::Platform::current()->createURLLoader());
     ASSERT(loader);
 
-    WebKit::WrappedResourceRequest requestIn(request);
-    requestIn.setAllowStoredCredentials(storedCredentials == AllowStoredCredentials);
-    WebKit::WrappedResourceResponse responseOut(response);
+    RELEASE_ASSERT(m_connectionState == ConnectionStateNew);
+    m_connectionState = ConnectionStateStarted;
+
+    WebKit::WrappedResourceRequest requestIn(m_request);
+    requestIn.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredCredentials);
+    WebKit::WebURLResponse responseOut;
+    responseOut.initialize();
     WebKit::WebURLError errorOut;
     WebKit::WebData dataOut;
-
     loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
-
-    error = errorOut;
-    data.clear();
-    RefPtr<SharedBuffer> buffer = dataOut;
-    if (buffer)
-        buffer->moveTo(data);
+    if (errorOut.reason) {
+        didFail(0, errorOut);
+        return;
+    }
+    didReceiveResponse(0, responseOut);
+    RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse().resourceLoadInfo();
+    m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceLoadInfo ? resourceLoadInfo->encodedDataLength : -1, m_options);
+    m_resource->setResourceBuffer(dataOut);
+    didFinishLoading(0, responseOut.responseTime());
 }
 
 }
diff --git a/Source/core/fetch/ResourceLoader.h b/Source/core/fetch/ResourceLoader.h
index 884bc60..f53b9f5 100644
--- a/Source/core/fetch/ResourceLoader.h
+++ b/Source/core/fetch/ResourceLoader.h
@@ -49,7 +49,7 @@
     static PassRefPtr<ResourceLoader> create(ResourceLoaderHost*, Resource*, const ResourceRequest&, const ResourceLoaderOptions&);
     virtual ~ResourceLoader();
 
-    static void loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ResourceError&, ResourceResponse&, Vector<char>& data);
+    void start();
 
     void cancel();
     void cancel(const ResourceError&);
@@ -87,7 +87,7 @@
     ResourceLoader(ResourceLoaderHost*, Resource*, const ResourceLoaderOptions&);
 
     void init(const ResourceRequest&);
-    void start();
+    void requestSynchronously();
 
     void didFinishLoadingOnePart(double finishTime);
 
diff --git a/Source/core/fetch/ResourceLoaderOptions.h b/Source/core/fetch/ResourceLoaderOptions.h
index be960d3..124b7d5 100644
--- a/Source/core/fetch/ResourceLoaderOptions.h
+++ b/Source/core/fetch/ResourceLoaderOptions.h
@@ -97,6 +97,11 @@
     TreatAsAlwaysAllowedContent
 };
 
+enum SynchronousPolicy {
+    RequestSynchronously,
+    RequestAsynchronously
+};
+
 struct ResourceLoaderOptions {
     ResourceLoaderOptions()
         : sendLoadCallbacks(DoNotSendCallbacks)
@@ -110,6 +115,7 @@
         , requestOriginPolicy(UseDefaultOriginRestrictionsForType)
         , requestInitiatorContext(DocumentContext)
         , mixedContentBlockingTreatment(TreatAsDefaultForType)
+        , synchronousPolicy(RequestAsynchronously)
     {
     }
 
@@ -135,6 +141,7 @@
         , requestOriginPolicy(requestOriginPolicy)
         , requestInitiatorContext(requestInitiatorContext)
         , mixedContentBlockingTreatment(TreatAsDefaultForType)
+        , synchronousPolicy(RequestAsynchronously)
     {
     }
 
@@ -150,6 +157,7 @@
     RequestOriginPolicy requestOriginPolicy;
     RequestInitiatorContext requestInitiatorContext;
     MixedContentBlockingTreatment mixedContentBlockingTreatment;
+    SynchronousPolicy synchronousPolicy;
 };
 
 } // namespace WebCore
diff --git a/Source/core/fileapi/FileReader.cpp b/Source/core/fileapi/FileReader.cpp
index 6568c2f..0d274c0 100644
--- a/Source/core/fileapi/FileReader.cpp
+++ b/Source/core/fileapi/FileReader.cpp
@@ -34,7 +34,7 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/ProgressEvent.h"
+#include "core/events/ProgressEvent.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/fileapi/File.h"
 #include "core/platform/Logging.h"
@@ -148,7 +148,7 @@
 {
     // If multiple concurrent read methods are called on the same FileReader, InvalidStateError should be thrown when the state is LOADING.
     if (m_state == LOADING) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
diff --git a/Source/core/fileapi/FileReader.h b/Source/core/fileapi/FileReader.h
index aabd5d5..22f3708 100644
--- a/Source/core/fileapi/FileReader.h
+++ b/Source/core/fileapi/FileReader.h
@@ -33,7 +33,7 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/fileapi/FileError.h"
 #include "core/fileapi/FileReaderLoader.h"
 #include "core/fileapi/FileReaderLoaderClient.h"
diff --git a/Source/core/fileapi/FileReaderLoader.cpp b/Source/core/fileapi/FileReaderLoader.cpp
index b078247..7448e67 100644
--- a/Source/core/fileapi/FileReaderLoader.cpp
+++ b/Source/core/fileapi/FileReaderLoader.cpp
@@ -58,6 +58,7 @@
 FileReaderLoader::FileReaderLoader(ReadType readType, FileReaderLoaderClient* client)
     : m_readType(readType)
     , m_client(client)
+    , m_urlForReadingIsStream(false)
     , m_isRawDataConverted(false)
     , m_stringResult("")
     , m_variableLength(false)
@@ -73,8 +74,12 @@
 FileReaderLoader::~FileReaderLoader()
 {
     terminate();
-    if (!m_urlForReading.isEmpty())
-        BlobRegistry::unregisterBlobURL(m_urlForReading);
+    if (!m_urlForReading.isEmpty()) {
+        if (m_urlForReadingIsStream)
+            BlobRegistry::unregisterStreamURL(m_urlForReading);
+        else
+            BlobRegistry::unregisterBlobURL(m_urlForReading);
+    }
 }
 
 void FileReaderLoader::startForURL(ScriptExecutionContext* scriptExecutionContext, const KURL& url)
@@ -85,7 +90,11 @@
         failed(FileError::SECURITY_ERR);
         return;
     }
-    BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
+
+    if (m_urlForReadingIsStream)
+        BlobRegistry::registerStreamURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
+    else
+        BlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, url);
 
     // Construct and load the request.
     ResourceRequest request(m_urlForReading);
@@ -110,11 +119,19 @@
 
 void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Blob& blob)
 {
+    m_urlForReadingIsStream = false;
     startForURL(scriptExecutionContext, blob.url());
 }
 
-void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Stream& stream)
+void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, const Stream& stream, unsigned readSize)
 {
+    if (readSize > 0) {
+        m_hasRange = true;
+        m_rangeStart = 0;
+        m_rangeEnd = readSize - 1; // End is inclusive so (0,0) is a 1-byte read.
+    }
+
+    m_urlForReadingIsStream = true;
     startForURL(scriptExecutionContext, stream.url());
 }
 
@@ -140,6 +157,7 @@
     if (m_errorCode) {
         m_rawData = 0;
         m_stringResult = "";
+        m_isRawDataConverted = true;
     }
 }
 
@@ -193,6 +211,14 @@
     if (m_errorCode)
         return;
 
+    if (m_readType == ReadByClient) {
+        m_bytesLoaded += dataLength;
+
+        if (m_client)
+            m_client->didReceiveDataForClient(data, dataLength);
+        return;
+    }
+
     int length = dataLength;
     unsigned remainingBufferSpace = m_totalBytes - m_bytesLoaded;
     if (length > static_cast<long long>(remainingBufferSpace)) {
@@ -229,10 +255,12 @@
 
 void FileReaderLoader::didFinishLoading(unsigned long, double)
 {
-    if (m_variableLength && m_totalBytes > m_bytesLoaded) {
+    if (m_readType != ReadByClient && m_variableLength && m_totalBytes > m_bytesLoaded) {
         RefPtr<ArrayBuffer> newData = m_rawData->slice(0, m_bytesLoaded);
 
         m_rawData = newData;
+        m_isRawDataConverted = false;
+
         m_totalBytes = m_bytesLoaded;
     }
     cleanup();
@@ -287,7 +315,7 @@
 
 String FileReaderLoader::stringResult()
 {
-    ASSERT(m_readType != ReadAsArrayBuffer && m_readType != ReadAsBlob);
+    ASSERT(m_readType != ReadAsArrayBuffer && m_readType != ReadAsBlob && m_readType != ReadByClient);
 
     // If the loading is not started or an error occurs, return an empty result.
     if (!m_rawData || m_errorCode)
@@ -303,6 +331,7 @@
         break;
     case ReadAsBinaryString:
         m_stringResult = String(static_cast<const char*>(m_rawData->data()), m_bytesLoaded);
+        m_isRawDataConverted = true;
         break;
     case ReadAsText:
         convertToText();
@@ -321,8 +350,12 @@
 
 void FileReaderLoader::convertToText()
 {
-    if (!m_bytesLoaded)
+    m_isRawDataConverted = true;
+
+    if (!m_bytesLoaded) {
+        m_stringResult = "";
         return;
+    }
 
     // Decode the data.
     // The File API spec says that we should use the supplied encoding if it is valid. However, we choose to ignore this
@@ -342,6 +375,8 @@
 
 void FileReaderLoader::convertToDataURL()
 {
+    m_isRawDataConverted = true;
+
     StringBuilder builder;
     builder.append("data:");
 
diff --git a/Source/core/fileapi/FileReaderLoader.h b/Source/core/fileapi/FileReaderLoader.h
index e567dfe..0eb8f5e 100644
--- a/Source/core/fileapi/FileReaderLoader.h
+++ b/Source/core/fileapi/FileReaderLoader.h
@@ -54,7 +54,8 @@
         ReadAsBinaryString,
         ReadAsBlob,
         ReadAsText,
-        ReadAsDataURL
+        ReadAsDataURL,
+        ReadByClient
     };
 
     // If client is given, do the loading asynchronously. Otherwise, load synchronously.
@@ -62,7 +63,7 @@
     ~FileReaderLoader();
 
     void start(ScriptExecutionContext*, const Blob&);
-    void start(ScriptExecutionContext*, const Stream&);
+    void start(ScriptExecutionContext*, const Stream&, unsigned readSize);
     void cancel();
 
     // ThreadableLoaderClient
@@ -101,6 +102,7 @@
     String m_dataType;
 
     KURL m_urlForReading;
+    bool m_urlForReadingIsStream;
     RefPtr<ThreadableLoader> m_loader;
 
     RefPtr<ArrayBuffer> m_rawData;
diff --git a/Source/core/fileapi/FileReaderLoaderClient.h b/Source/core/fileapi/FileReaderLoaderClient.h
index 32de162..d7e3730 100644
--- a/Source/core/fileapi/FileReaderLoaderClient.h
+++ b/Source/core/fileapi/FileReaderLoaderClient.h
@@ -40,7 +40,10 @@
     virtual ~FileReaderLoaderClient() {}
 
     virtual void didStartLoading() = 0;
-    virtual void didReceiveData() = 0;
+    // Clients must implement this method if they are using any ReadType except ReadByClient.
+    virtual void didReceiveData() { ASSERT_NOT_REACHED(); }
+    // Clients must implement this method if they are using the ReadByClient ReadType.
+    virtual void didReceiveDataForClient(const char* data, unsigned dataLength) { ASSERT_NOT_REACHED(); }
     virtual void didFinishLoading() = 0;
     virtual void didFail(FileError::ErrorCode) = 0;
 };
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 43ee0a1..994f76c 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -26,9 +26,9 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/editing/FrameSelection.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLImageElement.h"
@@ -413,7 +413,7 @@
     if (!separator)
         return;
 
-    if (separator == notFound)
+    if (separator == kNotFound)
         url.setHostAndPort(value);
     else {
         unsigned portEnd;
diff --git a/Source/core/html/HTMLAttributeNames.in b/Source/core/html/HTMLAttributeNames.in
index dc3b049..02f5667 100644
--- a/Source/core/html/HTMLAttributeNames.in
+++ b/Source/core/html/HTMLAttributeNames.in
@@ -316,6 +316,7 @@
 x-webkit-grammar
 spellcheck
 src
+srcset
 srcdoc
 srclang
 standby
diff --git a/Source/core/html/HTMLBodyElement.cpp b/Source/core/html/HTMLBodyElement.cpp
index b373e9a..ecf3923 100644
--- a/Source/core/html/HTMLBodyElement.cpp
+++ b/Source/core/html/HTMLBodyElement.cpp
@@ -31,7 +31,7 @@
 #include "core/css/CSSParser.h"
 #include "core/css/StylePropertySet.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/html/HTMLFrameElementBase.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/page/Frame.h"
diff --git a/Source/core/html/HTMLButtonElement.cpp b/Source/core/html/HTMLButtonElement.cpp
index b1ee00a..ee49e25 100644
--- a/Source/core/html/HTMLButtonElement.cpp
+++ b/Source/core/html/HTMLButtonElement.cpp
@@ -28,8 +28,8 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/rendering/RenderButton.h"
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 280951c..32c148c 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -170,7 +170,7 @@
             return 0;
         if (!m_context) {
             HistogramSupport::histogramEnumeration("Canvas.ContextType", Context2d, ContextTypeCount);
-            m_context = CanvasRenderingContext2D::create(this, RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled() ? static_cast<Canvas2DContextAttributes*>(attrs) : 0, document().inQuirksMode());
+            m_context = CanvasRenderingContext2D::create(this, static_cast<Canvas2DContextAttributes*>(attrs), document().inQuirksMode());
             if (m_context)
                 scheduleLayerUpdate();
         }
diff --git a/Source/core/html/HTMLDialogElement.cpp b/Source/core/html/HTMLDialogElement.cpp
index 2f03013..b5a7d65 100644
--- a/Source/core/html/HTMLDialogElement.cpp
+++ b/Source/core/html/HTMLDialogElement.cpp
@@ -60,7 +60,7 @@
 void HTMLDialogElement::close(const String& returnValue, ExceptionState& es)
 {
     if (!fastHasAttribute(openAttr)) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     closeDialog(returnValue);
@@ -123,7 +123,7 @@
 void HTMLDialogElement::showModal(ExceptionState& es)
 {
     if (fastHasAttribute(openAttr) || !inDocument()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     document().addToTopLayer(this);
diff --git a/Source/core/html/HTMLDimension.cpp b/Source/core/html/HTMLDimension.cpp
index 0946482..959b9fe 100644
--- a/Source/core/html/HTMLDimension.cpp
+++ b/Source/core/html/HTMLDimension.cpp
@@ -120,7 +120,7 @@
     size_t lastParsedIndex = 0;
     while (true) {
         size_t nextComma = trimmedString.find(comma, lastParsedIndex);
-        if (nextComma == notFound)
+        if (nextComma == kNotFound)
             break;
 
         parsedDimensions.append(parseDimension(trimmedString, lastParsedIndex, nextComma));
diff --git a/Source/core/html/HTMLElement.cpp b/Source/core/html/HTMLElement.cpp
index d82d6d5..ec3daf8 100644
--- a/Source/core/html/HTMLElement.cpp
+++ b/Source/core/html/HTMLElement.cpp
@@ -36,10 +36,10 @@
 #include "core/css/CSSValuePool.h"
 #include "core/css/StylePropertySet.h"
 #include "core/dom/DocumentFragment.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Text.h"
 #include "core/editing/markup.h"
@@ -52,6 +52,8 @@
 #include "core/loader/FrameLoader.h"
 #include "core/page/Frame.h"
 #include "core/page/Settings.h"
+#include "core/platform/graphics/TextRunIterator.h"
+#include "core/platform/text/BidiResolver.h"
 #include "core/rendering/RenderWordBreak.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/CString.h"
@@ -349,7 +351,7 @@
 {
     Node* p = parentNode();
     if (!p || !p->isHTMLElement()) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
     RefPtr<HTMLElement> parent = toHTMLElement(p);
@@ -405,14 +407,14 @@
 void HTMLElement::setInnerText(const String& text, ExceptionState& es)
 {
     if (ieForbidsInsertHTML()) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
     if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
         hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) ||
         hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
         hasLocalName(trTag)) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
 
@@ -452,20 +454,20 @@
 void HTMLElement::setOuterText(const String &text, ExceptionState& es)
 {
     if (ieForbidsInsertHTML()) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
     if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
         hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) ||
         hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
         hasLocalName(trTag)) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
 
     ContainerNode* parent = parentNode();
     if (!parent) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return;
     }
 
@@ -480,7 +482,7 @@
         newChild = Text::create(document(), text);
 
     if (!this || !parentNode())
-        es.throwDOMException(HierarchyRequestError);
+        es.throwUninformativeAndGenericDOMException(HierarchyRequestError);
     if (es.hadException())
         return;
     parent->replaceChild(newChild.release(), this, es);
@@ -531,7 +533,7 @@
     }
 
     // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
-    es.throwDOMException(NotSupportedError);
+    es.throwUninformativeAndGenericDOMException(NotSupportedError);
     return 0;
 }
 
@@ -539,7 +541,7 @@
 {
     if (!newChild) {
         // IE throws COM Exception E_INVALIDARG; this is the best DOM exception alternative.
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return 0;
     }
 
@@ -553,14 +555,14 @@
     if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
         ContainerNode* parent = element->parentNode();
         if (parent && !parent->isElementNode()) {
-            es.throwDOMException(NoModificationAllowedError);
+            es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
             return 0;
         }
         return toElement(parent);
     }
     if (equalIgnoringCase(where, "afterBegin") || equalIgnoringCase(where, "beforeEnd"))
         return element;
-    es.throwDOMException(SyntaxError);
+    es.throwUninformativeAndGenericDOMException(SyntaxError);
     return 0;
 }
 
@@ -631,11 +633,10 @@
 
     if (!document().settings() || !document().settings()->spatialNavigationEnabled())
         return false;
-    EventTarget* target = const_cast<HTMLElement*>(this);
-    return target->hasEventListeners(eventNames().clickEvent)
-        || target->hasEventListeners(eventNames().keydownEvent)
-        || target->hasEventListeners(eventNames().keypressEvent)
-        || target->hasEventListeners(eventNames().keyupEvent);
+    return hasEventListeners(eventNames().clickEvent)
+        || hasEventListeners(eventNames().keydownEvent)
+        || hasEventListeners(eventNames().keypressEvent)
+        || hasEventListeners(eventNames().keyupEvent);
 }
 
 bool HTMLElement::supportsFocus() const
@@ -676,7 +677,7 @@
     else if (equalIgnoringCase(enabled, "inherit"))
         removeAttribute(contenteditableAttr);
     else
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
 }
 
 bool HTMLElement::draggable() const
@@ -848,15 +849,24 @@
     return directionality();
 }
 
+static TextDirection determineDirectionality(const String& value, bool& hasStrongDirectionality)
+{
+    TextRun run(value);
+    BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
+    bidiResolver.setStatus(BidiStatus(run.direction(), run.directionalOverride()));
+    bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&run, 0));
+    return bidiResolver.determineParagraphDirectionality(&hasStrongDirectionality);
+}
+
 TextDirection HTMLElement::directionality(Node** strongDirectionalityTextNode) const
 {
     if (hasTagName(inputTag)) {
         HTMLInputElement* inputElement = toHTMLInputElement(const_cast<HTMLElement*>(this));
         bool hasStrongDirectionality;
-        Unicode::Direction textDirection = inputElement->value().defaultWritingDirection(&hasStrongDirectionality);
+        TextDirection textDirection = determineDirectionality(inputElement->value(), hasStrongDirectionality);
         if (strongDirectionalityTextNode)
             *strongDirectionalityTextNode = hasStrongDirectionality ? inputElement : 0;
-        return (textDirection == Unicode::LeftToRight) ? LTR : RTL;
+        return textDirection;
     }
 
     Node* node = firstChild();
@@ -879,11 +889,11 @@
 
         if (node->isTextNode()) {
             bool hasStrongDirectionality;
-            WTF::Unicode::Direction textDirection = node->textContent(true).defaultWritingDirection(&hasStrongDirectionality);
+            TextDirection textDirection = determineDirectionality(node->textContent(true), hasStrongDirectionality);
             if (hasStrongDirectionality) {
                 if (strongDirectionalityTextNode)
                     *strongDirectionalityTextNode = node;
-                return (textDirection == WTF::Unicode::LeftToRight) ? LTR : RTL;
+                return textDirection;
             }
         }
         node = NodeTraversal::next(node, this);
diff --git a/Source/core/html/HTMLEmbedElement.cpp b/Source/core/html/HTMLEmbedElement.cpp
index 4d7d978..1a980b5 100644
--- a/Source/core/html/HTMLEmbedElement.cpp
+++ b/Source/core/html/HTMLEmbedElement.cpp
@@ -96,7 +96,7 @@
     if (name == typeAttr) {
         m_serviceType = value.string().lower();
         size_t pos = m_serviceType.find(";");
-        if (pos != notFound)
+        if (pos != kNotFound)
             m_serviceType = m_serviceType.left(pos);
     } else if (name == codeAttr)
         m_url = stripLeadingAndTrailingHTMLSpaces(value);
diff --git a/Source/core/html/HTMLFontElement.cpp b/Source/core/html/HTMLFontElement.cpp
index 9f706c4..928b1e9 100644
--- a/Source/core/html/HTMLFontElement.cpp
+++ b/Source/core/html/HTMLFontElement.cpp
@@ -62,7 +62,7 @@
 
     // Step 3
     while (position < end) {
-        if (!isHTMLSpace(*position))
+        if (!isHTMLSpace<CharacterType>(*position))
             break;
         ++position;
     }
diff --git a/Source/core/html/HTMLFormControlElement.cpp b/Source/core/html/HTMLFormControlElement.cpp
index 82ee82d..1d08c08 100644
--- a/Source/core/html/HTMLFormControlElement.cpp
+++ b/Source/core/html/HTMLFormControlElement.cpp
@@ -25,16 +25,16 @@
 #include "config.h"
 #include "core/html/HTMLFormControlElement.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/PostAttachCallbacks.h"
 #include "core/html/HTMLFieldSetElement.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLLegendElement.h"
 #include "core/html/HTMLTextAreaElement.h"
-#include "core/html/ValidationMessage.h"
 #include "core/html/ValidityState.h"
+#include "core/html/forms/ValidationMessage.h"
 #include "core/page/UseCounter.h"
 #include "core/rendering/RenderBox.h"
 #include "core/rendering/RenderTheme.h"
diff --git a/Source/core/html/HTMLFormControlElementWithState.cpp b/Source/core/html/HTMLFormControlElementWithState.cpp
index 2dc33c6..0b62d22 100644
--- a/Source/core/html/HTMLFormControlElementWithState.cpp
+++ b/Source/core/html/HTMLFormControlElementWithState.cpp
@@ -25,8 +25,8 @@
 #include "config.h"
 #include "core/html/HTMLFormControlElementWithState.h"
 
-#include "core/html/FormController.h"
 #include "core/html/HTMLFormElement.h"
+#include "core/html/forms/FormController.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Frame.h"
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index 42b095f..505a506 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -25,23 +25,22 @@
 #include "config.h"
 #include "core/html/HTMLFormElement.h"
 
-#include <limits>
 #include "HTMLNames.h"
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/AutocompleteErrorEvent.h"
+#include "core/events/AutocompleteErrorEvent.h"
 #include "core/dom/Document.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NamedNodesCollection.h"
-#include "core/html/FormController.h"
 #include "core/html/HTMLCollection.h"
 #include "core/html/HTMLImageElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLObjectElement.h"
 #include "core/html/HTMLTableElement.h"
+#include "core/html/forms/FormController.h"
 #include "core/loader/FormState.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/FrameLoaderClient.h"
@@ -49,6 +48,7 @@
 #include "core/page/Frame.h"
 #include "core/page/UseCounter.h"
 #include "core/rendering/RenderTextControl.h"
+#include <limits>
 
 using namespace std;
 
@@ -578,13 +578,13 @@
 
 void HTMLFormElement::registerImgElement(HTMLImageElement* e)
 {
-    ASSERT(m_imageElements.find(e) == notFound);
+    ASSERT(m_imageElements.find(e) == kNotFound);
     m_imageElements.append(e);
 }
 
 void HTMLFormElement::removeImgElement(HTMLImageElement* e)
 {
-    ASSERT(m_imageElements.find(e) != notFound);
+    ASSERT(m_imageElements.find(e) != kNotFound);
     removeFromPastNamesMap(*e);
     removeFromVector(m_imageElements, e);
 }
@@ -696,11 +696,11 @@
         return 0;
     ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(node)->form() == this);
     if (node->hasTagName(imgTag)) {
-        ASSERT_WITH_SECURITY_IMPLICATION(m_imageElements.find(node) != notFound);
+        ASSERT_WITH_SECURITY_IMPLICATION(m_imageElements.find(node) != kNotFound);
     } else if (node->hasTagName(objectTag)) {
-        ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLObjectElement(node)) != notFound);
+        ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLObjectElement(node)) != kNotFound);
     } else {
-        ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLFormControlElement(node)) != notFound);
+        ASSERT_WITH_SECURITY_IMPLICATION(m_associatedElements.find(toHTMLFormControlElement(node)) != kNotFound);
     }
 #endif
     return node;
diff --git a/Source/core/html/HTMLFormElement.h b/Source/core/html/HTMLFormElement.h
index 184fa30..f733e71 100644
--- a/Source/core/html/HTMLFormElement.h
+++ b/Source/core/html/HTMLFormElement.h
@@ -24,9 +24,9 @@
 #ifndef HTMLFormElement_h
 #define HTMLFormElement_h
 
-#include "core/dom/CheckedRadioButtons.h"
 #include "core/html/HTMLElement.h"
 #include "core/html/HTMLFormControlElement.h"
+#include "core/html/forms/CheckedRadioButtons.h"
 #include "core/loader/FormState.h"
 #include "core/loader/FormSubmission.h"
 #include "wtf/OwnPtr.h"
diff --git a/Source/core/html/HTMLFrameElementBase.cpp b/Source/core/html/HTMLFrameElementBase.cpp
index 3b9925b..ac72a37 100644
--- a/Source/core/html/HTMLFrameElementBase.cpp
+++ b/Source/core/html/HTMLFrameElementBase.cpp
@@ -29,7 +29,7 @@
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/loader/FrameLoader.h"
 #include "core/page/FocusController.h"
diff --git a/Source/core/html/HTMLFrameOwnerElement.cpp b/Source/core/html/HTMLFrameOwnerElement.cpp
index dbcbd5e..58ef877 100644
--- a/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -119,7 +119,7 @@
     if (doc && doc->isSVGDocument())
         return toSVGDocument(doc);
     // Spec: http://www.w3.org/TR/SVG/struct.html#InterfaceGetSVGDocument
-    es.throwDOMException(NotSupportedError);
+    es.throwUninformativeAndGenericDOMException(NotSupportedError);
     return 0;
 }
 
diff --git a/Source/core/html/HTMLFrameSetElement.cpp b/Source/core/html/HTMLFrameSetElement.cpp
index e805553..1a348a3 100644
--- a/Source/core/html/HTMLFrameSetElement.cpp
+++ b/Source/core/html/HTMLFrameSetElement.cpp
@@ -28,9 +28,9 @@
 #include "HTMLNames.h"
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/HTMLCollection.h"
 #include "core/html/HTMLDimension.h"
 #include "core/html/HTMLFrameElement.h"
diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
index 30c8668..35a98a4 100644
--- a/Source/core/html/HTMLImageElement.cpp
+++ b/Source/core/html/HTMLImageElement.cpp
@@ -25,13 +25,15 @@
 
 #include "CSSPropertyNames.h"
 #include "HTMLNames.h"
+#include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
+#include "core/html/parser/HTMLSrcsetParser.h"
 #include "core/rendering/RenderImage.h"
 
 using namespace std;
@@ -107,13 +109,21 @@
         HTMLElement::collectStyleForPresentationAttribute(name, value, style);
 }
 
+const AtomicString HTMLImageElement::imageSourceURL() const
+{
+    return m_bestFitImageURL.isNull() ? fastGetAttribute(srcAttr) : m_bestFitImageURL;
+}
+
 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == altAttr) {
         if (renderer() && renderer()->isImage())
             toRenderImage(renderer())->updateAltText();
-    } else if (name == srcAttr)
+    } else if (name == srcAttr || name == srcsetAttr) {
+        if (RuntimeEnabledFeatures::srcsetEnabled())
+            m_bestFitImageURL = bestFitSourceForImageAttributes(document().devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr));
         m_imageLoader.updateFromElementIgnoringPreviousError();
+    }
     else if (name == usemapAttr)
         setIsLink(!value.isNull());
     else if (name == onbeforeloadAttr)
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index f8acd66..0f9bc67 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -79,6 +79,8 @@
     void addClient(ImageLoaderClient* client) { m_imageLoader.addClient(client); }
     void removeClient(ImageLoaderClient* client) { m_imageLoader.removeClient(client); }
 
+    virtual const AtomicString imageSourceURL() const OVERRIDE;
+
 protected:
     HTMLImageElement(const QualifiedName&, Document&, HTMLFormElement* = 0);
 
@@ -112,6 +114,7 @@
     HTMLImageLoader m_imageLoader;
     HTMLFormElement* m_form;
     CompositeOperator m_compositeOperator;
+    AtomicString m_bestFitImageURL;
 };
 
 inline HTMLImageElement* toHTMLImageElement(Node* node)
diff --git a/Source/core/html/HTMLImageElement.idl b/Source/core/html/HTMLImageElement.idl
index 1056b5d..efd1c6a 100644
--- a/Source/core/html/HTMLImageElement.idl
+++ b/Source/core/html/HTMLImageElement.idl
@@ -30,6 +30,7 @@
     [Reflect] attribute boolean isMap;
     [Reflect, URL] attribute DOMString longDesc;
     [Reflect, URL] attribute DOMString src;
+    [Reflect, EnabledAtRuntime=Srcset] attribute DOMString srcset;
     [Reflect] attribute DOMString useMap;
     [Reflect] attribute long vspace;
     attribute long width;
diff --git a/Source/core/html/HTMLImageLoader.cpp b/Source/core/html/HTMLImageLoader.cpp
index 55a287f..ac015b3 100644
--- a/Source/core/html/HTMLImageLoader.cpp
+++ b/Source/core/html/HTMLImageLoader.cpp
@@ -24,8 +24,8 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/HTMLObjectElement.h"
 #include "core/html/HTMLVideoElement.h"
diff --git a/Source/core/html/HTMLImportLoader.cpp b/Source/core/html/HTMLImportLoader.cpp
index b4a0942..283b757 100644
--- a/Source/core/html/HTMLImportLoader.cpp
+++ b/Source/core/html/HTMLImportLoader.cpp
@@ -153,7 +153,7 @@
 
 void HTMLImportLoader::addClient(HTMLImportLoaderClient* client)
 {
-    ASSERT(notFound == m_clients.find(client));
+    ASSERT(kNotFound == m_clients.find(client));
     m_clients.append(client);
     if (isDone())
         client->didFinish();
@@ -161,7 +161,7 @@
 
 void HTMLImportLoader::removeClient(HTMLImportLoaderClient* client)
 {
-    ASSERT(notFound != m_clients.find(client));
+    ASSERT(kNotFound != m_clients.find(client));
     m_clients.remove(m_clients.find(client));
 }
 
diff --git a/Source/core/html/HTMLInputElement.cpp b/Source/core/html/HTMLInputElement.cpp
index 875d3ca..6a8d07d 100644
--- a/Source/core/html/HTMLInputElement.cpp
+++ b/Source/core/html/HTMLInputElement.cpp
@@ -35,32 +35,32 @@
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/accessibility/AXObjectCache.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/IdTargetObserver.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/TouchController.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/InsertionPoint.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
 #include "core/fileapi/FileList.h"
-#include "core/html/ColorInputType.h"
-#include "core/html/FileInputType.h"
-#include "core/html/FormController.h"
 #include "core/html/HTMLCollection.h"
 #include "core/html/HTMLDataListElement.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLImageLoader.h"
 #include "core/html/HTMLOptionElement.h"
-#include "core/html/InputType.h"
-#include "core/html/SearchInputType.h"
+#include "core/html/forms/ColorInputType.h"
+#include "core/html/forms/FileInputType.h"
+#include "core/html/forms/FormController.h"
+#include "core/html/forms/InputType.h"
+#include "core/html/forms/SearchInputType.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/page/Frame.h"
 #include "core/page/FrameView.h"
@@ -177,21 +177,11 @@
     return FileInputType::filesFromFormControlState(state);
 }
 
-HTMLElement* HTMLInputElement::containerElement() const
-{
-    return m_inputType->containerElement();
-}
-
 HTMLElement* HTMLInputElement::innerTextElement() const
 {
     return m_inputType->innerTextElement();
 }
 
-HTMLElement* HTMLInputElement::editingViewPortElement() const
-{
-    return m_inputType->editingViewPortElement();
-}
-
 HTMLElement* HTMLInputElement::passwordGeneratorButtonElement() const
 {
     return m_inputType->passwordGeneratorButtonElement();
@@ -259,7 +249,7 @@
         if (!hasDirtyValue() || !m_wasModifiedByUser)
             return false;
     }
-    return numGraphemeClusters(value) > static_cast<unsigned>(max);
+    return value.length() > static_cast<unsigned>(max);
 }
 
 bool HTMLInputElement::rangeUnderflow() const
@@ -540,7 +530,7 @@
 int HTMLInputElement::selectionStartForBinding(ExceptionState& es) const
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return 0;
     }
     return HTMLTextFormControlElement::selectionStart();
@@ -549,7 +539,7 @@
 int HTMLInputElement::selectionEndForBinding(ExceptionState& es) const
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return 0;
     }
     return HTMLTextFormControlElement::selectionEnd();
@@ -558,7 +548,7 @@
 String HTMLInputElement::selectionDirectionForBinding(ExceptionState& es) const
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return String();
     }
     return HTMLTextFormControlElement::selectionDirection();
@@ -567,7 +557,7 @@
 void HTMLInputElement::setSelectionStartForBinding(int start, ExceptionState& es)
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     HTMLTextFormControlElement::setSelectionStart(start);
@@ -576,7 +566,7 @@
 void HTMLInputElement::setSelectionEndForBinding(int end, ExceptionState& es)
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     HTMLTextFormControlElement::setSelectionEnd(end);
@@ -585,7 +575,7 @@
 void HTMLInputElement::setSelectionDirectionForBinding(const String& direction, ExceptionState& es)
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     HTMLTextFormControlElement::setSelectionDirection(direction);
@@ -594,7 +584,7 @@
 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, ExceptionState& es)
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     HTMLTextFormControlElement::setSelectionRange(start, end);
@@ -603,7 +593,7 @@
 void HTMLInputElement::setSelectionRangeForBinding(int start, int end, const String& direction, ExceptionState& es)
 {
     if (!canHaveSelection()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     HTMLTextFormControlElement::setSelectionRange(start, end, direction);
@@ -1015,7 +1005,7 @@
 void HTMLInputElement::setValue(const String& value, ExceptionState& es, TextFieldEventBehavior eventBehavior)
 {
     if (isFileUpload() && !value.isEmpty()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     setValue(value, eventBehavior);
@@ -1071,7 +1061,7 @@
 void HTMLInputElement::setValueAsNumber(double newValue, ExceptionState& es, TextFieldEventBehavior eventBehavior)
 {
     if (!std::isfinite(newValue)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     m_inputType->setValueAsDouble(newValue, eventBehavior, es);
@@ -1134,7 +1124,7 @@
     }
 
     if (evt->isTouchEvent()) {
-        m_inputTypeView->handleTouchEvent(static_cast<TouchEvent*>(evt));
+        m_inputTypeView->handleTouchEvent(toTouchEvent(evt));
         if (evt->defaultHandled())
             return;
     }
@@ -1242,7 +1232,7 @@
 static bool isValidMIMEType(const String& type)
 {
     size_t slashPosition = type.find('/');
-    if (slashPosition == notFound || !slashPosition || slashPosition == type.length() - 1)
+    if (slashPosition == kNotFound || !slashPosition || slashPosition == type.length() - 1)
         return false;
     for (size_t i = 0; i < type.length(); ++i) {
         if (!isRFC2616TokenCharacter(type[i]) && i != slashPosition)
@@ -1306,7 +1296,7 @@
 void HTMLInputElement::setMaxLength(int maxLength, ExceptionState& es)
 {
     if (maxLength < 0)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setAttribute(maxlengthAttr, String::number(maxLength));
 }
@@ -1324,7 +1314,7 @@
 void HTMLInputElement::setSize(unsigned size, ExceptionState& es)
 {
     if (!size)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setSize(size);
 }
@@ -1818,7 +1808,7 @@
 void HTMLInputElement::setRangeText(const String& replacement, ExceptionState& es)
 {
     if (!m_inputType->supportsSelectionAPI()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -1828,7 +1818,7 @@
 void HTMLInputElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionState& es)
 {
     if (!m_inputType->supportsSelectionAPI()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
diff --git a/Source/core/html/HTMLInputElement.h b/Source/core/html/HTMLInputElement.h
index b1de3a9..f2a38c4 100644
--- a/Source/core/html/HTMLInputElement.h
+++ b/Source/core/html/HTMLInputElement.h
@@ -26,7 +26,7 @@
 #define HTMLInputElement_h
 
 #include "core/html/HTMLTextFormControlElement.h"
-#include "core/html/StepRange.h"
+#include "core/html/forms/StepRange.h"
 #include "core/platform/FileChooser.h"
 
 namespace WebCore {
@@ -119,9 +119,7 @@
     bool isSpeechEnabled() const;
 #endif
 
-    HTMLElement* containerElement() const;
     virtual HTMLElement* innerTextElement() const;
-    HTMLElement* editingViewPortElement() const;
     HTMLElement* passwordGeneratorButtonElement() const;
 
     bool checked() const { return m_isChecked; }
diff --git a/Source/core/html/HTMLLabelElement.cpp b/Source/core/html/HTMLLabelElement.cpp
index f02c4a0..ad59246 100644
--- a/Source/core/html/HTMLLabelElement.cpp
+++ b/Source/core/html/HTMLLabelElement.cpp
@@ -27,8 +27,8 @@
 
 #include "HTMLNames.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/html/FormAssociatedElement.h"
 
 namespace WebCore {
diff --git a/Source/core/html/HTMLLinkElement.cpp b/Source/core/html/HTMLLinkElement.cpp
index e41bf00..36c67f7 100644
--- a/Source/core/html/HTMLLinkElement.cpp
+++ b/Source/core/html/HTMLLinkElement.cpp
@@ -34,8 +34,8 @@
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventSender.h"
+#include "core/events/Event.h"
+#include "core/events/EventSender.h"
 #include "core/dom/StyleEngine.h"
 #include "core/fetch/CSSStyleSheetResource.h"
 #include "core/fetch/FetchRequest.h"
diff --git a/Source/core/html/HTMLMarqueeElement.cpp b/Source/core/html/HTMLMarqueeElement.cpp
index fb472d3..946593b 100644
--- a/Source/core/html/HTMLMarqueeElement.cpp
+++ b/Source/core/html/HTMLMarqueeElement.cpp
@@ -88,20 +88,20 @@
         }
     } else if (name == scrollamountAttr) {
         if (!value.isEmpty())
-            addHTMLLengthToStyle(style, CSSPropertyWebkitMarqueeIncrement, value);
+            addHTMLLengthToStyle(style, CSSPropertyInternalMarqueeIncrement, value);
     } else if (name == scrolldelayAttr) {
         if (!value.isEmpty())
-            addHTMLLengthToStyle(style, CSSPropertyWebkitMarqueeSpeed, value);
+            addHTMLLengthToStyle(style, CSSPropertyInternalMarqueeSpeed, value);
     } else if (name == loopAttr) {
         if (!value.isEmpty()) {
             if (value == "-1" || equalIgnoringCase(value, "infinite"))
-                addPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitMarqueeRepetition, CSSValueInfinite);
+                addPropertyToPresentationAttributeStyle(style, CSSPropertyInternalMarqueeRepetition, CSSValueInfinite);
             else
-                addHTMLLengthToStyle(style, CSSPropertyWebkitMarqueeRepetition, value);
+                addHTMLLengthToStyle(style, CSSPropertyInternalMarqueeRepetition, value);
         }
     } else if (name == behaviorAttr) {
         if (!value.isEmpty())
-            addPropertyToPresentationAttributeStyle(style, CSSPropertyWebkitMarqueeStyle, value);
+            addPropertyToPresentationAttributeStyle(style, CSSPropertyInternalMarqueeStyle, value);
     } else if (name == directionAttr) {
         if (!value.isEmpty())
             addPropertyToPresentationAttributeStyle(style, CSSPropertyInternalMarqueeDirection, value);
@@ -131,7 +131,7 @@
 void HTMLMarqueeElement::setScrollAmount(int scrollAmount, ExceptionState& es)
 {
     if (scrollAmount < 0)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setIntegralAttribute(scrollamountAttr, scrollAmount);
 }
@@ -146,7 +146,7 @@
 void HTMLMarqueeElement::setScrollDelay(int scrollDelay, ExceptionState& es)
 {
     if (scrollDelay < 0)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setIntegralAttribute(scrolldelayAttr, scrollDelay);
 }
@@ -161,7 +161,7 @@
 void HTMLMarqueeElement::setLoop(int loop, ExceptionState& es)
 {
     if (loop <= 0 && loop != -1)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setIntegralAttribute(loopAttr, loop);
 }
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 950ce40..1b1cee7 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -35,8 +35,8 @@
 #include "core/css/MediaList.h"
 #include "core/css/MediaQueryEvaluator.h"
 #include "core/dom/Attribute.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/FullscreenElementStack.h"
 #include "core/dom/shadow/ShadowRoot.h"
@@ -66,7 +66,9 @@
 #include "core/platform/NotImplemented.h"
 #include "core/platform/graphics/InbandTextTrackPrivate.h"
 #include "core/platform/graphics/MediaPlayer.h"
+#include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderVideo.h"
+#include "core/rendering/RenderView.h"
 #include "modules/mediastream/MediaStreamRegistry.h"
 #include "public/platform/Platform.h"
 #include "weborigin/SecurityOrigin.h"
@@ -157,10 +159,10 @@
     case MediaPlayer::NoError:
         return;
     case MediaPlayer::InvalidPlayerState:
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     case MediaPlayer::KeySystemNotSupported:
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -1318,7 +1320,7 @@
     m_cueTree.remove(interval);
 
     size_t index = m_currentlyActiveCues.find(interval);
-    if (index != notFound) {
+    if (index != kNotFound) {
         m_currentlyActiveCues.remove(index);
         cue->setIsActive(false);
     }
@@ -1846,7 +1848,7 @@
 
     // 1 - If the media element's readyState is HAVE_NOTHING, then raise an InvalidStateError exception.
     if (m_readyState == HAVE_NOTHING || !m_player) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -2015,7 +2017,7 @@
 void HTMLMediaElement::setCurrentTime(double time, ExceptionState& es)
 {
     if (m_mediaController) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     seek(time, es);
@@ -2249,12 +2251,12 @@
 void HTMLMediaElement::webkitGenerateKeyRequest(const String& keySystem, PassRefPtr<Uint8Array> initData, ExceptionState& es)
 {
     if (keySystem.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
     if (!m_player) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -2277,22 +2279,22 @@
 void HTMLMediaElement::webkitAddKey(const String& keySystem, PassRefPtr<Uint8Array> key, PassRefPtr<Uint8Array> initData, const String& sessionId, ExceptionState& es)
 {
     if (keySystem.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
     if (!key) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
     if (!key->length()) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
     if (!m_player) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -2315,12 +2317,12 @@
 void HTMLMediaElement::webkitCancelKeyRequest(const String& keySystem, const String& sessionId, ExceptionState& es)
 {
     if (keySystem.isEmpty()) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
     if (!m_player) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -2370,7 +2372,7 @@
     LOG(Media, "HTMLMediaElement::setVolume(%f)", vol);
 
     if (vol < 0.0f || vol > 1.0f) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -2622,7 +2624,7 @@
 
     // 1. If kind is not one of the following strings, then throw a SyntaxError exception and abort these steps
     if (!TextTrack::isValidKindKeyword(kind)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -2716,7 +2718,7 @@
     removeTrack(textTrack.get());
 
     size_t index = m_textTracksWhenResourceSelectionBegan.find(textTrack.get());
-    if (index != notFound)
+    if (index != kNotFound)
         m_textTracksWhenResourceSelectionBegan.remove(index);
 }
 
@@ -3570,12 +3572,16 @@
 {
     if (hasMediaControls())
         mediaControls()->enteredFullscreen();
+    if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo())
+        document().renderView()->compositor()->setCompositingLayersNeedRebuild(true);
 }
 
 void HTMLMediaElement::willStopBeingFullscreenElement()
 {
     if (hasMediaControls())
         mediaControls()->exitedFullscreen();
+    if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isVideo())
+        document().renderView()->compositor()->setCompositingLayersNeedRebuild(true);
 }
 
 WebKit::WebLayer* HTMLMediaElement::platformLayer() const
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 86bc891..d00b286 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -27,7 +27,7 @@
 #define HTMLMediaElement_h
 
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/GenericEventQueue.h"
+#include "core/events/GenericEventQueue.h"
 #include "core/html/HTMLElement.h"
 #include "core/html/MediaControllerInterface.h"
 #include "core/html/track/TextTrack.h"
diff --git a/Source/core/html/HTMLMediaElement.idl b/Source/core/html/HTMLMediaElement.idl
index 873aeeb..3cf9793 100644
--- a/Source/core/html/HTMLMediaElement.idl
+++ b/Source/core/html/HTMLMediaElement.idl
@@ -88,14 +88,14 @@
 readonly attribute unsigned long webkitVideoDecodedByteCount;
 
 // FIXME: add DeprecateAs=PrefixedMediaGenerateKeyRequest when MediaKeys is ready.
-[EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
-[EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
-[EnabledAtRuntime=LegacyEncryptedMedia, RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
+[EnabledAtRuntime=PrefixedEncryptedMedia, RaisesException] void webkitGenerateKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, optional Uint8Array initData);
+[EnabledAtRuntime=PrefixedEncryptedMedia, RaisesException] void webkitAddKey([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, Uint8Array key, optional Uint8Array initData, [Default=NullString] optional DOMString sessionId);
+[EnabledAtRuntime=PrefixedEncryptedMedia, RaisesException] void webkitCancelKeyRequest([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString keySystem, [Default=NullString] optional DOMString sessionId);
 
-[EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeyadded;
-[EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeyerror;
-[EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitkeymessage;
-[EnabledAtRuntime=LegacyEncryptedMedia] attribute EventHandler onwebkitneedkey;
+[EnabledAtRuntime=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyadded;
+[EnabledAtRuntime=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeyerror;
+[EnabledAtRuntime=PrefixedEncryptedMedia] attribute EventHandler onwebkitkeymessage;
+[EnabledAtRuntime=PrefixedEncryptedMedia] attribute EventHandler onwebkitneedkey;
 
 [EnabledAtRuntime=EncryptedMedia, Conditional=ENCRYPTED_MEDIA_V2] attribute MediaKeys mediaKeys;
 
diff --git a/Source/core/html/HTMLMeterElement.cpp b/Source/core/html/HTMLMeterElement.cpp
index 0944dcf..8f77d5f 100644
--- a/Source/core/html/HTMLMeterElement.cpp
+++ b/Source/core/html/HTMLMeterElement.cpp
@@ -79,7 +79,7 @@
 void HTMLMeterElement::setMin(double min, ExceptionState& es)
 {
     if (!std::isfinite(min)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(minAttr, String::number(min));
@@ -93,7 +93,7 @@
 void HTMLMeterElement::setMax(double max, ExceptionState& es)
 {
     if (!std::isfinite(max)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(maxAttr, String::number(max));
@@ -108,7 +108,7 @@
 void HTMLMeterElement::setValue(double value, ExceptionState& es)
 {
     if (!std::isfinite(value)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(valueAttr, String::number(value));
@@ -123,7 +123,7 @@
 void HTMLMeterElement::setLow(double low, ExceptionState& es)
 {
     if (!std::isfinite(low)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(lowAttr, String::number(low));
@@ -138,7 +138,7 @@
 void HTMLMeterElement::setHigh(double high, ExceptionState& es)
 {
     if (!std::isfinite(high)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(highAttr, String::number(high));
@@ -153,7 +153,7 @@
 void HTMLMeterElement::setOptimum(double optimum, ExceptionState& es)
 {
     if (!std::isfinite(optimum)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(optimumAttr, String::number(optimum));
@@ -214,11 +214,11 @@
 RenderMeter* HTMLMeterElement::renderMeter() const
 {
     if (renderer() && renderer()->isMeter())
-        return static_cast<RenderMeter*>(renderer());
+        return toRenderMeter(renderer());
 
     RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer();
     ASSERT(!renderObject || renderObject->isMeter());
-    return static_cast<RenderMeter*>(renderObject);
+    return toRenderMeter(renderObject);
 }
 
 void HTMLMeterElement::didAddUserAgentShadowRoot(ShadowRoot* root)
diff --git a/Source/core/html/HTMLObjectElement.cpp b/Source/core/html/HTMLObjectElement.cpp
index 9c41b41..eb9f93f 100644
--- a/Source/core/html/HTMLObjectElement.cpp
+++ b/Source/core/html/HTMLObjectElement.cpp
@@ -28,7 +28,7 @@
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NodeList.h"
 #include "core/dom/Text.h"
 #include "core/fetch/ImageResource.h"
@@ -96,7 +96,7 @@
     else if (name == typeAttr) {
         m_serviceType = value.lower();
         size_t pos = m_serviceType.find(";");
-        if (pos != notFound)
+        if (pos != kNotFound)
             m_serviceType = m_serviceType.left(pos);
         if (renderer())
             setNeedsWidgetUpdate(true);
@@ -166,7 +166,7 @@
         if (serviceType.isEmpty() && equalIgnoringCase(name, "type")) {
             serviceType = p->value();
             size_t pos = serviceType.find(";");
-            if (pos != notFound)
+            if (pos != kNotFound)
                 serviceType = serviceType.left(pos);
         }
     }
diff --git a/Source/core/html/HTMLOptionElement.cpp b/Source/core/html/HTMLOptionElement.cpp
index 3642f40..dbe4d00 100644
--- a/Source/core/html/HTMLOptionElement.cpp
+++ b/Source/core/html/HTMLOptionElement.cpp
@@ -125,7 +125,7 @@
 
     // FIXME: Is displayStringModifiedByEncoding helpful here?
     // If it's correct here, then isn't it needed in the value and label functions too?
-    return document.displayStringModifiedByEncoding(text).stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
+    return document.displayStringModifiedByEncoding(text).stripWhiteSpace(isHTMLSpace<UChar>).simplifyWhiteSpace(isHTMLSpace<UChar>);
 }
 
 void HTMLOptionElement::setText(const String &text, ExceptionState& es)
@@ -207,7 +207,7 @@
     const AtomicString& value = fastGetAttribute(valueAttr);
     if (!value.isNull())
         return value;
-    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
+    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplifyWhiteSpace(isHTMLSpace<UChar>);
 }
 
 void HTMLOptionElement::setValue(const String& value)
@@ -290,7 +290,7 @@
     const AtomicString& label = fastGetAttribute(labelAttr);
     if (!label.isNull())
         return label;
-    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace).simplifyWhiteSpace(isHTMLSpace);
+    return collectOptionInnerText().stripWhiteSpace(isHTMLSpace<UChar>).simplifyWhiteSpace(isHTMLSpace<UChar>);
 }
 
 void HTMLOptionElement::setLabel(const String& label)
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index ea2c28c..94c808c 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -51,12 +51,12 @@
     HTMLOptionElement* newOption = element.get();
 
     if (!newOption) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
     if (index < -1) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -124,7 +124,7 @@
 {
     HTMLSelectElement* base = toHTMLSelectElement(ownerNode());
     if (!value) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return true;
     }
     base->setOption(index, value.get(), es);
diff --git a/Source/core/html/HTMLPlugInElement.cpp b/Source/core/html/HTMLPlugInElement.cpp
index c6ed4a5..9af98d1 100644
--- a/Source/core/html/HTMLPlugInElement.cpp
+++ b/Source/core/html/HTMLPlugInElement.cpp
@@ -28,7 +28,7 @@
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/npruntime_impl.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/page/EventHandler.h"
 #include "core/page/Frame.h"
 #include "core/platform/Widget.h"
diff --git a/Source/core/html/HTMLProgressElement.cpp b/Source/core/html/HTMLProgressElement.cpp
index ded3d07..1798437 100644
--- a/Source/core/html/HTMLProgressElement.cpp
+++ b/Source/core/html/HTMLProgressElement.cpp
@@ -68,11 +68,11 @@
 RenderProgress* HTMLProgressElement::renderProgress() const
 {
     if (renderer() && renderer()->isProgress())
-        return static_cast<RenderProgress*>(renderer());
+        return toRenderProgress(renderer());
 
     RenderObject* renderObject = userAgentShadowRoot()->firstChild()->renderer();
     ASSERT_WITH_SECURITY_IMPLICATION(!renderObject || renderObject->isProgress());
-    return static_cast<RenderProgress*>(renderObject);
+    return toRenderProgress(renderObject);
 }
 
 void HTMLProgressElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -101,7 +101,7 @@
 void HTMLProgressElement::setValue(double value, ExceptionState& es)
 {
     if (!std::isfinite(value)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(valueAttr, String::number(value >= 0 ? value : 0));
@@ -116,7 +116,7 @@
 void HTMLProgressElement::setMax(double max, ExceptionState& es)
 {
     if (!std::isfinite(max)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
     setAttribute(maxAttr, String::number(max > 0 ? max : 1));
diff --git a/Source/core/html/HTMLScriptElement.cpp b/Source/core/html/HTMLScriptElement.cpp
index 4f59a67..27d1e48 100644
--- a/Source/core/html/HTMLScriptElement.cpp
+++ b/Source/core/html/HTMLScriptElement.cpp
@@ -28,8 +28,8 @@
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ScriptLoader.h"
 #include "core/dom/Text.h"
 
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index 6107fc5..5cbf562 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -34,22 +34,22 @@
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/NodeTraversal.h"
-#include "core/html/FormController.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLOptGroupElement.h"
 #include "core/html/HTMLOptionElement.h"
 #include "core/html/HTMLOptionsCollection.h"
+#include "core/html/forms/FormController.h"
 #include "core/page/EventHandler.h"
 #include "core/page/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/SpatialNavigation.h"
-#include "core/platform/LocalizedStrings.h"
 #include "core/platform/PlatformMouseEvent.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "core/rendering/RenderListBox.h"
 #include "core/rendering/RenderMenuList.h"
 #include "core/rendering/RenderTheme.h"
@@ -154,11 +154,11 @@
 {
     if (!willValidate())
         return String();
-
     if (customError())
         return customValidationMessage();
-
-    return valueMissing() ? validationMessageValueMissingForSelectText() : String();
+    if (valueMissing())
+        return locale().queryString(WebKit::WebLocalizedString::ValidationValueMissingForSelect);
+    return String();
 }
 
 bool HTMLSelectElement::valueMissing() const
@@ -955,7 +955,7 @@
         if (toHTMLOptionElement(items[i])->value() == value)
             return i;
     }
-    return notFound;
+    return kNotFound;
 }
 
 void HTMLSelectElement::restoreFormControlState(const FormControlState& state)
@@ -975,16 +975,16 @@
 
     if (!multiple()) {
         size_t foundIndex = searchOptionsForValue(state[0], 0, itemsSize);
-        if (foundIndex != notFound)
+        if (foundIndex != kNotFound)
             toHTMLOptionElement(items[foundIndex])->setSelectedState(true);
     } else {
         size_t startIndex = 0;
         for (size_t i = 0; i < state.valueSize(); ++i) {
             const String& value = state[i];
             size_t foundIndex = searchOptionsForValue(value, startIndex, itemsSize);
-            if (foundIndex == notFound)
+            if (foundIndex == kNotFound)
                 foundIndex = searchOptionsForValue(value, 0, startIndex);
-            if (foundIndex == notFound)
+            if (foundIndex == kNotFound)
                 continue;
             toHTMLOptionElement(items[foundIndex])->setSelectedState(true);
             startIndex = foundIndex + 1;
@@ -1565,7 +1565,7 @@
 bool HTMLSelectElement::anonymousIndexedSetter(unsigned index, PassRefPtr<HTMLOptionElement> value, ExceptionState& es)
 {
     if (!value) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return false;
     }
     setOption(index, value.get(), es);
diff --git a/Source/core/html/HTMLSelectElement.h b/Source/core/html/HTMLSelectElement.h
index 74fb89c..34cd873 100644
--- a/Source/core/html/HTMLSelectElement.h
+++ b/Source/core/html/HTMLSelectElement.h
@@ -26,10 +26,10 @@
 #ifndef HTMLSelectElement_h
 #define HTMLSelectElement_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/HTMLFormControlElementWithState.h"
 #include "core/html/HTMLOptionsCollection.h"
-#include "core/html/TypeAhead.h"
+#include "core/html/forms/TypeAhead.h"
 #include "wtf/Vector.h"
 
 namespace WebCore {
diff --git a/Source/core/html/HTMLSelectElementWin.cpp b/Source/core/html/HTMLSelectElementWin.cpp
index 1c4be11..b611950 100644
--- a/Source/core/html/HTMLSelectElementWin.cpp
+++ b/Source/core/html/HTMLSelectElementWin.cpp
@@ -29,7 +29,7 @@
 #if OS(WIN)
 
 #include "core/dom/Element.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/rendering/RenderMenuList.h"
 
 namespace WebCore {
diff --git a/Source/core/html/HTMLSourceElement.cpp b/Source/core/html/HTMLSourceElement.cpp
index 733ac99..ec03337 100644
--- a/Source/core/html/HTMLSourceElement.cpp
+++ b/Source/core/html/HTMLSourceElement.cpp
@@ -27,8 +27,8 @@
 #include "core/html/HTMLSourceElement.h"
 
 #include "HTMLNames.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/platform/Logging.h"
 
diff --git a/Source/core/html/HTMLStyleElement.cpp b/Source/core/html/HTMLStyleElement.cpp
index 259ddc3..d877c24 100644
--- a/Source/core/html/HTMLStyleElement.cpp
+++ b/Source/core/html/HTMLStyleElement.cpp
@@ -29,8 +29,8 @@
 #include "core/css/StyleSheetContents.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventSender.h"
+#include "core/events/Event.h"
+#include "core/events/EventSender.h"
 #include "core/dom/StyleEngine.h"
 #include "core/dom/shadow/ShadowRoot.h"
 
diff --git a/Source/core/html/HTMLSummaryElement.cpp b/Source/core/html/HTMLSummaryElement.cpp
index ed09699..f15a72b 100644
--- a/Source/core/html/HTMLSummaryElement.cpp
+++ b/Source/core/html/HTMLSummaryElement.cpp
@@ -23,7 +23,7 @@
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeRenderingTraversal.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLDetailsElement.h"
diff --git a/Source/core/html/HTMLTableElement.cpp b/Source/core/html/HTMLTableElement.cpp
index 54cca88..7cc5939 100644
--- a/Source/core/html/HTMLTableElement.cpp
+++ b/Source/core/html/HTMLTableElement.cpp
@@ -188,7 +188,7 @@
 PassRefPtr<HTMLElement> HTMLTableElement::insertRow(int index, ExceptionState& es)
 {
     if (index < -1) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
 
@@ -203,7 +203,7 @@
             row = HTMLTableRowsCollection::rowAfter(this, lastRow.get());
             if (!row) {
                 if (i != index) {
-                    es.throwDOMException(IndexSizeError);
+                    es.throwUninformativeAndGenericDOMException(IndexSizeError);
                     return 0;
                 }
                 break;
@@ -244,7 +244,7 @@
         }
     }
     if (!row) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
     row->remove(es);
diff --git a/Source/core/html/HTMLTableRowElement.cpp b/Source/core/html/HTMLTableRowElement.cpp
index e50eaf8..7a1bd70 100644
--- a/Source/core/html/HTMLTableRowElement.cpp
+++ b/Source/core/html/HTMLTableRowElement.cpp
@@ -123,7 +123,7 @@
     RefPtr<HTMLCollection> children = cells();
     int numCells = children ? children->length() : 0;
     if (index < -1 || index > numCells) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
 
@@ -151,7 +151,7 @@
         RefPtr<Node> cell = children->item(index);
         HTMLElement::removeChild(cell.get(), es);
     } else {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     }
 }
 
@@ -162,7 +162,7 @@
 
 void HTMLTableRowElement::setCells(HTMLCollection*, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 }
diff --git a/Source/core/html/HTMLTableSectionElement.cpp b/Source/core/html/HTMLTableSectionElement.cpp
index c84d6b9..65be611 100644
--- a/Source/core/html/HTMLTableSectionElement.cpp
+++ b/Source/core/html/HTMLTableSectionElement.cpp
@@ -62,7 +62,7 @@
     RefPtr<HTMLCollection> children = rows();
     int numRows = children ? (int)children->length() : 0;
     if (index < -1 || index > numRows)
-        es.throwDOMException(IndexSizeError); // per the DOM
+        es.throwUninformativeAndGenericDOMException(IndexSizeError); // per the DOM
     else {
         row = HTMLTableRowElement::create(trTag, document());
         if (numRows == index || index == -1)
@@ -89,7 +89,7 @@
         RefPtr<Node> row = children->item(index);
         HTMLElement::removeChild(row.get(), es);
     } else {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     }
 }
 
diff --git a/Source/core/html/HTMLTextAreaElement.cpp b/Source/core/html/HTMLTextAreaElement.cpp
index d2ac02f..35486bf 100644
--- a/Source/core/html/HTMLTextAreaElement.cpp
+++ b/Source/core/html/HTMLTextAreaElement.cpp
@@ -30,22 +30,23 @@
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionState.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/Text.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
 #include "core/editing/TextIterator.h"
-#include "core/html/FormController.h"
 #include "core/html/FormDataList.h"
+#include "core/html/forms/FormController.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/html/shadow/TextControlInnerElements.h"
 #include "core/page/Frame.h"
 #include "core/platform/LocalizedStrings.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "core/rendering/RenderTextControlMultiLine.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuilder.h"
@@ -444,7 +445,7 @@
 void HTMLTextAreaElement::setMaxLength(int newValue, ExceptionState& es)
 {
     if (newValue < 0)
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
     else
         setAttribute(maxlengthAttr, String::number(newValue));
 }
@@ -458,10 +459,10 @@
         return customValidationMessage();
 
     if (valueMissing())
-        return validationMessageValueMissingText();
+        return locale().queryString(WebKit::WebLocalizedString::ValidationValueMissing);
 
     if (tooLong())
-        return validationMessageTooLongText(computeLengthForSubmission(value()), maxLength());
+        return locale().validationMessageTooLongText(computeLengthForSubmission(value()), maxLength());
 
     return String();
 }
diff --git a/Source/core/html/HTMLTextFormControlElement.cpp b/Source/core/html/HTMLTextFormControlElement.cpp
index 4887402..40ef6c6 100644
--- a/Source/core/html/HTMLTextFormControlElement.cpp
+++ b/Source/core/html/HTMLTextFormControlElement.cpp
@@ -30,8 +30,8 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Text.h"
 #include "core/dom/shadow/ShadowRoot.h"
@@ -132,7 +132,7 @@
 bool HTMLTextFormControlElement::isPlaceholderEmpty() const
 {
     const AtomicString& attributeValue = fastGetAttribute(placeholderAttr);
-    return attributeValue.string().find(isNotLineBreak) == notFound;
+    return attributeValue.string().find(isNotLineBreak) == kNotFound;
 }
 
 bool HTMLTextFormControlElement::placeholderShouldBeVisible() const
@@ -213,7 +213,7 @@
 void HTMLTextFormControlElement::setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionState& es)
 {
     if (start > end) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
diff --git a/Source/core/html/HTMLTrackElement.cpp b/Source/core/html/HTMLTrackElement.cpp
index dfbbc45..2a7e716 100644
--- a/Source/core/html/HTMLTrackElement.cpp
+++ b/Source/core/html/HTMLTrackElement.cpp
@@ -28,7 +28,7 @@
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/page/ContentSecurityPolicy.h"
 #include "RuntimeEnabledFeatures.h"
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index ded6f09..9b895cc 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -227,7 +227,7 @@
     // Generate an exception if this isn't called in response to a user gesture, or if the
     // element does not support fullscreen.
     if ((userGestureRequiredForFullscreen() && !ScriptController::processingUserGesture()) || !supportsFullscreen()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
diff --git a/Source/core/html/ImageDocument.cpp b/Source/core/html/ImageDocument.cpp
index 23b02c3..ce7d501 100644
--- a/Source/core/html/ImageDocument.cpp
+++ b/Source/core/html/ImageDocument.cpp
@@ -27,9 +27,9 @@
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/RawDataDocumentParser.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/HTMLBodyElement.h"
diff --git a/Source/core/html/MediaController.cpp b/Source/core/html/MediaController.cpp
index afc7cc9..82f565c 100644
--- a/Source/core/html/MediaController.cpp
+++ b/Source/core/html/MediaController.cpp
@@ -31,7 +31,7 @@
 #include "core/dom/ExceptionCode.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/TimeRanges.h"
-#include "core/platform/Clock.h"
+#include "platform/Clock.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/AtomicString.h"
@@ -260,7 +260,7 @@
     // If the new value is outside the range 0.0 to 1.0 inclusive, then, on setting, an
     // IndexSizeError exception must be raised instead.
     if (level < 0 || level > 1) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
diff --git a/Source/core/html/MediaController.h b/Source/core/html/MediaController.h
index 2a833de..c34b594 100644
--- a/Source/core/html/MediaController.h
+++ b/Source/core/html/MediaController.h
@@ -27,8 +27,8 @@
 #define MediaController_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/Event.h"
+#include "core/events/EventTarget.h"
 #include "core/html/MediaControllerInterface.h"
 #include "core/platform/Timer.h"
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/html/MediaDocument.cpp b/Source/core/html/MediaDocument.cpp
index 874a45e..393dcbe 100644
--- a/Source/core/html/MediaDocument.cpp
+++ b/Source/core/html/MediaDocument.cpp
@@ -29,8 +29,8 @@
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/RawDataDocumentParser.h"
 #include "core/html/HTMLBodyElement.h"
diff --git a/Source/core/html/MediaFragmentURIParser.cpp b/Source/core/html/MediaFragmentURIParser.cpp
index 3289ec0..c377581 100644
--- a/Source/core/html/MediaFragmentURIParser.cpp
+++ b/Source/core/html/MediaFragmentURIParser.cpp
@@ -112,11 +112,11 @@
         //    percent-encoded octets are decoded.
         size_t parameterStart = offset;
         size_t parameterEnd = fragmentString.find('&', offset);
-        if (parameterEnd == notFound)
+        if (parameterEnd == kNotFound)
             parameterEnd = end;
 
         size_t equalOffset = fragmentString.find('=', offset);
-        if (equalOffset == notFound || equalOffset > parameterEnd) {
+        if (equalOffset == kNotFound || equalOffset > parameterEnd) {
             offset = parameterEnd + 1;
             continue;
         }
diff --git a/Source/core/html/MediaKeyEvent.cpp b/Source/core/html/MediaKeyEvent.cpp
index 3e9e27c..bd987ee 100644
--- a/Source/core/html/MediaKeyEvent.cpp
+++ b/Source/core/html/MediaKeyEvent.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "core/html/MediaKeyEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "wtf/Uint8Array.h"
 
 namespace WebCore {
diff --git a/Source/core/html/MediaKeyEvent.h b/Source/core/html/MediaKeyEvent.h
index 1261d23..6a0cfc4 100644
--- a/Source/core/html/MediaKeyEvent.h
+++ b/Source/core/html/MediaKeyEvent.h
@@ -26,7 +26,7 @@
 #ifndef MediaKeyEvent_h
 #define MediaKeyEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/MediaKeyError.h"
 
 namespace WebCore {
diff --git a/Source/core/html/MediaKeyEvent.idl b/Source/core/html/MediaKeyEvent.idl
index 297eabe..9586e06 100644
--- a/Source/core/html/MediaKeyEvent.idl
+++ b/Source/core/html/MediaKeyEvent.idl
@@ -24,7 +24,7 @@
  */
 
 [
-    EnabledAtRuntime=LegacyEncryptedMedia,
+    EnabledAtRuntime=PrefixedEncryptedMedia,
     ConstructorTemplate=Event
 ] interface MediaKeyEvent : Event {
     [InitializedByEventConstructor] readonly attribute DOMString keySystem;
diff --git a/Source/core/html/TimeRanges.cpp b/Source/core/html/TimeRanges.cpp
index 7d42425..71fd4fd 100644
--- a/Source/core/html/TimeRanges.cpp
+++ b/Source/core/html/TimeRanges.cpp
@@ -105,7 +105,7 @@
 double TimeRanges::start(unsigned index, ExceptionState& es) const
 {
     if (index >= length()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
     return m_ranges[index].m_start;
@@ -114,7 +114,7 @@
 double TimeRanges::end(unsigned index, ExceptionState& es) const
 {
     if (index >= length()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
     return m_ranges[index].m_end;
diff --git a/Source/core/html/canvas/ANGLEInstancedArrays.cpp b/Source/core/html/canvas/ANGLEInstancedArrays.cpp
index 5633111..b2d047f 100644
--- a/Source/core/html/canvas/ANGLEInstancedArrays.cpp
+++ b/Source/core/html/canvas/ANGLEInstancedArrays.cpp
@@ -41,14 +41,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_ANGLE_instanced_arrays");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_ANGLE_instanced_arrays");
 }
 
 ANGLEInstancedArrays::~ANGLEInstancedArrays()
 {
 }
 
-WebGLExtension::ExtensionName ANGLEInstancedArrays::getName() const
+WebGLExtension::ExtensionName ANGLEInstancedArrays::name() const
 {
     return ANGLEInstancedArraysName;
 }
@@ -60,11 +60,11 @@
 
 bool ANGLEInstancedArrays::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_ANGLE_instanced_arrays");
 }
 
-const char* ANGLEInstancedArrays::getExtensionName()
+const char* ANGLEInstancedArrays::extensionName()
 {
     return "ANGLE_instanced_arrays";
 }
diff --git a/Source/core/html/canvas/ANGLEInstancedArrays.h b/Source/core/html/canvas/ANGLEInstancedArrays.h
index e5ad34e..b7e11a5 100644
--- a/Source/core/html/canvas/ANGLEInstancedArrays.h
+++ b/Source/core/html/canvas/ANGLEInstancedArrays.h
@@ -43,10 +43,10 @@
 public:
     static PassRefPtr<ANGLEInstancedArrays> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~ANGLEInstancedArrays();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
     void drawArraysInstancedANGLE(GC3Denum mode, GC3Dint first, GC3Dsizei count, GC3Dsizei primcount);
     void drawElementsInstancedANGLE(GC3Denum mode, GC3Dsizei count, GC3Denum type, GC3Dintptr offset, GC3Dsizei primcount);
diff --git a/Source/core/html/canvas/Canvas2DContextAttributes.idl b/Source/core/html/canvas/Canvas2DContextAttributes.idl
index f756bda..72e0191 100644
--- a/Source/core/html/canvas/Canvas2DContextAttributes.idl
+++ b/Source/core/html/canvas/Canvas2DContextAttributes.idl
@@ -25,8 +25,7 @@
  */
 
 [
-    NoInterfaceObject,
-    EnabledAtRuntime=ExperimentalCanvasFeatures
+    NoInterfaceObject
 ] interface Canvas2DContextAttributes {
     attribute boolean alpha;
 };
diff --git a/Source/core/html/canvas/CanvasGradient.cpp b/Source/core/html/canvas/CanvasGradient.cpp
index 394ebf0..a54df39 100644
--- a/Source/core/html/canvas/CanvasGradient.cpp
+++ b/Source/core/html/canvas/CanvasGradient.cpp
@@ -49,13 +49,13 @@
 void CanvasGradient::addColorStop(float value, const String& color, ExceptionState& es)
 {
     if (!(value >= 0 && value <= 1.0f)) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
     RGBA32 rgba = 0;
     if (!parseColorOrCurrentColor(rgba, color, 0 /*canvas*/)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
diff --git a/Source/core/html/canvas/CanvasPathMethods.cpp b/Source/core/html/canvas/CanvasPathMethods.cpp
index 9104eac..7de92cd 100644
--- a/Source/core/html/canvas/CanvasPathMethods.cpp
+++ b/Source/core/html/canvas/CanvasPathMethods.cpp
@@ -113,7 +113,7 @@
         return;
 
     if (r < 0) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -259,7 +259,7 @@
         return;
 
     if (radius < 0) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -283,7 +283,7 @@
         return;
 
     if (radiusX < 0 || radiusY < 0) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
diff --git a/Source/core/html/canvas/CanvasPattern.cpp b/Source/core/html/canvas/CanvasPattern.cpp
index 8e20d0c..3a59f71 100644
--- a/Source/core/html/canvas/CanvasPattern.cpp
+++ b/Source/core/html/canvas/CanvasPattern.cpp
@@ -54,7 +54,7 @@
         repeatY = true;
         return;
     }
-    es.throwDOMException(SyntaxError);
+    es.throwUninformativeAndGenericDOMException(SyntaxError);
 }
 
 CanvasPattern::CanvasPattern(PassRefPtr<Image> image, bool repeatX, bool repeatY, bool originClean)
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 3225ecd..2bb4d8c 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -895,6 +895,9 @@
         return;
     if (!state().m_invertibleCTM)
         return;
+    FloatRect clipBounds;
+    if (!drawingContext()->getTransformedClipBounds(&clipBounds))
+        return;
 
     // If gradient size is zero, then paint nothing.
     Gradient* gradient = c->fillGradient();
@@ -910,14 +913,17 @@
 
         if (isFullCanvasCompositeMode(state().m_globalComposite)) {
             fullCanvasCompositedFill(m_path);
-            didDrawEntireCanvas();
+            didDraw(clipBounds);
         } else if (state().m_globalComposite == CompositeCopy) {
             clearCanvas();
             c->fillPath(m_path);
-            didDrawEntireCanvas();
+            didDraw(clipBounds);
         } else {
-            c->fillPath(m_path);
-            didDraw(m_path.boundingRect());
+            FloatRect dirtyRect;
+            if (computeDirtyRect(m_path.boundingRect(), clipBounds, &dirtyRect)) {
+                c->fillPath(m_path);
+                didDraw(dirtyRect);
+            }
         }
 
         c->setFillRule(windRule);
@@ -938,11 +944,13 @@
         return;
 
     if (!m_path.isEmpty()) {
-        FloatRect dirtyRect = m_path.boundingRect();
-        inflateStrokeRect(dirtyRect);
-
-        c->strokePath(m_path);
-        didDraw(dirtyRect);
+        FloatRect bounds = m_path.boundingRect();
+        inflateStrokeRect(bounds);
+        FloatRect dirtyRect;
+        if (computeDirtyRect(bounds, &dirtyRect)) {
+            c->strokePath(m_path);
+            didDraw(dirtyRect);
+        }
     }
 }
 
@@ -1018,6 +1026,10 @@
         return;
     FloatRect rect(x, y, width, height);
 
+    FloatRect dirtyRect;
+    if (!computeDirtyRect(rect, &dirtyRect))
+        return;
+
     bool saved = false;
     if (shouldDrawShadows()) {
         context->save();
@@ -1041,7 +1053,8 @@
     context->clearRect(rect);
     if (saved)
         context->restore();
-    didDraw(rect);
+
+    didDraw(dirtyRect);
 }
 
 void CanvasRenderingContext2D::fillRect(float x, float y, float width, float height)
@@ -1054,6 +1067,9 @@
         return;
     if (!state().m_invertibleCTM)
         return;
+    FloatRect clipBounds;
+    if (!drawingContext()->getTransformedClipBounds(&clipBounds))
+        return;
 
     // from the HTML5 Canvas spec:
     // If x0 = x1 and y0 = y1, then the linear gradient must paint nothing
@@ -1063,20 +1079,22 @@
         return;
 
     FloatRect rect(x, y, width, height);
-
-    if (rectContainsCanvas(rect)) {
+    if (rectContainsTransformedRect(rect, clipBounds)) {
         c->fillRect(rect);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (isFullCanvasCompositeMode(state().m_globalComposite)) {
         fullCanvasCompositedFill(rect);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (state().m_globalComposite == CompositeCopy) {
         clearCanvas();
         c->fillRect(rect);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else {
-        c->fillRect(rect);
-        didDraw(rect);
+        FloatRect dirtyRect;
+        if (computeDirtyRect(rect, clipBounds, &dirtyRect)) {
+            c->fillRect(rect);
+            didDraw(dirtyRect);
+        }
     }
 }
 
@@ -1103,9 +1121,11 @@
 
     FloatRect boundingRect = rect;
     boundingRect.inflate(state().m_lineWidth / 2);
-
-    c->strokeRect(rect, state().m_lineWidth);
-    didDraw(boundingRect);
+    FloatRect dirtyRect;
+    if (computeDirtyRect(boundingRect, &dirtyRect)) {
+        c->strokeRect(rect, state().m_lineWidth);
+        didDraw(dirtyRect);
+    }
 }
 
 void CanvasRenderingContext2D::setShadow(float width, float height, float blur)
@@ -1238,27 +1258,33 @@
         return;
     if (!state().m_invertibleCTM)
         return;
+    FloatRect clipBounds;
+    if (!drawingContext()->getTransformedClipBounds(&clipBounds))
+        return;
 
-    if (rectContainsCanvas(dstRect)) {
+    if (rectContainsTransformedRect(dstRect, clipBounds)) {
         c->drawImage(image, dstRect, srcRect, op, blendMode);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (isFullCanvasCompositeMode(op)) {
         fullCanvasCompositedDrawImage(image, dstRect, srcRect, op);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (op == CompositeCopy) {
         clearCanvas();
         c->drawImage(image, dstRect, srcRect, op, blendMode);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else {
-        c->drawImage(image, dstRect, srcRect, op, blendMode);
-        didDraw(dstRect);
+        FloatRect dirtyRect;
+        if (computeDirtyRect(dstRect, &dirtyRect)) {
+            c->drawImage(image, dstRect, srcRect, op, blendMode);
+            didDraw(dirtyRect);
+        }
     }
 }
 
 void CanvasRenderingContext2D::drawImage(ImageBitmap* bitmap, float x, float y, ExceptionState& es)
 {
     if (!bitmap) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     drawImage(bitmap, x, y, bitmap->width(), bitmap->height(), es);
@@ -1268,7 +1294,7 @@
     float x, float y, float width, float height, ExceptionState& es)
 {
     if (!bitmap) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     if (!bitmap->bitmapRect().width() || !bitmap->bitmapRect().height())
@@ -1282,7 +1308,7 @@
     float dx, float dy, float dw, float dh, ExceptionState& es)
 {
     if (!bitmap) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
@@ -1297,7 +1323,7 @@
     if (!dstRect.width() || !dstRect.height())
         return;
     if (!srcRect.width() || !srcRect.height()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -1333,7 +1359,7 @@
 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, float x, float y, ExceptionState& es)
 {
     if (!image) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     LayoutSize size = sizeFor(image);
@@ -1344,7 +1370,7 @@
     float x, float y, float width, float height, ExceptionState& es)
 {
     if (!image) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     LayoutSize size = sizeFor(image);
@@ -1366,7 +1392,7 @@
 void CanvasRenderingContext2D::drawImage(HTMLImageElement* image, const FloatRect& srcRect, const FloatRect& dstRect, const CompositeOperator& op, const BlendMode& blendMode, ExceptionState& es)
 {
     if (!image) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
@@ -1380,7 +1406,7 @@
 
     LayoutSize size = sizeFor(image);
     if (!size.width() || !size.height()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -1392,7 +1418,7 @@
 
     FloatRect imageRect = FloatRect(FloatPoint(), size);
     if (!srcRect.width() || !srcRect.height()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
     if (!imageRect.intersects(normalizedSrcRect))
@@ -1435,19 +1461,19 @@
     const FloatRect& dstRect, ExceptionState& es)
 {
     if (!sourceCanvas) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
     FloatRect srcCanvasRect = FloatRect(FloatPoint(), sourceCanvas->size());
 
     if (!srcCanvasRect.width() || !srcCanvasRect.height()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
     if (!srcRect.width() || !srcRect.height()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -1470,6 +1496,10 @@
     if (!buffer)
         return;
 
+    FloatRect clipBounds;
+    if (!drawingContext()->getTransformedClipBounds(&clipBounds))
+        return;
+
     checkOrigin(sourceCanvas);
 
     // If we're drawing from one accelerated canvas 2d to another, avoid calling sourceCanvas->makeRenderingResultsAvailable()
@@ -1479,26 +1509,29 @@
     if (sourceContext && sourceContext->is3d())
         sourceContext->paintRenderingResultsToCanvas();
 
-    if (rectContainsCanvas(normalizedDstRect)) {
+    if (rectContainsTransformedRect(normalizedDstRect, clipBounds)) {
         c->drawImageBuffer(buffer, normalizedDstRect, normalizedSrcRect, state().m_globalComposite, state().m_globalBlend);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (isFullCanvasCompositeMode(state().m_globalComposite)) {
         fullCanvasCompositedDrawImage(buffer, normalizedDstRect, normalizedSrcRect, state().m_globalComposite);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else if (state().m_globalComposite == CompositeCopy) {
         clearCanvas();
         c->drawImageBuffer(buffer, normalizedDstRect, normalizedSrcRect, state().m_globalComposite, state().m_globalBlend);
-        didDrawEntireCanvas();
+        didDraw(clipBounds);
     } else {
-        c->drawImageBuffer(buffer, normalizedDstRect, normalizedSrcRect, state().m_globalComposite, state().m_globalBlend);
-        didDraw(normalizedDstRect);
+        FloatRect dirtyRect;
+        if (computeDirtyRect(normalizedDstRect, clipBounds, &dirtyRect)) {
+            c->drawImageBuffer(buffer, normalizedDstRect, normalizedSrcRect, state().m_globalComposite, state().m_globalBlend);
+            didDraw(dirtyRect);
+        }
     }
 }
 
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, float x, float y, ExceptionState& es)
 {
     if (!video) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     IntSize size = sizeFor(video);
@@ -1509,7 +1542,7 @@
     float x, float y, float width, float height, ExceptionState& es)
 {
     if (!video) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     IntSize size = sizeFor(video);
@@ -1526,7 +1559,7 @@
 void CanvasRenderingContext2D::drawImage(HTMLVideoElement* video, const FloatRect& srcRect, const FloatRect& dstRect, ExceptionState& es)
 {
     if (!video) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
 
@@ -1535,7 +1568,7 @@
 
     FloatRect videoRect = FloatRect(FloatPoint(), sizeFor(video));
     if (!srcRect.width() || !srcRect.height()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -1555,6 +1588,10 @@
 
     checkOrigin(video);
 
+    FloatRect dirtyRect;
+    if (!computeDirtyRect(normalizedDstRect, &dirtyRect))
+        return;
+
     GraphicsContextStateSaver stateSaver(*c);
     c->clip(normalizedDstRect);
     c->translate(normalizedDstRect.x(), normalizedDstRect.y());
@@ -1562,7 +1599,8 @@
     c->translate(-normalizedSrcRect.x(), -normalizedSrcRect.y());
     video->paintCurrentFrameInContext(c, IntRect(IntPoint(), sizeFor(video)));
     stateSaver.restore();
-    didDraw(dstRect);
+
+    didDraw(dirtyRect);
 }
 
 void CanvasRenderingContext2D::drawImageFromRect(HTMLImageElement* image,
@@ -1601,11 +1639,11 @@
     c->restore();
 }
 
-bool CanvasRenderingContext2D::rectContainsCanvas(const FloatRect& rect) const
+bool CanvasRenderingContext2D::rectContainsTransformedRect(const FloatRect& rect, const FloatRect& transformedRect) const
 {
     FloatQuad quad(rect);
-    FloatQuad canvasQuad(FloatRect(0, 0, canvas()->width(), canvas()->height()));
-    return state().m_transform.mapQuad(quad).containsQuad(canvasQuad);
+    FloatQuad transformedQuad(transformedRect);
+    return state().m_transform.mapQuad(quad).containsQuad(transformedQuad);
 }
 
 static void drawImageToContext(Image* image, GraphicsContext* context, const FloatRect& dest, const FloatRect& src, CompositeOperator op)
@@ -1654,7 +1692,7 @@
 PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createLinearGradient(float x0, float y0, float x1, float y1, ExceptionState& es)
 {
     if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(x1) || !std::isfinite(y1)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -1665,12 +1703,12 @@
 PassRefPtr<CanvasGradient> CanvasRenderingContext2D::createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1, ExceptionState& es)
 {
     if (!std::isfinite(x0) || !std::isfinite(y0) || !std::isfinite(r0) || !std::isfinite(x1) || !std::isfinite(y1) || !std::isfinite(r1)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
     if (r0 < 0 || r1 < 0) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
 
@@ -1682,7 +1720,7 @@
     const String& repetitionType, ExceptionState& es)
 {
     if (!image) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return 0;
     }
     bool repeatX, repeatY;
@@ -1710,11 +1748,11 @@
     const String& repetitionType, ExceptionState& es)
 {
     if (!canvas) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return 0;
     }
     if (!canvas->width() || !canvas->height()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return 0;
     }
 
@@ -1725,17 +1763,38 @@
     return CanvasPattern::create(canvas->copiedImage(), repeatX, repeatY, canvas->originClean());
 }
 
-void CanvasRenderingContext2D::didDrawEntireCanvas()
+bool CanvasRenderingContext2D::computeDirtyRect(const FloatRect& localRect, FloatRect* dirtyRect)
 {
-    didDraw(FloatRect(FloatPoint::zero(), canvas()->size()), CanvasDidDrawApplyClip);
+    FloatRect clipBounds;
+    if (!drawingContext()->getTransformedClipBounds(&clipBounds))
+        return false;
+    return computeDirtyRect(localRect, clipBounds, dirtyRect);
 }
 
-void CanvasRenderingContext2D::didDraw(const FloatRect& r, unsigned options)
+bool CanvasRenderingContext2D::computeDirtyRect(const FloatRect& localRect, const FloatRect& transformedClipBounds, FloatRect* dirtyRect)
 {
-    GraphicsContext* c = drawingContext();
-    if (!c)
-        return;
-    if (!state().m_invertibleCTM)
+    FloatRect canvasRect = state().m_transform.mapRect(localRect);
+
+    if (alphaChannel(state().m_shadowColor)) {
+        FloatRect shadowRect(canvasRect);
+        shadowRect.move(state().m_shadowOffset);
+        shadowRect.inflate(state().m_shadowBlur);
+        canvasRect.unite(shadowRect);
+    }
+
+    canvasRect.intersect(transformedClipBounds);
+    if (canvasRect.isEmpty())
+        return false;
+
+    if (dirtyRect)
+        *dirtyRect = canvasRect;
+
+    return true;
+}
+
+void CanvasRenderingContext2D::didDraw(const FloatRect& dirtyRect)
+{
+    if (dirtyRect.isEmpty())
         return;
 
     // If we are drawing to hardware and we have a composited layer, just call contentChanged().
@@ -1744,31 +1803,11 @@
         if (renderBox && renderBox->hasAcceleratedCompositing()) {
             renderBox->contentChanged(CanvasPixelsChanged);
             canvas()->clearCopiedImage();
-            canvas()->notifyObserversCanvasChanged(r);
+            canvas()->notifyObserversCanvasChanged(dirtyRect);
             return;
         }
     }
 
-    FloatRect dirtyRect = r;
-    if (options & CanvasDidDrawApplyTransform) {
-        AffineTransform ctm = state().m_transform;
-        dirtyRect = ctm.mapRect(r);
-    }
-
-    if (options & CanvasDidDrawApplyShadow && alphaChannel(state().m_shadowColor)) {
-        // The shadow gets applied after transformation
-        FloatRect shadowRect(dirtyRect);
-        shadowRect.move(state().m_shadowOffset);
-        shadowRect.inflate(state().m_shadowBlur);
-        dirtyRect.unite(shadowRect);
-    }
-
-    if (options & CanvasDidDrawApplyClip) {
-        // FIXME: apply the current clip to the rectangle. Unfortunately we can't get the clip
-        // back out of the GraphicsContext, so to take clip into account for incremental painting,
-        // we'd have to keep the clip path around.
-    }
-
     canvas()->didDraw(dirtyRect);
 }
 
@@ -1793,7 +1832,7 @@
 PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(PassRefPtr<ImageData> imageData, ExceptionState& es) const
 {
     if (!imageData) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -1803,11 +1842,11 @@
 PassRefPtr<ImageData> CanvasRenderingContext2D::createImageData(float sw, float sh, ExceptionState& es) const
 {
     if (!sw || !sh) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
     if (!std::isfinite(sw) || !std::isfinite(sh)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -1842,11 +1881,11 @@
     }
 
     if (!sw || !sh) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
     if (!std::isfinite(sx) || !std::isfinite(sy) || !std::isfinite(sw) || !std::isfinite(sh)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -1882,7 +1921,7 @@
 void CanvasRenderingContext2D::putImageData(ImageData* data, float dx, float dy, ExceptionState& es)
 {
     if (!data) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     putImageData(data, dx, dy, 0, 0, data->width(), data->height(), es);
@@ -1891,7 +1930,7 @@
 void CanvasRenderingContext2D::webkitPutImageDataHD(ImageData* data, float dx, float dy, ExceptionState& es)
 {
     if (!data) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     webkitPutImageDataHD(data, dx, dy, 0, 0, data->width(), data->height(), es);
@@ -1912,11 +1951,11 @@
     float dirtyWidth, float dirtyHeight, ExceptionState& es)
 {
     if (!data) {
-        es.throwDOMException(TypeMismatchError);
+        es.throwUninformativeAndGenericDOMException(TypeMismatchError);
         return;
     }
     if (!std::isfinite(dx) || !std::isfinite(dy) || !std::isfinite(dirtyX) || !std::isfinite(dirtyY) || !std::isfinite(dirtyWidth) || !std::isfinite(dirtyHeight)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -1952,7 +1991,7 @@
         dirtyRect.scale(1 / canvas()->deviceScaleFactor());
         destRect = enclosingIntRect(dirtyRect);
     }
-    didDraw(destRect, CanvasDidDrawApplyNone); // ignore transform, shadow and clip
+    didDraw(destRect);
 }
 
 String CanvasRenderingContext2D::font() const
@@ -2121,7 +2160,7 @@
 {
     const size_t replacementLength = replacement.length();
     size_t index = 0;
-    while ((index = text.find(matchFunction, index)) != notFound) {
+    while ((index = text.find(matchFunction, index)) != kNotFound) {
         text.replace(index, 1, replacement);
         index += replacementLength;
     }
@@ -2215,6 +2254,10 @@
     if (!fill)
         inflateStrokeRect(textRunPaintInfo.bounds);
 
+    FloatRect dirtyRect;
+    if (!computeDirtyRect(textRunPaintInfo.bounds, &dirtyRect))
+        return;
+
     c->setTextDrawingMode(fill ? TextModeFill : TextModeStroke);
     if (useMaxWidth) {
         GraphicsContextStateSaver stateSaver(*c);
@@ -2225,7 +2268,7 @@
     } else
         c->drawBidiText(font, textRunPaintInfo, location, Font::UseFallbackIfFontNotReady);
 
-    didDraw(textRunPaintInfo.bounds);
+    didDraw(dirtyRect);
 }
 
 void CanvasRenderingContext2D::inflateStrokeRect(FloatRect& rect) const
@@ -2357,6 +2400,10 @@
     if (!c)
         return;
 
+    FloatRect dirtyRect;
+    if (!computeDirtyRect(path.boundingRect(), &dirtyRect))
+        return;
+
     c->save();
     c->setAlpha(1.0);
     c->clearShadow();
@@ -2367,9 +2414,10 @@
     const int focusRingWidth = 5;
     const int focusRingOutline = 0;
     c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
-    didDraw(path.boundingRect());
 
     c->restore();
+
+    didDraw(dirtyRect);
 }
 
 } // namespace WebCore
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.h b/Source/core/html/canvas/CanvasRenderingContext2D.h
index 46107a2..a3f8eb1 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.h
@@ -270,14 +270,6 @@
         bool m_realizedFont;
     };
 
-    enum CanvasDidDrawOption {
-        CanvasDidDrawApplyNone = 0,
-        CanvasDidDrawApplyTransform = 1,
-        CanvasDidDrawApplyShadow = 1 << 1,
-        CanvasDidDrawApplyClip = 1 << 2,
-        CanvasDidDrawApplyAll = 0xffffffff
-    };
-
     CanvasRenderingContext2D(HTMLCanvasElement*, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode);
 
     State& modifiableState() { ASSERT(!m_unrealizedSaveCount); return m_stateStack.last(); }
@@ -289,8 +281,9 @@
     bool shouldDrawShadows() const;
 
     void drawImageInternal(Image*, const FloatRect&, const FloatRect&, const CompositeOperator&, const BlendMode&);
-    void didDraw(const FloatRect&, unsigned options = CanvasDidDrawApplyAll);
-    void didDrawEntireCanvas();
+    bool computeDirtyRect(const FloatRect& localBounds, FloatRect*);
+    bool computeDirtyRect(const FloatRect& localBounds, const FloatRect& transformedClipBounds, FloatRect*);
+    void didDraw(const FloatRect&);
 
     GraphicsContext* drawingContext() const;
 
@@ -310,7 +303,7 @@
     const Font& accessFont();
 
     void clearCanvas();
-    bool rectContainsCanvas(const FloatRect&) const;
+    bool rectContainsTransformedRect(const FloatRect&, const FloatRect&) const;
 
     void inflateStrokeRect(FloatRect&) const;
 
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.idl b/Source/core/html/canvas/CanvasRenderingContext2D.idl
index 69a3ffa..e62de80 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.idl
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.idl
@@ -170,6 +170,6 @@
     [ImplementedAs=imageSmoothingEnabled] attribute boolean webkitImageSmoothingEnabled;
     attribute boolean imageSmoothingEnabled;
 
-    [EnabledAtRuntime=ExperimentalCanvasFeatures] Canvas2DContextAttributes getContextAttributes();
+    Canvas2DContextAttributes getContextAttributes();
 };
 
diff --git a/Source/core/html/canvas/DataView.cpp b/Source/core/html/canvas/DataView.cpp
index b35984d..914a14a 100644
--- a/Source/core/html/canvas/DataView.cpp
+++ b/Source/core/html/canvas/DataView.cpp
@@ -133,7 +133,7 @@
 T DataView::getData(unsigned byteOffset, bool littleEndian, ExceptionState& es) const
 {
     if (beyondRange<T>(byteOffset)) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0;
     }
 
@@ -148,7 +148,7 @@
 void DataView::setData(unsigned byteOffset, T value, bool littleEndian, ExceptionState& es)
 {
     if (beyondRange<T>(byteOffset)) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
diff --git a/Source/core/html/canvas/EXTFragDepth.cpp b/Source/core/html/canvas/EXTFragDepth.cpp
index 5f9e2d9..dbc55a4 100644
--- a/Source/core/html/canvas/EXTFragDepth.cpp
+++ b/Source/core/html/canvas/EXTFragDepth.cpp
@@ -35,14 +35,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_EXT_frag_depth");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_EXT_frag_depth");
 }
 
 EXTFragDepth::~EXTFragDepth()
 {
 }
 
-WebGLExtension::ExtensionName EXTFragDepth::getName() const
+WebGLExtension::ExtensionName EXTFragDepth::name() const
 {
     return EXTFragDepthName;
 }
@@ -54,11 +54,11 @@
 
 bool EXTFragDepth::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_EXT_frag_depth");
 }
 
-const char* EXTFragDepth::getExtensionName()
+const char* EXTFragDepth::extensionName()
 {
     return "EXT_frag_depth";
 }
diff --git a/Source/core/html/canvas/EXTFragDepth.h b/Source/core/html/canvas/EXTFragDepth.h
index 57da19e..fc8a9fa 100644
--- a/Source/core/html/canvas/EXTFragDepth.h
+++ b/Source/core/html/canvas/EXTFragDepth.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<EXTFragDepth> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~EXTFragDepth();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     explicit EXTFragDepth(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp b/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
index 81f5d82..6f3f944 100644
--- a/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
+++ b/Source/core/html/canvas/EXTTextureFilterAnisotropic.cpp
@@ -34,14 +34,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_EXT_texture_filter_anisotropic");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_EXT_texture_filter_anisotropic");
 }
 
 EXTTextureFilterAnisotropic::~EXTTextureFilterAnisotropic()
 {
 }
 
-WebGLExtension::ExtensionName EXTTextureFilterAnisotropic::getName() const
+WebGLExtension::ExtensionName EXTTextureFilterAnisotropic::name() const
 {
     return EXTTextureFilterAnisotropicName;
 }
@@ -53,11 +53,11 @@
 
 bool EXTTextureFilterAnisotropic::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_EXT_texture_filter_anisotropic");
 }
 
-const char* EXTTextureFilterAnisotropic::getExtensionName()
+const char* EXTTextureFilterAnisotropic::extensionName()
 {
     return "EXT_texture_filter_anisotropic";
 }
diff --git a/Source/core/html/canvas/EXTTextureFilterAnisotropic.h b/Source/core/html/canvas/EXTTextureFilterAnisotropic.h
index 6c445f9..727f00e 100644
--- a/Source/core/html/canvas/EXTTextureFilterAnisotropic.h
+++ b/Source/core/html/canvas/EXTTextureFilterAnisotropic.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<EXTTextureFilterAnisotropic> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~EXTTextureFilterAnisotropic();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     EXTTextureFilterAnisotropic(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESElementIndexUint.cpp b/Source/core/html/canvas/OESElementIndexUint.cpp
index 4fa47ed..af87a99 100644
--- a/Source/core/html/canvas/OESElementIndexUint.cpp
+++ b/Source/core/html/canvas/OESElementIndexUint.cpp
@@ -34,14 +34,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_element_index_uint");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_element_index_uint");
 }
 
 OESElementIndexUint::~OESElementIndexUint()
 {
 }
 
-WebGLExtension::ExtensionName OESElementIndexUint::getName() const
+WebGLExtension::ExtensionName OESElementIndexUint::name() const
 {
     return OESElementIndexUintName;
 }
@@ -53,11 +53,11 @@
 
 bool OESElementIndexUint::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_element_index_uint");
 }
 
-const char* OESElementIndexUint::getExtensionName()
+const char* OESElementIndexUint::extensionName()
 {
     return "OES_element_index_uint";
 }
diff --git a/Source/core/html/canvas/OESElementIndexUint.h b/Source/core/html/canvas/OESElementIndexUint.h
index c57f6b5..0116c1d 100644
--- a/Source/core/html/canvas/OESElementIndexUint.h
+++ b/Source/core/html/canvas/OESElementIndexUint.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESElementIndexUint> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESElementIndexUint();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESElementIndexUint(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESStandardDerivatives.cpp b/Source/core/html/canvas/OESStandardDerivatives.cpp
index 442640c..36bf2dc 100644
--- a/Source/core/html/canvas/OESStandardDerivatives.cpp
+++ b/Source/core/html/canvas/OESStandardDerivatives.cpp
@@ -34,14 +34,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_standard_derivatives");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_standard_derivatives");
 }
 
 OESStandardDerivatives::~OESStandardDerivatives()
 {
 }
 
-WebGLExtension::ExtensionName OESStandardDerivatives::getName() const
+WebGLExtension::ExtensionName OESStandardDerivatives::name() const
 {
     return OESStandardDerivativesName;
 }
@@ -53,11 +53,11 @@
 
 bool OESStandardDerivatives::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_standard_derivatives");
 }
 
-const char* OESStandardDerivatives::getExtensionName()
+const char* OESStandardDerivatives::extensionName()
 {
     return "OES_standard_derivatives";
 }
diff --git a/Source/core/html/canvas/OESStandardDerivatives.h b/Source/core/html/canvas/OESStandardDerivatives.h
index eee4ab5..327a152 100644
--- a/Source/core/html/canvas/OESStandardDerivatives.h
+++ b/Source/core/html/canvas/OESStandardDerivatives.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESStandardDerivatives> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESStandardDerivatives();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESStandardDerivatives(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESTextureFloat.cpp b/Source/core/html/canvas/OESTextureFloat.cpp
index 3d19049..5b10208 100644
--- a/Source/core/html/canvas/OESTextureFloat.cpp
+++ b/Source/core/html/canvas/OESTextureFloat.cpp
@@ -34,14 +34,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_texture_float");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_texture_float");
 }
 
 OESTextureFloat::~OESTextureFloat()
 {
 }
 
-WebGLExtension::ExtensionName OESTextureFloat::getName() const
+WebGLExtension::ExtensionName OESTextureFloat::name() const
 {
     return OESTextureFloatName;
 }
@@ -53,11 +53,11 @@
 
 bool OESTextureFloat::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_texture_float");
 }
 
-const char* OESTextureFloat::getExtensionName()
+const char* OESTextureFloat::extensionName()
 {
     return "OES_texture_float";
 }
diff --git a/Source/core/html/canvas/OESTextureFloat.h b/Source/core/html/canvas/OESTextureFloat.h
index 15322a9..255c674 100644
--- a/Source/core/html/canvas/OESTextureFloat.h
+++ b/Source/core/html/canvas/OESTextureFloat.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESTextureFloat> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESTextureFloat();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESTextureFloat(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESTextureFloatLinear.cpp b/Source/core/html/canvas/OESTextureFloatLinear.cpp
index 1bf416d..b7ddd05 100644
--- a/Source/core/html/canvas/OESTextureFloatLinear.cpp
+++ b/Source/core/html/canvas/OESTextureFloatLinear.cpp
@@ -35,14 +35,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_texture_float_linear");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_texture_float_linear");
 }
 
 OESTextureFloatLinear::~OESTextureFloatLinear()
 {
 }
 
-WebGLExtension::ExtensionName OESTextureFloatLinear::getName() const
+WebGLExtension::ExtensionName OESTextureFloatLinear::name() const
 {
     return OESTextureFloatLinearName;
 }
@@ -54,11 +54,11 @@
 
 bool OESTextureFloatLinear::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_texture_float_linear");
 }
 
-const char* OESTextureFloatLinear::getExtensionName()
+const char* OESTextureFloatLinear::extensionName()
 {
     return "OES_texture_float_linear";
 }
diff --git a/Source/core/html/canvas/OESTextureFloatLinear.h b/Source/core/html/canvas/OESTextureFloatLinear.h
index 34a3994..4d7f8d1 100644
--- a/Source/core/html/canvas/OESTextureFloatLinear.h
+++ b/Source/core/html/canvas/OESTextureFloatLinear.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESTextureFloatLinear> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESTextureFloatLinear();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESTextureFloatLinear(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESTextureHalfFloat.cpp b/Source/core/html/canvas/OESTextureHalfFloat.cpp
index 022e02a..f3b3bd6 100644
--- a/Source/core/html/canvas/OESTextureHalfFloat.cpp
+++ b/Source/core/html/canvas/OESTextureHalfFloat.cpp
@@ -34,14 +34,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_texture_half_float");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_texture_half_float");
 }
 
 OESTextureHalfFloat::~OESTextureHalfFloat()
 {
 }
 
-WebGLExtension::ExtensionName OESTextureHalfFloat::getName() const
+WebGLExtension::ExtensionName OESTextureHalfFloat::name() const
 {
     return OESTextureHalfFloatName;
 }
@@ -53,11 +53,11 @@
 
 bool OESTextureHalfFloat::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_texture_half_float");
 }
 
-const char* OESTextureHalfFloat::getExtensionName()
+const char* OESTextureHalfFloat::extensionName()
 {
     return "OES_texture_half_float";
 }
diff --git a/Source/core/html/canvas/OESTextureHalfFloat.h b/Source/core/html/canvas/OESTextureHalfFloat.h
index 34bfe8a..953d311 100644
--- a/Source/core/html/canvas/OESTextureHalfFloat.h
+++ b/Source/core/html/canvas/OESTextureHalfFloat.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESTextureHalfFloat> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESTextureHalfFloat();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESTextureHalfFloat(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp b/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
index 6a69c93..c8ba20c 100644
--- a/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
+++ b/Source/core/html/canvas/OESTextureHalfFloatLinear.cpp
@@ -35,14 +35,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_texture_half_float_linear");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_texture_half_float_linear");
 }
 
 OESTextureHalfFloatLinear::~OESTextureHalfFloatLinear()
 {
 }
 
-WebGLExtension::ExtensionName OESTextureHalfFloatLinear::getName() const
+WebGLExtension::ExtensionName OESTextureHalfFloatLinear::name() const
 {
     return OESTextureHalfFloatLinearName;
 }
@@ -54,11 +54,11 @@
 
 bool OESTextureHalfFloatLinear::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_texture_half_float_linear");
 }
 
-const char* OESTextureHalfFloatLinear::getExtensionName()
+const char* OESTextureHalfFloatLinear::extensionName()
 {
     return "OES_texture_half_float_linear";
 }
diff --git a/Source/core/html/canvas/OESTextureHalfFloatLinear.h b/Source/core/html/canvas/OESTextureHalfFloatLinear.h
index 0258535..1753203 100644
--- a/Source/core/html/canvas/OESTextureHalfFloatLinear.h
+++ b/Source/core/html/canvas/OESTextureHalfFloatLinear.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<OESTextureHalfFloatLinear> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESTextureHalfFloatLinear();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     OESTextureHalfFloatLinear(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/OESVertexArrayObject.cpp b/Source/core/html/canvas/OESVertexArrayObject.cpp
index 5e59223..5ff1af8 100644
--- a/Source/core/html/canvas/OESVertexArrayObject.cpp
+++ b/Source/core/html/canvas/OESVertexArrayObject.cpp
@@ -38,14 +38,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_OES_vertex_array_object");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_OES_vertex_array_object");
 }
 
 OESVertexArrayObject::~OESVertexArrayObject()
 {
 }
 
-WebGLExtension::ExtensionName OESVertexArrayObject::getName() const
+WebGLExtension::ExtensionName OESVertexArrayObject::name() const
 {
     return OESVertexArrayObjectName;
 }
@@ -84,7 +84,7 @@
     if (!arrayObject->hasEverBeenBound())
         return 0;
 
-    Extensions3D* extensions = m_context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = m_context->graphicsContext3D()->extensions();
     return extensions->isVertexArrayOES(arrayObject->object());
 }
 
@@ -98,7 +98,7 @@
         return;
     }
 
-    Extensions3D* extensions = m_context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = m_context->graphicsContext3D()->extensions();
     if (arrayObject && !arrayObject->isDefaultObject() && arrayObject->object()) {
         extensions->bindVertexArrayOES(arrayObject->object());
 
@@ -112,11 +112,11 @@
 
 bool OESVertexArrayObject::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_OES_vertex_array_object");
 }
 
-const char* OESVertexArrayObject::getExtensionName()
+const char* OESVertexArrayObject::extensionName()
 {
     return "OES_vertex_array_object";
 }
diff --git a/Source/core/html/canvas/OESVertexArrayObject.h b/Source/core/html/canvas/OESVertexArrayObject.h
index 27a79a0..1ac1725 100644
--- a/Source/core/html/canvas/OESVertexArrayObject.h
+++ b/Source/core/html/canvas/OESVertexArrayObject.h
@@ -40,10 +40,10 @@
 public:
     static PassRefPtr<OESVertexArrayObject> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~OESVertexArrayObject();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
     PassRefPtr<WebGLVertexArrayObjectOES> createVertexArrayOES();
     void deleteVertexArrayOES(WebGLVertexArrayObjectOES*);
diff --git a/Source/core/html/canvas/WebGLCompressedTextureATC.cpp b/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
index 9df4b36..601ef85 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTextureATC.cpp
@@ -44,7 +44,7 @@
 {
 }
 
-WebGLExtension::ExtensionName WebGLCompressedTextureATC::getName() const
+WebGLExtension::ExtensionName WebGLCompressedTextureATC::name() const
 {
     return WebGLCompressedTextureATCName;
 }
@@ -56,11 +56,11 @@
 
 bool WebGLCompressedTextureATC::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_AMD_compressed_ATC_texture");
 }
 
-const char* WebGLCompressedTextureATC::getExtensionName()
+const char* WebGLCompressedTextureATC::extensionName()
 {
     return "WEBGL_compressed_texture_atc";
 }
diff --git a/Source/core/html/canvas/WebGLCompressedTextureATC.h b/Source/core/html/canvas/WebGLCompressedTextureATC.h
index 4984696..eb49bc4 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureATC.h
+++ b/Source/core/html/canvas/WebGLCompressedTextureATC.h
@@ -38,10 +38,10 @@
 public:
     static PassRefPtr<WebGLCompressedTextureATC> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLCompressedTextureATC();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     WebGLCompressedTextureATC(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
index db3d0f0..663dcc0 100644
--- a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.cpp
@@ -46,7 +46,7 @@
 {
 }
 
-WebGLExtension::ExtensionName WebGLCompressedTexturePVRTC::getName() const
+WebGLExtension::ExtensionName WebGLCompressedTexturePVRTC::name() const
 {
     return WebGLCompressedTexturePVRTCName;
 }
@@ -58,11 +58,11 @@
 
 bool WebGLCompressedTexturePVRTC::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_IMG_texture_compression_pvrtc");
 }
 
-const char* WebGLCompressedTexturePVRTC::getExtensionName()
+const char* WebGLCompressedTexturePVRTC::extensionName()
 {
     return "WEBGL_compressed_texture_pvrtc";
 }
diff --git a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.h b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.h
index 8e1330b..dc28e5f 100644
--- a/Source/core/html/canvas/WebGLCompressedTexturePVRTC.h
+++ b/Source/core/html/canvas/WebGLCompressedTexturePVRTC.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<WebGLCompressedTexturePVRTC> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLCompressedTexturePVRTC();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     WebGLCompressedTexturePVRTC(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp b/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
index 46689f5..4b63f02 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
+++ b/Source/core/html/canvas/WebGLCompressedTextureS3TC.cpp
@@ -46,7 +46,7 @@
 {
 }
 
-WebGLExtension::ExtensionName WebGLCompressedTextureS3TC::getName() const
+WebGLExtension::ExtensionName WebGLCompressedTextureS3TC::name() const
 {
     return WebGLCompressedTextureS3TCName;
 }
@@ -58,14 +58,14 @@
 
 bool WebGLCompressedTextureS3TC::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_EXT_texture_compression_s3tc")
         || (extensions->supports("GL_EXT_texture_compression_dxt1")
             && extensions->supports("GL_CHROMIUM_texture_compression_dxt3")
             && extensions->supports("GL_CHROMIUM_texture_compression_dxt5"));
 }
 
-const char* WebGLCompressedTextureS3TC::getExtensionName()
+const char* WebGLCompressedTextureS3TC::extensionName()
 {
     return "WEBGL_compressed_texture_s3tc";
 }
diff --git a/Source/core/html/canvas/WebGLCompressedTextureS3TC.h b/Source/core/html/canvas/WebGLCompressedTextureS3TC.h
index 5b8c1d0..615f4f5 100644
--- a/Source/core/html/canvas/WebGLCompressedTextureS3TC.h
+++ b/Source/core/html/canvas/WebGLCompressedTextureS3TC.h
@@ -38,10 +38,10 @@
 public:
     static PassRefPtr<WebGLCompressedTextureS3TC> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLCompressedTextureS3TC();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     WebGLCompressedTextureS3TC(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/WebGLContextEvent.cpp b/Source/core/html/canvas/WebGLContextEvent.cpp
index 9d03537..d8d7cbd 100644
--- a/Source/core/html/canvas/WebGLContextEvent.cpp
+++ b/Source/core/html/canvas/WebGLContextEvent.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "core/html/canvas/WebGLContextEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLContextEvent.h b/Source/core/html/canvas/WebGLContextEvent.h
index c5b0078..18f4a48 100644
--- a/Source/core/html/canvas/WebGLContextEvent.h
+++ b/Source/core/html/canvas/WebGLContextEvent.h
@@ -26,7 +26,7 @@
 #ifndef WebGLContextEvent_h
 #define WebGLContextEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/canvas/WebGLDebugRendererInfo.cpp b/Source/core/html/canvas/WebGLDebugRendererInfo.cpp
index 7786e3f..bca809a 100644
--- a/Source/core/html/canvas/WebGLDebugRendererInfo.cpp
+++ b/Source/core/html/canvas/WebGLDebugRendererInfo.cpp
@@ -39,7 +39,7 @@
 {
 }
 
-WebGLExtension::ExtensionName WebGLDebugRendererInfo::getName() const
+WebGLExtension::ExtensionName WebGLDebugRendererInfo::name() const
 {
     return WebGLDebugRendererInfoName;
 }
@@ -54,7 +54,7 @@
     return true;
 }
 
-const char* WebGLDebugRendererInfo::getExtensionName()
+const char* WebGLDebugRendererInfo::extensionName()
 {
     return "WEBGL_debug_renderer_info";
 }
diff --git a/Source/core/html/canvas/WebGLDebugRendererInfo.h b/Source/core/html/canvas/WebGLDebugRendererInfo.h
index ce8464c..2baa7ab 100644
--- a/Source/core/html/canvas/WebGLDebugRendererInfo.h
+++ b/Source/core/html/canvas/WebGLDebugRendererInfo.h
@@ -41,10 +41,10 @@
 
     static PassRefPtr<WebGLDebugRendererInfo> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLDebugRendererInfo();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     WebGLDebugRendererInfo(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/WebGLDebugShaders.cpp b/Source/core/html/canvas/WebGLDebugShaders.cpp
index 59cb32f..e373c2a 100644
--- a/Source/core/html/canvas/WebGLDebugShaders.cpp
+++ b/Source/core/html/canvas/WebGLDebugShaders.cpp
@@ -43,7 +43,7 @@
 {
 }
 
-WebGLExtension::ExtensionName WebGLDebugShaders::getName() const
+WebGLExtension::ExtensionName WebGLDebugShaders::name() const
 {
     return WebGLDebugShadersName;
 }
@@ -59,16 +59,16 @@
         return String();
     if (!m_context->validateWebGLObject("getTranslatedShaderSource", shader))
         return "";
-    return m_context->graphicsContext3D()->getExtensions()->getTranslatedShaderSourceANGLE(shader->object());
+    return m_context->graphicsContext3D()->extensions()->getTranslatedShaderSourceANGLE(shader->object());
 }
 
 bool WebGLDebugShaders::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return extensions->supports("GL_ANGLE_translated_shader_source");
 }
 
-const char* WebGLDebugShaders::getExtensionName()
+const char* WebGLDebugShaders::extensionName()
 {
     return "WEBGL_debug_shaders";
 }
diff --git a/Source/core/html/canvas/WebGLDebugShaders.h b/Source/core/html/canvas/WebGLDebugShaders.h
index b425c6c..1adbd30 100644
--- a/Source/core/html/canvas/WebGLDebugShaders.h
+++ b/Source/core/html/canvas/WebGLDebugShaders.h
@@ -38,10 +38,10 @@
 public:
     static PassRefPtr<WebGLDebugShaders> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLDebugShaders();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
     String getTranslatedShaderSource(WebGLShader*);
 
diff --git a/Source/core/html/canvas/WebGLDepthTexture.cpp b/Source/core/html/canvas/WebGLDepthTexture.cpp
index 6a450c2..4c873ed 100644
--- a/Source/core/html/canvas/WebGLDepthTexture.cpp
+++ b/Source/core/html/canvas/WebGLDepthTexture.cpp
@@ -35,14 +35,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_CHROMIUM_depth_texture");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_CHROMIUM_depth_texture");
 }
 
 WebGLDepthTexture::~WebGLDepthTexture()
 {
 }
 
-WebGLExtension::ExtensionName WebGLDepthTexture::getName() const
+WebGLExtension::ExtensionName WebGLDepthTexture::name() const
 {
     return WebGLDepthTextureName;
 }
@@ -54,7 +54,7 @@
 
 bool WebGLDepthTexture::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     // Emulating the UNSIGNED_INT_24_8_WEBGL texture internal format in terms
     // of two separate texture objects is too difficult, so disable depth
     // textures unless a packed depth/stencil format is available.
@@ -65,7 +65,7 @@
         || extensions->supports("GL_ARB_depth_texture");
 }
 
-const char* WebGLDepthTexture::getExtensionName()
+const char* WebGLDepthTexture::extensionName()
 {
     return "WEBGL_depth_texture";
 }
diff --git a/Source/core/html/canvas/WebGLDepthTexture.h b/Source/core/html/canvas/WebGLDepthTexture.h
index 75ee15f..34b0525 100644
--- a/Source/core/html/canvas/WebGLDepthTexture.h
+++ b/Source/core/html/canvas/WebGLDepthTexture.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<WebGLDepthTexture> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLDepthTexture();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
 private:
     WebGLDepthTexture(WebGLRenderingContext*);
diff --git a/Source/core/html/canvas/WebGLDrawBuffers.cpp b/Source/core/html/canvas/WebGLDrawBuffers.cpp
index 1d779d6..756476b 100644
--- a/Source/core/html/canvas/WebGLDrawBuffers.cpp
+++ b/Source/core/html/canvas/WebGLDrawBuffers.cpp
@@ -35,14 +35,14 @@
     : WebGLExtension(context)
 {
     ScriptWrappable::init(this);
-    context->graphicsContext3D()->getExtensions()->ensureEnabled("GL_EXT_draw_buffers");
+    context->graphicsContext3D()->extensions()->ensureEnabled("GL_EXT_draw_buffers");
 }
 
 WebGLDrawBuffers::~WebGLDrawBuffers()
 {
 }
 
-WebGLExtension::ExtensionName WebGLDrawBuffers::getName() const
+WebGLExtension::ExtensionName WebGLDrawBuffers::name() const
 {
     return WebGLExtension::WebGLDrawBuffersName;
 }
@@ -55,12 +55,12 @@
 // static
 bool WebGLDrawBuffers::supported(WebGLRenderingContext* context)
 {
-    Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context->graphicsContext3D()->extensions();
     return (extensions->supports("GL_EXT_draw_buffers")
         && satisfiesWebGLRequirements(context));
 }
 
-const char* WebGLDrawBuffers::getExtensionName()
+const char* WebGLDrawBuffers::extensionName()
 {
     return "WEBGL_draw_buffers";
 }
@@ -82,10 +82,10 @@
         }
         // Because the backbuffer is simulated on all current WebKit ports, we need to change BACK to COLOR_ATTACHMENT0.
         GC3Denum value = (bufs[0] == GraphicsContext3D::BACK) ? GraphicsContext3D::COLOR_ATTACHMENT0 : GraphicsContext3D::NONE;
-        m_context->graphicsContext3D()->getExtensions()->drawBuffersEXT(1, &value);
+        m_context->graphicsContext3D()->extensions()->drawBuffersEXT(1, &value);
         m_context->setBackDrawBuffer(bufs[0]);
     } else {
-        if (n > m_context->getMaxDrawBuffers()) {
+        if (n > m_context->maxDrawBuffers()) {
             m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "drawBuffersWEBGL", "more than max draw buffers");
             return;
         }
@@ -116,11 +116,11 @@
     context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, fbo);
 
     const unsigned char* buffer = 0; // Chromium doesn't allow init data for depth/stencil tetxures.
-    bool supportsDepth = (context->getExtensions()->supports("GL_CHROMIUM_depth_texture")
-        || context->getExtensions()->supports("GL_OES_depth_texture")
-        || context->getExtensions()->supports("GL_ARB_depth_texture"));
-    bool supportsDepthStencil = (context->getExtensions()->supports("GL_EXT_packed_depth_stencil")
-        || context->getExtensions()->supports("GL_OES_packed_depth_stencil"));
+    bool supportsDepth = (context->extensions()->supports("GL_CHROMIUM_depth_texture")
+        || context->extensions()->supports("GL_OES_depth_texture")
+        || context->extensions()->supports("GL_ARB_depth_texture"));
+    bool supportsDepthStencil = (context->extensions()->supports("GL_EXT_packed_depth_stencil")
+        || context->extensions()->supports("GL_OES_packed_depth_stencil"));
     Platform3DObject depthStencil = 0;
     if (supportsDepthStencil) {
         depthStencil = context->createTexture();
diff --git a/Source/core/html/canvas/WebGLDrawBuffers.h b/Source/core/html/canvas/WebGLDrawBuffers.h
index b002f22..58e14f1 100644
--- a/Source/core/html/canvas/WebGLDrawBuffers.h
+++ b/Source/core/html/canvas/WebGLDrawBuffers.h
@@ -36,10 +36,10 @@
 public:
     static PassRefPtr<WebGLDrawBuffers> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLDrawBuffers();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
 
     void drawBuffersWEBGL(const Vector<GC3Denum>& buffers);
 
diff --git a/Source/core/html/canvas/WebGLExtension.h b/Source/core/html/canvas/WebGLExtension.h
index 4028906..1bd4c8b 100644
--- a/Source/core/html/canvas/WebGLExtension.h
+++ b/Source/core/html/canvas/WebGLExtension.h
@@ -59,7 +59,7 @@
     WebGLRenderingContext* context() { return m_context; }
 
     virtual ~WebGLExtension();
-    virtual ExtensionName getName() const = 0;
+    virtual ExtensionName name() const = 0;
 
     // Lose this extension. Passing true = force loss. Some extensions
     // like WEBGL_lose_context are not normally lost when the context
diff --git a/Source/core/html/canvas/WebGLFramebuffer.cpp b/Source/core/html/canvas/WebGLFramebuffer.cpp
index d73eeac..41f7d82 100644
--- a/Source/core/html/canvas/WebGLFramebuffer.cpp
+++ b/Source/core/html/canvas/WebGLFramebuffer.cpp
@@ -386,7 +386,7 @@
         }
     } else if (attachment == GraphicsContext3D::COLOR_ATTACHMENT0
         || (context()->m_webglDrawBuffers && attachment > GraphicsContext3D::COLOR_ATTACHMENT0
-            && attachment < static_cast<GC3Denum>(GraphicsContext3D::COLOR_ATTACHMENT0 + context()->getMaxColorAttachments()))) {
+            && attachment < static_cast<GC3Denum>(GraphicsContext3D::COLOR_ATTACHMENT0 + context()->maxColorAttachments()))) {
         if (object->isRenderbuffer()) {
             if (!isColorRenderable(internalformat)) {
                 *reason = "the internalformat of the attached renderbuffer is not color-renderable";
@@ -626,7 +626,7 @@
         }
     }
     if (reset) {
-        context()->graphicsContext3D()->getExtensions()->drawBuffersEXT(
+        context()->graphicsContext3D()->extensions()->drawBuffersEXT(
             m_filteredDrawBuffers.size(), m_filteredDrawBuffers.data());
     }
 }
diff --git a/Source/core/html/canvas/WebGLLoseContext.cpp b/Source/core/html/canvas/WebGLLoseContext.cpp
index 5238316..ca1226a 100644
--- a/Source/core/html/canvas/WebGLLoseContext.cpp
+++ b/Source/core/html/canvas/WebGLLoseContext.cpp
@@ -47,7 +47,7 @@
         WebGLExtension::lose(true);
 }
 
-WebGLExtension::ExtensionName WebGLLoseContext::getName() const
+WebGLExtension::ExtensionName WebGLLoseContext::name() const
 {
     return WebGLLoseContextName;
 }
@@ -74,7 +74,7 @@
     return true;
 }
 
-const char* WebGLLoseContext::getExtensionName()
+const char* WebGLLoseContext::extensionName()
 {
     return "WEBGL_lose_context";
 }
diff --git a/Source/core/html/canvas/WebGLLoseContext.h b/Source/core/html/canvas/WebGLLoseContext.h
index aa0c593..23140d6 100644
--- a/Source/core/html/canvas/WebGLLoseContext.h
+++ b/Source/core/html/canvas/WebGLLoseContext.h
@@ -38,10 +38,10 @@
 public:
     static PassRefPtr<WebGLLoseContext> create(WebGLRenderingContext*);
     static bool supported(WebGLRenderingContext*);
-    static const char* getExtensionName();
+    static const char* extensionName();
 
     virtual ~WebGLLoseContext();
-    virtual ExtensionName getName() const;
+    virtual ExtensionName name() const;
     virtual void lose(bool);
 
     void loseContext();
diff --git a/Source/core/html/canvas/WebGLRenderingContext.cpp b/Source/core/html/canvas/WebGLRenderingContext.cpp
index 6ae694c..715e1d8 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/core/html/canvas/WebGLRenderingContext.cpp
@@ -162,7 +162,7 @@
 void WebGLRenderingContext::deactivateContext(WebGLRenderingContext* context, bool addToEvictedList)
 {
     size_t position = activeContexts().find(context);
-    if (position != WTF::notFound)
+    if (position != WTF::kNotFound)
         activeContexts().remove(position);
 
     if (addToEvictedList && !forciblyEvictedContexts().contains(context))
@@ -172,7 +172,7 @@
 void WebGLRenderingContext::willDestroyContext(WebGLRenderingContext* context)
 {
     size_t position = forciblyEvictedContexts().find(context);
-    if (position != WTF::notFound)
+    if (position != WTF::kNotFound)
         forciblyEvictedContexts().remove(position);
 
     deactivateContext(context, false);
@@ -544,7 +544,7 @@
         return nullptr;
     }
 
-    Extensions3D* extensions = context->getExtensions();
+    Extensions3D* extensions = context->extensions();
     if (extensions->supports("GL_EXT_debug_marker"))
         extensions->pushGroupMarkerEXT("WebGLRenderingContext");
 
@@ -717,8 +717,8 @@
         }
     }
 
-    m_isGLES2NPOTStrict = !m_context->getExtensions()->isEnabled("GL_OES_texture_npot");
-    m_isDepthStencilSupported = m_context->getExtensions()->isEnabled("GL_OES_packed_depth_stencil");
+    m_isGLES2NPOTStrict = !m_context->extensions()->isEnabled("GL_OES_texture_npot");
+    m_isDepthStencilSupported = m_context->extensions()->isEnabled("GL_OES_packed_depth_stencil");
 }
 
 bool WebGLRenderingContext::allowPrivilegedExtensions() const
@@ -1478,7 +1478,7 @@
     WebGLTexture* tex = validateTextureBinding("copyTexImage2D", target, true);
     if (!tex)
         return;
-    if (!isTexInternalFormatColorBufferCombinationValid(internalformat, getBoundFramebufferColorFormat())) {
+    if (!isTexInternalFormatColorBufferCombinationValid(internalformat, boundFramebufferColorFormat())) {
         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "copyTexImage2D", "framebuffer is incompatible format");
         return;
     }
@@ -1521,7 +1521,7 @@
     GC3Denum internalformat = tex->getInternalFormat(target, level);
     if (!validateSettableTexFormat("copyTexSubImage2D", internalformat))
         return;
-    if (!isTexInternalFormatColorBufferCombinationValid(internalformat, getBoundFramebufferColorFormat())) {
+    if (!isTexInternalFormatColorBufferCombinationValid(internalformat, boundFramebufferColorFormat())) {
         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "copyTexSubImage2D", "framebuffer is incompatible format");
         return;
     }
@@ -1850,7 +1850,7 @@
     clearIfComposited();
 
     handleTextureCompleteness("drawArraysInstancedANGLE", true);
-    m_context->getExtensions()->drawArraysInstancedANGLE(mode, first, count, primcount);
+    m_context->extensions()->drawArraysInstancedANGLE(mode, first, count, primcount);
     handleTextureCompleteness("drawArraysInstancedANGLE", false);
     markContextChanged();
 }
@@ -1866,7 +1866,7 @@
     clearIfComposited();
 
     handleTextureCompleteness("drawElementsInstancedANGLE", true);
-    m_context->getExtensions()->drawElementsInstancedANGLE(mode, count, type, static_cast<GC3Dintptr>(offset), primcount);
+    m_context->extensions()->drawElementsInstancedANGLE(mode, count, type, static_cast<GC3Dintptr>(offset), primcount);
     handleTextureCompleteness("drawElementsInstancedANGLE", false);
     markContextChanged();
 }
@@ -2161,7 +2161,7 @@
 
     const char** prefixes = m_prefixes ? m_prefixes : unprefixed;
     for (; *prefixes; ++prefixes) {
-        String prefixedName = String(*prefixes) + getExtensionName();
+        String prefixedName = String(*prefixes) + extensionName();
         if (equalIgnoringCase(prefixedName, name)) {
             return true;
         }
@@ -2177,9 +2177,9 @@
     for (size_t i = 0; i < m_extensions.size(); ++i) {
         ExtensionTracker* tracker = m_extensions[i];
         if (tracker->matchesNameWithPrefixes(name)) {
-            if (tracker->getPrivileged() && !allowPrivilegedExtensions())
+            if (tracker->privileged() && !allowPrivilegedExtensions())
                 return 0;
-            if (tracker->getDraft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled())
+            if (tracker->draft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled())
                 return 0;
             if (!tracker->supported(this))
                 return 0;
@@ -2304,7 +2304,7 @@
     case GraphicsContext3D::DITHER:
         return getBooleanParameter(pname);
     case GraphicsContext3D::ELEMENT_ARRAY_BUFFER_BINDING:
-        return WebGLGetInfo(PassRefPtr<WebGLBuffer>(m_boundVertexArrayObject->getElementArrayBuffer()));
+        return WebGLGetInfo(PassRefPtr<WebGLBuffer>(m_boundVertexArrayObject->boundElementArrayBuffer()));
     case GraphicsContext3D::FRAMEBUFFER_BINDING:
         return WebGLGetInfo(PassRefPtr<WebGLFramebuffer>(m_framebufferBinding));
     case GraphicsContext3D::FRONT_FACE:
@@ -2454,18 +2454,18 @@
         return WebGLGetInfo();
     case Extensions3D::MAX_COLOR_ATTACHMENTS_EXT: // EXT_draw_buffers BEGIN
         if (m_webglDrawBuffers)
-            return WebGLGetInfo(getMaxColorAttachments());
+            return WebGLGetInfo(maxColorAttachments());
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_draw_buffers not enabled");
         return WebGLGetInfo();
     case Extensions3D::MAX_DRAW_BUFFERS_EXT:
         if (m_webglDrawBuffers)
-            return WebGLGetInfo(getMaxDrawBuffers());
+            return WebGLGetInfo(maxDrawBuffers());
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getParameter", "invalid parameter name, WEBGL_draw_buffers not enabled");
         return WebGLGetInfo();
     default:
         if (m_webglDrawBuffers
             && pname >= Extensions3D::DRAW_BUFFER0_EXT
-            && pname < static_cast<GC3Denum>(Extensions3D::DRAW_BUFFER0_EXT + getMaxDrawBuffers())) {
+            && pname < static_cast<GC3Denum>(Extensions3D::DRAW_BUFFER0_EXT + maxDrawBuffers())) {
             GC3Dint value = GraphicsContext3D::NONE;
             if (m_framebufferBinding)
                 value = m_framebufferBinding->getDrawBuffer(pname);
@@ -2630,12 +2630,12 @@
 
     for (size_t i = 0; i < m_extensions.size(); ++i) {
         ExtensionTracker* tracker = m_extensions[i];
-        if (tracker->getPrivileged() && !allowPrivilegedExtensions())
+        if (tracker->privileged() && !allowPrivilegedExtensions())
             continue;
-        if (tracker->getDraft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled())
+        if (tracker->draft() && !RuntimeEnabledFeatures::webGLDraftExtensionsEnabled())
             continue;
         if (tracker->supported(this))
-            result.append(String(tracker->getPrefixed()  ? "WEBKIT_" : "") + tracker->getExtensionName());
+            result.append(String(tracker->prefixed()  ? "WEBKIT_" : "") + tracker->extensionName());
     }
 
     return result;
@@ -4099,7 +4099,7 @@
     }
 
     m_boundVertexArrayObject->setVertexAttribDivisor(index, divisor);
-    m_context->getExtensions()->vertexAttribDivisorANGLE(index, divisor);
+    m_context->extensions()->vertexAttribDivisorANGLE(index, divisor);
 }
 
 void WebGLRenderingContext::viewport(GC3Dint x, GC3Dint y, GC3Dsizei width, GC3Dsizei height)
@@ -4133,7 +4133,7 @@
         // Inform the embedder that a lost context was received. In response, the embedder might
         // decide to take action such as asking the user for permission to use WebGL again.
         if (Frame* frame = canvas()->document().frame())
-            frame->loader()->client()->didLoseWebGLContext(m_context->getExtensions()->getGraphicsResetStatusARB());
+            frame->loader()->client()->didLoseWebGLContext(m_context->extensions()->getGraphicsResetStatusARB());
     }
 
     // Make absolutely sure we do not refer to an already-deleted texture or framebuffer.
@@ -4392,7 +4392,7 @@
     return (need & have) == need;
 }
 
-GC3Denum WebGLRenderingContext::getBoundFramebufferColorFormat()
+GC3Denum WebGLRenderingContext::boundFramebufferColorFormat()
 {
     if (m_framebufferBinding && m_framebufferBinding->object())
         return m_framebufferBinding->colorBufferFormat();
@@ -4401,14 +4401,14 @@
     return GraphicsContext3D::RGB;
 }
 
-int WebGLRenderingContext::getBoundFramebufferWidth()
+int WebGLRenderingContext::boundFramebufferWidth()
 {
     if (m_framebufferBinding && m_framebufferBinding->object())
         return m_framebufferBinding->colorBufferWidth();
     return m_drawingBuffer->size().width();
 }
 
-int WebGLRenderingContext::getBoundFramebufferHeight()
+int WebGLRenderingContext::boundFramebufferHeight()
 {
     if (m_framebufferBinding && m_framebufferBinding->object())
         return m_framebufferBinding->colorBufferHeight();
@@ -4977,7 +4977,7 @@
     default:
         if (m_webglDrawBuffers
             && attachment > GraphicsContext3D::COLOR_ATTACHMENT0
-            && attachment < static_cast<GC3Denum>(GraphicsContext3D::COLOR_ATTACHMENT0 + getMaxColorAttachments()))
+            && attachment < static_cast<GC3Denum>(GraphicsContext3D::COLOR_ATTACHMENT0 + maxColorAttachments()))
             break;
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, functionName, "invalid attachment");
         return false;
@@ -5089,7 +5089,7 @@
     WebGLBuffer* buffer = 0;
     switch (target) {
     case GraphicsContext3D::ELEMENT_ARRAY_BUFFER:
-        buffer = m_boundVertexArrayObject->getElementArrayBuffer().get();
+        buffer = m_boundVertexArrayObject->boundElementArrayBuffer().get();
         break;
     case GraphicsContext3D::ARRAY_BUFFER:
         buffer = m_boundArrayBuffer.get();
@@ -5220,7 +5220,7 @@
         return false;
     }
 
-    if (!m_boundVertexArrayObject->getElementArrayBuffer()) {
+    if (!m_boundVertexArrayObject->boundElementArrayBuffer()) {
         synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "no ELEMENT_ARRAY_BUFFER bound");
         return false;
     }
@@ -5481,7 +5481,7 @@
     if (!isContextLost())
         m_context->synthesizeGLError(error);
     else {
-        if (lost_context_errors_.find(error) == WTF::notFound)
+        if (lost_context_errors_.find(error) == WTF::kNotFound)
             lost_context_errors_.append(error);
     }
     InspectorInstrumentation::didFireWebGLError(canvas(), errorType);
@@ -5526,7 +5526,7 @@
                    clamp(canvas()->height(), 1, m_maxViewportDims[1]));
 }
 
-GC3Dint WebGLRenderingContext::getMaxDrawBuffers()
+GC3Dint WebGLRenderingContext::maxDrawBuffers()
 {
     if (isContextLost() || !m_webglDrawBuffers)
         return 0;
@@ -5538,7 +5538,7 @@
     return std::min(m_maxDrawBuffers, m_maxColorAttachments);
 }
 
-GC3Dint WebGLRenderingContext::getMaxColorAttachments()
+GC3Dint WebGLRenderingContext::maxColorAttachments()
 {
     if (isContextLost() || !m_webglDrawBuffers)
         return 0;
diff --git a/Source/core/html/canvas/WebGLRenderingContext.h b/Source/core/html/canvas/WebGLRenderingContext.h
index 1d5fb82..ab2cd65 100644
--- a/Source/core/html/canvas/WebGLRenderingContext.h
+++ b/Source/core/html/canvas/WebGLRenderingContext.h
@@ -326,7 +326,7 @@
     void removeSharedObject(WebGLSharedObject*);
     void removeContextObject(WebGLContextObject*);
 
-    unsigned getMaxVertexAttribs() const { return m_maxVertexAttribs; }
+    unsigned maxVertexAttribs() const { return m_maxVertexAttribs; }
 
     // ActiveDOMObject notifications
     virtual bool hasPendingActivity() const;
@@ -553,17 +553,17 @@
         {
         }
 
-        bool getPrefixed() const
+        bool prefixed() const
         {
             return m_prefixed;
         }
 
-        bool getPrivileged() const
+        bool privileged() const
         {
             return m_privileged;
         }
 
-        bool getDraft() const
+        bool draft() const
         {
             return m_draft;
         }
@@ -572,7 +572,7 @@
 
         virtual PassRefPtr<WebGLExtension> getExtension(WebGLRenderingContext*) const = 0;
         virtual bool supported(WebGLRenderingContext*) const = 0;
-        virtual const char* getExtensionName() const = 0;
+        virtual const char* extensionName() const = 0;
         virtual void loseExtension() = 0;
 
     private:
@@ -612,9 +612,9 @@
             return T::supported(context);
         }
 
-        virtual const char* getExtensionName() const
+        virtual const char* extensionName() const
         {
-            return T::getExtensionName();
+            return T::extensionName();
         }
 
         virtual void loseExtension()
@@ -673,13 +673,13 @@
                                                         GC3Denum colorBufferFormat);
 
     // Helper function to get the bound framebuffer's color buffer format.
-    GC3Denum getBoundFramebufferColorFormat();
+    GC3Denum boundFramebufferColorFormat();
 
     // Helper function to get the bound framebuffer's width.
-    int getBoundFramebufferWidth();
+    int boundFramebufferWidth();
 
     // Helper function to get the bound framebuffer's height.
-    int getBoundFramebufferHeight();
+    int boundFramebufferHeight();
 
     // Helper function to verify limits on the length of uniform and attribute locations.
     bool validateLocationLength(const char* functionName, const String&);
@@ -882,8 +882,8 @@
 
     // First time called, if EXT_draw_buffers is supported, query the value; otherwise return 0.
     // Later, return the cached value.
-    GC3Dint getMaxDrawBuffers();
-    GC3Dint getMaxColorAttachments();
+    GC3Dint maxDrawBuffers();
+    GC3Dint maxColorAttachments();
 
     void setBackDrawBuffer(GC3Denum);
 
diff --git a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp b/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
index ab2311a..44dff92 100644
--- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
+++ b/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp
@@ -44,9 +44,9 @@
     , m_boundElementArrayBuffer(0)
 {
     ScriptWrappable::init(this);
-    m_vertexAttribState.resize(ctx->getMaxVertexAttribs());
+    m_vertexAttribState.resize(ctx->maxVertexAttribs());
 
-    Extensions3D* extensions = context()->graphicsContext3D()->getExtensions();
+    Extensions3D* extensions = context()->graphicsContext3D()->extensions();
     switch (m_type) {
     case VaoTypeDefault:
         break;
@@ -63,7 +63,7 @@
 
 void WebGLVertexArrayObjectOES::deleteObjectImpl(GraphicsContext3D* context3d, Platform3DObject object)
 {
-    Extensions3D* extensions = context3d->getExtensions();
+    Extensions3D* extensions = context3d->extensions();
     switch (m_type) {
     case VaoTypeDefault:
         break;
diff --git a/Source/core/html/canvas/WebGLVertexArrayObjectOES.h b/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
index c7fd466..2d7fe01 100644
--- a/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
+++ b/Source/core/html/canvas/WebGLVertexArrayObjectOES.h
@@ -76,7 +76,7 @@
     bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
     void setHasEverBeenBound() { m_hasEverBeenBound = true; }
 
-    PassRefPtr<WebGLBuffer> getElementArrayBuffer() const { return m_boundElementArrayBuffer; }
+    PassRefPtr<WebGLBuffer> boundElementArrayBuffer() const { return m_boundElementArrayBuffer; }
     void setElementArrayBuffer(PassRefPtr<WebGLBuffer>);
 
     VertexAttribState& getVertexAttribState(int index) { return m_vertexAttribState[index]; }
diff --git a/Source/core/html/BaseButtonInputType.cpp b/Source/core/html/forms/BaseButtonInputType.cpp
similarity index 98%
rename from Source/core/html/BaseButtonInputType.cpp
rename to Source/core/html/forms/BaseButtonInputType.cpp
index e0e07d4..3ea90b5 100644
--- a/Source/core/html/BaseButtonInputType.cpp
+++ b/Source/core/html/forms/BaseButtonInputType.cpp
@@ -30,7 +30,7 @@
  */
 
 #include "config.h"
-#include "core/html/BaseButtonInputType.h"
+#include "core/html/forms/BaseButtonInputType.h"
 
 #include "HTMLNames.h"
 #include "core/dom/Text.h"
diff --git a/Source/core/html/BaseButtonInputType.h b/Source/core/html/forms/BaseButtonInputType.h
similarity index 97%
rename from Source/core/html/BaseButtonInputType.h
rename to Source/core/html/forms/BaseButtonInputType.h
index e006445..ee5cbf2 100644
--- a/Source/core/html/BaseButtonInputType.h
+++ b/Source/core/html/forms/BaseButtonInputType.h
@@ -31,7 +31,7 @@
 #ifndef BaseButtonInputType_h
 #define BaseButtonInputType_h
 
-#include "core/html/BaseClickableWithKeyInputType.h"
+#include "core/html/forms/BaseClickableWithKeyInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/BaseCheckableInputType.cpp b/Source/core/html/forms/BaseCheckableInputType.cpp
similarity index 96%
rename from Source/core/html/BaseCheckableInputType.cpp
rename to Source/core/html/forms/BaseCheckableInputType.cpp
index 6867bd2..70abbd3 100644
--- a/Source/core/html/BaseCheckableInputType.cpp
+++ b/Source/core/html/forms/BaseCheckableInputType.cpp
@@ -30,13 +30,13 @@
  */
 
 #include "config.h"
-#include "core/html/BaseCheckableInputType.h"
+#include "core/html/forms/BaseCheckableInputType.h"
 
 #include "HTMLNames.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/html/FormController.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLInputElement.h"
+#include "core/html/forms/FormController.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/BaseCheckableInputType.h b/Source/core/html/forms/BaseCheckableInputType.h
similarity index 98%
rename from Source/core/html/BaseCheckableInputType.h
rename to Source/core/html/forms/BaseCheckableInputType.h
index 429bd71..c4453ad 100644
--- a/Source/core/html/BaseCheckableInputType.h
+++ b/Source/core/html/forms/BaseCheckableInputType.h
@@ -31,7 +31,7 @@
 #ifndef BaseCheckableInputType_h
 #define BaseCheckableInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
similarity index 98%
rename from Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp
rename to Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
index d97ebb7..431d632 100644
--- a/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp
@@ -25,7 +25,7 @@
 
 #include "config.h"
 #if !ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptController.h"
diff --git a/Source/core/html/BaseChooserOnlyDateAndTimeInputType.h b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h
similarity index 95%
rename from Source/core/html/BaseChooserOnlyDateAndTimeInputType.h
rename to Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h
index 245db8a..001276f 100644
--- a/Source/core/html/BaseChooserOnlyDateAndTimeInputType.h
+++ b/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.h
@@ -27,8 +27,8 @@
 #define BaseChooserOnlyDateAndTimeInputType_h
 
 #if !ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/BaseClickableWithKeyInputType.h"
-#include "core/html/BaseDateAndTimeInputType.h"
+#include "core/html/forms/BaseClickableWithKeyInputType.h"
+#include "core/html/forms/BaseDateAndTimeInputType.h"
 #include "core/platform/DateTimeChooser.h"
 #include "core/platform/DateTimeChooserClient.h"
 
diff --git a/Source/core/html/BaseClickableWithKeyInputType.cpp b/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
similarity index 97%
rename from Source/core/html/BaseClickableWithKeyInputType.cpp
rename to Source/core/html/forms/BaseClickableWithKeyInputType.cpp
index 063f2f9..0ab16ad 100644
--- a/Source/core/html/BaseClickableWithKeyInputType.cpp
+++ b/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
@@ -30,9 +30,9 @@
  */
 
 #include "config.h"
-#include "core/html/BaseClickableWithKeyInputType.h"
+#include "core/html/forms/BaseClickableWithKeyInputType.h"
 
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/html/HTMLInputElement.h"
 
 namespace WebCore {
diff --git a/Source/core/html/BaseClickableWithKeyInputType.h b/Source/core/html/forms/BaseClickableWithKeyInputType.h
similarity index 98%
rename from Source/core/html/BaseClickableWithKeyInputType.h
rename to Source/core/html/forms/BaseClickableWithKeyInputType.h
index 918fdae..23b2a2e 100644
--- a/Source/core/html/BaseClickableWithKeyInputType.h
+++ b/Source/core/html/forms/BaseClickableWithKeyInputType.h
@@ -31,7 +31,7 @@
 #ifndef BaseClickableWithKeyInputType_h
 #define BaseClickableWithKeyInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/BaseDateAndTimeInputType.cpp b/Source/core/html/forms/BaseDateAndTimeInputType.cpp
similarity index 91%
rename from Source/core/html/BaseDateAndTimeInputType.cpp
rename to Source/core/html/forms/BaseDateAndTimeInputType.cpp
index 71207df..cd30e72 100644
--- a/Source/core/html/BaseDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseDateAndTimeInputType.cpp
@@ -29,18 +29,19 @@
  */
 
 #include "config.h"
-#include "core/html/BaseDateAndTimeInputType.h"
+#include "core/html/forms/BaseDateAndTimeInputType.h"
 
-#include <limits>
 #include "core/html/HTMLInputElement.h"
 #include "core/platform/text/PlatformLocale.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/DateMath.h"
 #include "wtf/MathExtras.h"
 #include "wtf/text/WTFString.h"
+#include <limits>
 
 namespace WebCore {
 
+using WebKit::WebLocalizedString;
 using namespace HTMLNames;
 using namespace std;
 
@@ -78,6 +79,16 @@
     return typeMismatchFor(element()->value());
 }
 
+String BaseDateAndTimeInputType::rangeOverflowText(const Decimal& maximum) const
+{
+    return locale().queryString(WebLocalizedString::ValidationRangeOverflowDateTime, localizeValue(serialize(maximum)));
+}
+
+String BaseDateAndTimeInputType::rangeUnderflowText(const Decimal& minimum) const
+{
+    return locale().queryString(WebLocalizedString::ValidationRangeUnderflowDateTime, localizeValue(serialize(minimum)));
+}
+
 Decimal BaseDateAndTimeInputType::defaultValueForStepUp() const
 {
     double ms = currentTimeMS();
diff --git a/Source/core/html/BaseDateAndTimeInputType.h b/Source/core/html/forms/BaseDateAndTimeInputType.h
similarity index 94%
rename from Source/core/html/BaseDateAndTimeInputType.h
rename to Source/core/html/forms/BaseDateAndTimeInputType.h
index 25e90c0..5e076e9 100644
--- a/Source/core/html/BaseDateAndTimeInputType.h
+++ b/Source/core/html/forms/BaseDateAndTimeInputType.h
@@ -31,7 +31,7 @@
 #ifndef BaseDateAndTimeInputType_h
 #define BaseDateAndTimeInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 #include "core/platform/DateComponents.h"
 
 namespace WebCore {
@@ -60,6 +60,8 @@
     virtual bool typeMismatchFor(const String&) const OVERRIDE;
     virtual bool typeMismatch() const OVERRIDE;
     virtual bool valueMissing(const String&) const OVERRIDE;
+    virtual String rangeOverflowText(const Decimal& maximum) const OVERRIDE;
+    virtual String rangeUnderflowText(const Decimal& minimum) const OVERRIDE;
     virtual Decimal defaultValueForStepUp() const OVERRIDE;
     virtual bool isSteppable() const OVERRIDE;
     virtual String serializeWithMilliseconds(double) const;
diff --git a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
similarity index 98%
rename from Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
rename to Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
index 3d8f21e..99bc8f3 100644
--- a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp
@@ -30,17 +30,17 @@
 
 #include "config.h"
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 #include "CSSValueKeywords.h"
 #include "RuntimeEnabledFeatures.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
-#include "core/html/DateTimeFieldsState.h"
-#include "core/html/FormController.h"
 #include "core/html/HTMLDataListElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLOptionElement.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/FormController.h"
 #include "core/html/shadow/PickerIndicatorElement.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/FocusController.h"
@@ -183,9 +183,9 @@
     String oldValue = input->value();
     String newValue = sanitizeValue(dateTimeEditElement()->value());
     // Even if oldValue is null and newValue is "", we should assume they are same.
-    if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue)
+    if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue) {
         input->setNeedsValidityCheck();
-    else {
+    } else {
         input->setValueInternal(newValue, DispatchNoEvent);
         input->setNeedsStyleRecalc();
         input->dispatchFormControlInputEvent();
@@ -290,7 +290,7 @@
 
 String BaseMultipleFieldsDateAndTimeInputType::badInputText() const
 {
-    return validationMessageBadInputForDateTimeText();
+    return locale().queryString(WebKit::WebLocalizedString::ValidationBadInputForDateTime);
 }
 
 void BaseMultipleFieldsDateAndTimeInputType::blur()
@@ -381,8 +381,9 @@
             element()->document().page()->focusController().advanceFocus(direction);
     } else if (direction == FocusDirectionNone || direction == FocusDirectionMouse || direction == FocusDirectionPage) {
         edit->focusByOwner(oldFocusedElement);
-    } else
+    } else {
         edit->focusByOwner();
+    }
 }
 
 void BaseMultipleFieldsDateAndTimeInputType::forwardEvent(Event* event)
@@ -418,8 +419,9 @@
         if (PickerIndicatorElement* element = pickerIndicatorElement())
             element->openPopup();
         event->setDefaultHandled();
-    } else
+    } else {
         forwardEvent(event);
+    }
 }
 
 bool BaseMultipleFieldsDateAndTimeInputType::hasBadInput() const
diff --git a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.h b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
similarity index 98%
rename from Source/core/html/BaseMultipleFieldsDateAndTimeInputType.h
rename to Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
index 0f990e6..518ff72 100644
--- a/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.h
+++ b/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h
@@ -32,7 +32,7 @@
 #define BaseMultipleFieldsDateAndTimeInputType_h
 
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/BaseDateAndTimeInputType.h"
+#include "core/html/forms/BaseDateAndTimeInputType.h"
 
 #include "core/html/shadow/ClearButtonElement.h"
 #include "core/html/shadow/DateTimeEditElement.h"
diff --git a/Source/core/html/BaseTextInputType.cpp b/Source/core/html/forms/BaseTextInputType.cpp
similarity index 97%
rename from Source/core/html/BaseTextInputType.cpp
rename to Source/core/html/forms/BaseTextInputType.cpp
index f51a7bd..54c0e74 100644
--- a/Source/core/html/BaseTextInputType.cpp
+++ b/Source/core/html/forms/BaseTextInputType.cpp
@@ -22,7 +22,7 @@
  */
 
 #include "config.h"
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 
 #include "HTMLNames.h"
 #include "core/html/HTMLInputElement.h"
diff --git a/Source/core/html/BaseTextInputType.h b/Source/core/html/forms/BaseTextInputType.h
similarity index 97%
rename from Source/core/html/BaseTextInputType.h
rename to Source/core/html/forms/BaseTextInputType.h
index 6d1737b..05e2cd5 100644
--- a/Source/core/html/BaseTextInputType.h
+++ b/Source/core/html/forms/BaseTextInputType.h
@@ -31,7 +31,7 @@
 #ifndef BaseTextInputType_h
 #define BaseTextInputType_h
 
-#include "core/html/TextFieldInputType.h"
+#include "core/html/forms/TextFieldInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/ButtonInputType.cpp b/Source/core/html/forms/ButtonInputType.cpp
similarity index 95%
rename from Source/core/html/ButtonInputType.cpp
rename to Source/core/html/forms/ButtonInputType.cpp
index aae493a..6b6d0c7 100644
--- a/Source/core/html/ButtonInputType.cpp
+++ b/Source/core/html/forms/ButtonInputType.cpp
@@ -29,9 +29,9 @@
  */
 
 #include "config.h"
-#include "core/html/ButtonInputType.h"
+#include "core/html/forms/ButtonInputType.h"
 
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/ButtonInputType.h b/Source/core/html/forms/ButtonInputType.h
similarity index 97%
rename from Source/core/html/ButtonInputType.h
rename to Source/core/html/forms/ButtonInputType.h
index a50f6cf..8511b88 100644
--- a/Source/core/html/ButtonInputType.h
+++ b/Source/core/html/forms/ButtonInputType.h
@@ -31,7 +31,7 @@
 #ifndef ButtonInputType_h
 #define ButtonInputType_h
 
-#include "core/html/BaseButtonInputType.h"
+#include "core/html/forms/BaseButtonInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/CheckboxInputType.cpp b/Source/core/html/forms/CheckboxInputType.cpp
similarity index 92%
rename from Source/core/html/CheckboxInputType.cpp
rename to Source/core/html/forms/CheckboxInputType.cpp
index 29ff575..83d653d 100644
--- a/Source/core/html/CheckboxInputType.cpp
+++ b/Source/core/html/forms/CheckboxInputType.cpp
@@ -30,12 +30,12 @@
  */
 
 #include "config.h"
-#include "core/html/CheckboxInputType.h"
+#include "core/html/forms/CheckboxInputType.h"
 
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
-#include "core/platform/LocalizedStrings.h"
+#include "core/html/forms/InputTypeNames.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
@@ -57,7 +57,7 @@
 
 String CheckboxInputType::valueMissingText() const
 {
-    return validationMessageValueMissingForCheckboxText();
+    return locale().queryString(WebKit::WebLocalizedString::ValidationValueMissingForCheckbox);
 }
 
 void CheckboxInputType::handleKeyupEvent(KeyboardEvent* event)
diff --git a/Source/core/html/CheckboxInputType.h b/Source/core/html/forms/CheckboxInputType.h
similarity index 97%
rename from Source/core/html/CheckboxInputType.h
rename to Source/core/html/forms/CheckboxInputType.h
index 63cbf96..3cef9b9 100644
--- a/Source/core/html/CheckboxInputType.h
+++ b/Source/core/html/forms/CheckboxInputType.h
@@ -31,7 +31,7 @@
 #ifndef CheckboxInputType_h
 #define CheckboxInputType_h
 
-#include "core/html/BaseCheckableInputType.h"
+#include "core/html/forms/BaseCheckableInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/dom/CheckedRadioButtons.cpp b/Source/core/html/forms/CheckedRadioButtons.cpp
similarity index 96%
rename from Source/core/dom/CheckedRadioButtons.cpp
rename to Source/core/html/forms/CheckedRadioButtons.cpp
index 0dc3b4d..58850fb 100644
--- a/Source/core/dom/CheckedRadioButtons.cpp
+++ b/Source/core/html/forms/CheckedRadioButtons.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "core/dom/CheckedRadioButtons.h"
+#include "core/html/forms/CheckedRadioButtons.h"
 
 #include "core/html/HTMLInputElement.h"
 #include "wtf/HashSet.h"
@@ -88,9 +88,9 @@
         setCheckedButton(button);
 
     bool groupIsValid = isValid();
-    if (groupWasValid != groupIsValid)
+    if (groupWasValid != groupIsValid) {
         setNeedsValidityCheckForAllButtons();
-    else if (!groupIsValid) {
+    } else if (!groupIsValid) {
         // A radio button not in a group is always valid. We need to make it
         // invalid only if the group is invalid.
         button->setNeedsValidityCheck();
@@ -102,9 +102,9 @@
     ASSERT(button->isRadioButton());
     ASSERT(m_members.contains(button));
     bool wasValid = isValid();
-    if (button->checked())
+    if (button->checked()) {
         setCheckedButton(button);
-    else {
+    } else {
         if (m_checkedButton == button)
             m_checkedButton = 0;
     }
@@ -117,9 +117,9 @@
     ASSERT(button->isRadioButton());
     ASSERT(m_members.contains(button));
     bool wasValid = isValid();
-    if (button->isRequired())
+    if (button->isRequired()) {
         ++m_requiredCount;
-    else {
+    } else {
         ASSERT(m_requiredCount);
         --m_requiredCount;
     }
@@ -145,8 +145,9 @@
     if (m_members.isEmpty()) {
         ASSERT(!m_requiredCount);
         ASSERT(!m_checkedButton);
-    } else if (wasValid != isValid())
+    } else if (wasValid != isValid()) {
         setNeedsValidityCheckForAllButtons();
+    }
     if (!wasValid) {
         // A radio button not in a group is always valid. We need to make it
         // valid only if the group was invalid.
diff --git a/Source/core/dom/CheckedRadioButtons.h b/Source/core/html/forms/CheckedRadioButtons.h
similarity index 100%
rename from Source/core/dom/CheckedRadioButtons.h
rename to Source/core/html/forms/CheckedRadioButtons.h
diff --git a/Source/core/html/ColorInputType.cpp b/Source/core/html/forms/ColorInputType.cpp
similarity index 97%
rename from Source/core/html/ColorInputType.cpp
rename to Source/core/html/forms/ColorInputType.cpp
index 16a85e2..18eea43 100644
--- a/Source/core/html/ColorInputType.cpp
+++ b/Source/core/html/forms/ColorInputType.cpp
@@ -29,19 +29,19 @@
  */
 
 #include "config.h"
-#include "core/html/ColorInputType.h"
+#include "core/html/forms/ColorInputType.h"
 
 #include "CSSPropertyNames.h"
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptController.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLDataListElement.h"
 #include "core/html/HTMLDivElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLOptionElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/page/Chrome.h"
 #include "core/platform/graphics/Color.h"
 #include "core/rendering/RenderView.h"
diff --git a/Source/core/html/ColorInputType.h b/Source/core/html/forms/ColorInputType.h
similarity index 97%
rename from Source/core/html/ColorInputType.h
rename to Source/core/html/forms/ColorInputType.h
index 309ceff..3d7340f 100644
--- a/Source/core/html/ColorInputType.h
+++ b/Source/core/html/forms/ColorInputType.h
@@ -31,7 +31,7 @@
 #ifndef ColorInputType_h
 #define ColorInputType_h
 
-#include "core/html/BaseClickableWithKeyInputType.h"
+#include "core/html/forms/BaseClickableWithKeyInputType.h"
 #include "core/platform/ColorChooserClient.h"
 
 namespace WebCore {
diff --git a/Source/core/html/DateInputType.cpp b/Source/core/html/forms/DateInputType.cpp
similarity index 97%
rename from Source/core/html/DateInputType.cpp
rename to Source/core/html/forms/DateInputType.cpp
index 9efe983..00ac554 100644
--- a/Source/core/html/DateInputType.cpp
+++ b/Source/core/html/forms/DateInputType.cpp
@@ -29,12 +29,12 @@
  */
 
 #include "config.h"
-#include "core/html/DateInputType.h"
+#include "core/html/forms/DateInputType.h"
 
 #include "HTMLNames.h"
-#include "core/html/DateTimeFieldsState.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/DateComponents.h"
 #include "core/platform/LocalizedStrings.h"
 #include "core/platform/text/PlatformLocale.h"
diff --git a/Source/core/html/DateInputType.h b/Source/core/html/forms/DateInputType.h
similarity index 95%
rename from Source/core/html/DateInputType.h
rename to Source/core/html/forms/DateInputType.h
index 3317d7c..157278f 100644
--- a/Source/core/html/DateInputType.h
+++ b/Source/core/html/forms/DateInputType.h
@@ -31,8 +31,8 @@
 #ifndef DateInputType_h
 #define DateInputType_h
 
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/DateTimeFieldsState.cpp b/Source/core/html/forms/DateTimeFieldsState.cpp
similarity index 97%
rename from Source/core/html/DateTimeFieldsState.cpp
rename to Source/core/html/forms/DateTimeFieldsState.cpp
index 314af5a..13c955b 100644
--- a/Source/core/html/DateTimeFieldsState.cpp
+++ b/Source/core/html/forms/DateTimeFieldsState.cpp
@@ -25,9 +25,9 @@
 
 #include "config.h"
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/DateTimeFieldsState.h"
+#include "core/html/forms/DateTimeFieldsState.h"
 
-#include "core/html/FormController.h"
+#include "core/html/forms/FormController.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/DateTimeFieldsState.h b/Source/core/html/forms/DateTimeFieldsState.h
similarity index 100%
rename from Source/core/html/DateTimeFieldsState.h
rename to Source/core/html/forms/DateTimeFieldsState.h
diff --git a/Source/core/html/DateTimeLocalInputType.cpp b/Source/core/html/forms/DateTimeLocalInputType.cpp
similarity index 97%
rename from Source/core/html/DateTimeLocalInputType.cpp
rename to Source/core/html/forms/DateTimeLocalInputType.cpp
index ea7f9de..420a9cf 100644
--- a/Source/core/html/DateTimeLocalInputType.cpp
+++ b/Source/core/html/forms/DateTimeLocalInputType.cpp
@@ -29,21 +29,18 @@
  */
 
 #include "config.h"
-#include "core/html/DateTimeLocalInputType.h"
+#include "core/html/forms/DateTimeLocalInputType.h"
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/DateComponents.h"
-#include "wtf/PassOwnPtr.h"
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/DateTimeFieldsState.h"
 #include "core/platform/LocalizedStrings.h"
 #include "core/platform/text/PlatformLocale.h"
+#include "wtf/PassOwnPtr.h"
 #include "wtf/text/WTFString.h"
-#endif
 
 namespace WebCore {
 
diff --git a/Source/core/html/DateTimeLocalInputType.h b/Source/core/html/forms/DateTimeLocalInputType.h
similarity index 95%
rename from Source/core/html/DateTimeLocalInputType.h
rename to Source/core/html/forms/DateTimeLocalInputType.h
index 6e2743a..699ccdd 100644
--- a/Source/core/html/DateTimeLocalInputType.h
+++ b/Source/core/html/forms/DateTimeLocalInputType.h
@@ -31,8 +31,8 @@
 #ifndef DateTimeLocalInputType_h
 #define DateTimeLocalInputType_h
 
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/EmailInputType.cpp b/Source/core/html/forms/EmailInputType.cpp
similarity index 95%
rename from Source/core/html/EmailInputType.cpp
rename to Source/core/html/forms/EmailInputType.cpp
index ef19641..e933396 100644
--- a/Source/core/html/EmailInputType.cpp
+++ b/Source/core/html/forms/EmailInputType.cpp
@@ -22,10 +22,10 @@
  */
 
 #include "config.h"
-#include "core/html/EmailInputType.h"
+#include "core/html/forms/EmailInputType.h"
 
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
@@ -57,7 +57,7 @@
         return address;
 
     size_t atPosition = address.find('@');
-    if (atPosition == notFound)
+    if (atPosition == kNotFound)
         return address;
 
     UErrorCode error = U_ZERO_ERROR;
@@ -78,10 +78,10 @@
         return address;
 
     size_t atPosition = address.find('@');
-    if (atPosition == notFound)
+    if (atPosition == kNotFound)
         return address;
 
-    if (address.find("xn--", atPosition + 1) == notFound)
+    if (address.find("xn--", atPosition + 1) == kNotFound)
         return address;
 
     if (!chrome())
@@ -100,7 +100,7 @@
     if (!isASCII(ch))
         return true;
     DEFINE_STATIC_LOCAL(const String, validCharacters, (localPartCharacters));
-    return validCharacters.find(toASCIILower(ch)) == notFound;
+    return validCharacters.find(toASCIILower(ch)) == kNotFound;
 }
 
 static bool isInvalidDomainCharacter(UChar ch)
@@ -116,7 +116,7 @@
         return true;
     if (domain[0] == '.' || domain[domain.length() - 1] == '.')
         return false;
-    return domain.find("..") == notFound;
+    return domain.find("..") == kNotFound;
 }
 
 static bool isValidEmailAddress(const String& address)
@@ -186,7 +186,7 @@
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailEmpty);
     String atSign = String("@");
     size_t atIndex = invalidAddress.find('@');
-    if (atIndex == notFound)
+    if (atIndex == kNotFound)
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailNoAtSign, atSign, invalidAddress);
     // We check validity against an ASCII value because of difficulty to check
     // invalid characters. However we should show Unicode value.
@@ -198,18 +198,18 @@
     if (domain.isEmpty())
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailEmptyDomain, atSign, unicodeAddress);
     size_t invalidCharIndex = localPart.find(isInvalidLocalPartCharacter);
-    if (invalidCharIndex != notFound) {
+    if (invalidCharIndex != kNotFound) {
         unsigned charLength = U_IS_LEAD(localPart[invalidCharIndex]) ? 2 : 1;
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidLocal, atSign, localPart.substring(invalidCharIndex, charLength));
     }
     invalidCharIndex = domain.find(isInvalidDomainCharacter);
-    if (invalidCharIndex != notFound) {
+    if (invalidCharIndex != kNotFound) {
         unsigned charLength = U_IS_LEAD(domain[invalidCharIndex]) ? 2 : 1;
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDomain, atSign, domain.substring(invalidCharIndex, charLength));
     }
     if (!checkValidDotUsage(domain)) {
         size_t atIndexInUnicode = unicodeAddress.find('@');
-        ASSERT(atIndexInUnicode != notFound);
+        ASSERT(atIndexInUnicode != kNotFound);
         return locale().queryString(WebLocalizedString::ValidationTypeMismatchForEmailInvalidDots, String("."), unicodeAddress.substring(atIndexInUnicode + 1));
     }
     if (element()->multiple())
diff --git a/Source/core/html/EmailInputType.h b/Source/core/html/forms/EmailInputType.h
similarity index 97%
rename from Source/core/html/EmailInputType.h
rename to Source/core/html/forms/EmailInputType.h
index e2e0eae..aea5fe4 100644
--- a/Source/core/html/EmailInputType.h
+++ b/Source/core/html/forms/EmailInputType.h
@@ -31,7 +31,7 @@
 #ifndef EmailInputType_h
 #define EmailInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/FileInputType.cpp b/Source/core/html/forms/FileInputType.cpp
similarity index 95%
rename from Source/core/html/FileInputType.cpp
rename to Source/core/html/forms/FileInputType.cpp
index cdf4735..72c2742 100644
--- a/Source/core/html/FileInputType.cpp
+++ b/Source/core/html/forms/FileInputType.cpp
@@ -20,24 +20,25 @@
  */
 
 #include "config.h"
-#include "core/html/FileInputType.h"
+#include "core/html/forms/FileInputType.h"
 
 #include "HTMLNames.h"
+#include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "bindings/v8/ScriptController.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/fileapi/File.h"
 #include "core/fileapi/FileList.h"
-#include "core/html/FormController.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/FormController.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/page/Chrome.h"
-#include "RuntimeEnabledFeatures.h"
 #include "core/platform/DragData.h"
 #include "core/platform/FileSystem.h"
 #include "core/platform/LocalizedStrings.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "core/rendering/RenderFileUploadControl.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/text/StringBuilder.h"
@@ -45,6 +46,7 @@
 
 namespace WebCore {
 
+using WebKit::WebLocalizedString;
 using namespace HTMLNames;
 
 inline FileInputType::FileInputType(HTMLInputElement* element)
@@ -131,7 +133,7 @@
 
 String FileInputType::valueMissingText() const
 {
-    return element()->multiple() ? validationMessageValueMissingForMultipleFileText() : validationMessageValueMissingForFileText();
+    return locale().queryString(element()->multiple() ? WebLocalizedString::ValidationValueMissingForMultipleFile : WebLocalizedString::ValidationValueMissingForFile);
 }
 
 void FileInputType::handleDOMActivateEvent(Event* event)
@@ -275,9 +277,9 @@
     RefPtr<HTMLInputElement> input = element();
 
     bool pathsChanged = false;
-    if (files->length() != m_fileList->length())
+    if (files->length() != m_fileList->length()) {
         pathsChanged = true;
-    else {
+    } else {
         for (unsigned i = 0; i < files->length(); ++i) {
             if (files->item(i)->path() != m_fileList->item(i)->path()) {
                 pathsChanged = true;
@@ -345,9 +347,9 @@
     for (unsigned i = 0; i < paths.size(); ++i)
         files.append(FileChooserFileInfo(paths[i]));
 
-    if (input->fastHasAttribute(multipleAttr))
+    if (input->fastHasAttribute(multipleAttr)) {
         filesChosen(files);
-    else {
+    } else {
         Vector<FileChooserFileInfo> firstFileOnly;
         firstFileOnly.append(files[0]);
         filesChosen(firstFileOnly);
diff --git a/Source/core/html/FileInputType.h b/Source/core/html/forms/FileInputType.h
similarity index 98%
rename from Source/core/html/FileInputType.h
rename to Source/core/html/forms/FileInputType.h
index 1f3c014..f96f5c4 100644
--- a/Source/core/html/FileInputType.h
+++ b/Source/core/html/forms/FileInputType.h
@@ -32,7 +32,7 @@
 #ifndef FileInputType_h
 #define FileInputType_h
 
-#include "core/html/BaseClickableWithKeyInputType.h"
+#include "core/html/forms/BaseClickableWithKeyInputType.h"
 #include "core/platform/FileChooser.h"
 #include "wtf/RefPtr.h"
 
diff --git a/Source/core/html/FormController.cpp b/Source/core/html/forms/FormController.cpp
similarity index 98%
rename from Source/core/html/FormController.cpp
rename to Source/core/html/forms/FormController.cpp
index b68b2fb..bcf7b27 100644
--- a/Source/core/html/FormController.cpp
+++ b/Source/core/html/forms/FormController.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "core/html/FormController.h"
+#include "core/html/forms/FormController.h"
 
 #include "core/html/HTMLFormControlElementWithState.h"
 #include "core/html/HTMLFormElement.h"
@@ -219,7 +219,7 @@
         String name = stateVector[index++];
         String type = stateVector[index++];
         FormControlState state = FormControlState::deserialize(stateVector, index);
-        if (type.isEmpty() || type.find(isNotFormControlTypeCharacter) != notFound || state.isFailure())
+        if (type.isEmpty() || type.find(isNotFormControlTypeCharacter) != kNotFound || state.isFailure())
             return nullptr;
         savedFormState->appendControlState(name, type, state);
     }
@@ -244,9 +244,9 @@
 {
     FormElementKey key(name.impl(), type.impl());
     FormElementStateMap::iterator it = m_stateForNewFormElements.find(key);
-    if (it != m_stateForNewFormElements.end())
+    if (it != m_stateForNewFormElements.end()) {
         it->value.append(state);
-    else {
+    } else {
         Deque<FormControlState> stateList;
         stateList.append(state);
         m_stateForNewFormElements.set(key, stateList);
diff --git a/Source/core/html/FormController.h b/Source/core/html/forms/FormController.h
similarity index 98%
rename from Source/core/html/FormController.h
rename to Source/core/html/forms/FormController.h
index 49ffe45..4079935 100644
--- a/Source/core/html/FormController.h
+++ b/Source/core/html/forms/FormController.h
@@ -22,7 +22,7 @@
 #ifndef FormController_h
 #define FormController_h
 
-#include "core/dom/CheckedRadioButtons.h"
+#include "core/html/forms/CheckedRadioButtons.h"
 #include "wtf/Forward.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/Vector.h"
diff --git a/Source/core/html/HiddenInputType.cpp b/Source/core/html/forms/HiddenInputType.cpp
similarity index 96%
rename from Source/core/html/HiddenInputType.cpp
rename to Source/core/html/forms/HiddenInputType.cpp
index d4b0f9e..512522e 100644
--- a/Source/core/html/HiddenInputType.cpp
+++ b/Source/core/html/forms/HiddenInputType.cpp
@@ -30,13 +30,13 @@
  */
 
 #include "config.h"
-#include "core/html/HiddenInputType.h"
+#include "core/html/forms/HiddenInputType.h"
 
 #include "HTMLNames.h"
-#include "core/html/FormController.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/FormController.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/HiddenInputType.h b/Source/core/html/forms/HiddenInputType.h
similarity index 98%
rename from Source/core/html/HiddenInputType.h
rename to Source/core/html/forms/HiddenInputType.h
index b24bbe0..9490015 100644
--- a/Source/core/html/HiddenInputType.h
+++ b/Source/core/html/forms/HiddenInputType.h
@@ -31,7 +31,7 @@
 #ifndef HiddenInputType_h
 #define HiddenInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/ImageInputType.cpp b/Source/core/html/forms/ImageInputType.cpp
similarity index 97%
rename from Source/core/html/ImageInputType.cpp
rename to Source/core/html/forms/ImageInputType.cpp
index 06ada94..10d3d6d 100644
--- a/Source/core/html/ImageInputType.cpp
+++ b/Source/core/html/forms/ImageInputType.cpp
@@ -21,16 +21,16 @@
  */
 
 #include "config.h"
-#include "core/html/ImageInputType.h"
+#include "core/html/forms/ImageInputType.h"
 
 #include "HTMLNames.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLImageLoader.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/rendering/RenderImage.h"
 #include "wtf/PassOwnPtr.h"
@@ -94,8 +94,9 @@
     if (event->underlyingEvent() && event->underlyingEvent()->isMouseEvent()) {
         MouseEvent* mouseEvent = toMouseEvent(event->underlyingEvent());
         m_clickLocation = IntPoint(mouseEvent->offsetX(), mouseEvent->offsetY());
-    } else
+    } else {
         m_clickLocation = IntPoint();
+    }
     element->form()->prepareForSubmission(event); // Event handlers can run.
     element->setActivatedSubmit(false);
     event->setDefaultHandled();
diff --git a/Source/core/html/ImageInputType.h b/Source/core/html/forms/ImageInputType.h
similarity index 98%
rename from Source/core/html/ImageInputType.h
rename to Source/core/html/forms/ImageInputType.h
index cff186d..c3a5d76 100644
--- a/Source/core/html/ImageInputType.h
+++ b/Source/core/html/forms/ImageInputType.h
@@ -33,7 +33,7 @@
 #ifndef ImageInputType_h
 #define ImageInputType_h
 
-#include "core/html/BaseButtonInputType.h"
+#include "core/html/forms/BaseButtonInputType.h"
 #include "core/platform/graphics/IntPoint.h"
 
 namespace WebCore {
diff --git a/Source/core/html/InputType.cpp b/Source/core/html/forms/InputType.cpp
similarity index 90%
rename from Source/core/html/InputType.cpp
rename to Source/core/html/forms/InputType.cpp
index fb9d10c..2155c6c 100644
--- a/Source/core/html/InputType.cpp
+++ b/Source/core/html/forms/InputType.cpp
@@ -26,41 +26,41 @@
  */
 
 #include "config.h"
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 
 #include "RuntimeEnabledFeatures.h"
 #include "core/accessibility/AXObjectCache.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeRenderStyle.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/fileapi/FileList.h"
-#include "core/html/ButtonInputType.h"
-#include "core/html/CheckboxInputType.h"
-#include "core/html/ColorInputType.h"
-#include "core/html/DateInputType.h"
-#include "core/html/DateTimeLocalInputType.h"
-#include "core/html/EmailInputType.h"
-#include "core/html/FileInputType.h"
-#include "core/html/FormController.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/HiddenInputType.h"
-#include "core/html/ImageInputType.h"
-#include "core/html/InputTypeNames.h"
-#include "core/html/MonthInputType.h"
-#include "core/html/NumberInputType.h"
-#include "core/html/PasswordInputType.h"
-#include "core/html/RadioInputType.h"
-#include "core/html/RangeInputType.h"
-#include "core/html/ResetInputType.h"
-#include "core/html/SearchInputType.h"
-#include "core/html/SubmitInputType.h"
-#include "core/html/TelephoneInputType.h"
-#include "core/html/TextInputType.h"
-#include "core/html/TimeInputType.h"
-#include "core/html/URLInputType.h"
-#include "core/html/WeekInputType.h"
+#include "core/html/forms/ButtonInputType.h"
+#include "core/html/forms/CheckboxInputType.h"
+#include "core/html/forms/ColorInputType.h"
+#include "core/html/forms/DateInputType.h"
+#include "core/html/forms/DateTimeLocalInputType.h"
+#include "core/html/forms/EmailInputType.h"
+#include "core/html/forms/FileInputType.h"
+#include "core/html/forms/FormController.h"
+#include "core/html/forms/HiddenInputType.h"
+#include "core/html/forms/ImageInputType.h"
+#include "core/html/forms/InputTypeNames.h"
+#include "core/html/forms/MonthInputType.h"
+#include "core/html/forms/NumberInputType.h"
+#include "core/html/forms/PasswordInputType.h"
+#include "core/html/forms/RadioInputType.h"
+#include "core/html/forms/RangeInputType.h"
+#include "core/html/forms/ResetInputType.h"
+#include "core/html/forms/SearchInputType.h"
+#include "core/html/forms/SubmitInputType.h"
+#include "core/html/forms/TelephoneInputType.h"
+#include "core/html/forms/TextInputType.h"
+#include "core/html/forms/TimeInputType.h"
+#include "core/html/forms/URLInputType.h"
+#include "core/html/forms/WeekInputType.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/HTMLShadowElement.h"
 #include "core/page/Page.h"
@@ -207,7 +207,7 @@
 
 void InputType::setValueAsDate(double, ExceptionState& es) const
 {
-    es.throwDOMException(InvalidStateError);
+    es.throwUninformativeAndGenericDOMException(InvalidStateError);
 }
 
 double InputType::valueAsDouble() const
@@ -222,7 +222,7 @@
 
 void InputType::setValueAsDecimal(const Decimal&, TextFieldEventBehavior, ExceptionState& es) const
 {
-    es.throwDOMException(InvalidStateError);
+    es.throwUninformativeAndGenericDOMException(InvalidStateError);
 }
 
 bool InputType::supportsValidation() const
@@ -341,17 +341,29 @@
 String InputType::badInputText() const
 {
     ASSERT_NOT_REACHED();
-    return validationMessageTypeMismatchText();
+    return locale().queryString(WebLocalizedString::ValidationTypeMismatch);
+}
+
+String InputType::rangeOverflowText(const Decimal&) const
+{
+    ASSERT_NOT_REACHED();
+    return String();
+}
+
+String InputType::rangeUnderflowText(const Decimal&) const
+{
+    ASSERT_NOT_REACHED();
+    return String();
 }
 
 String InputType::typeMismatchText() const
 {
-    return validationMessageTypeMismatchText();
+    return locale().queryString(WebLocalizedString::ValidationTypeMismatch);
 }
 
 String InputType::valueMissingText() const
 {
-    return validationMessageValueMissingText();
+    return locale().queryString(WebLocalizedString::ValidationValueMissing);
 }
 
 String InputType::validationMessage() const
@@ -370,10 +382,10 @@
         return typeMismatchText();
 
     if (patternMismatch(value))
-        return validationMessagePatternMismatchText();
+        return locale().queryString(WebLocalizedString::ValidationPatternMismatch);
 
     if (element()->tooLong())
-        return validationMessageTooLongText(numGraphemeClusters(value), element()->maxLength());
+        return locale().validationMessageTooLongText(value.length(), element()->maxLength());
 
     if (!isSteppable())
         return emptyString();
@@ -385,10 +397,10 @@
     StepRange stepRange(createStepRange(RejectAny));
 
     if (numericValue < stepRange.minimum())
-        return validationMessageRangeUnderflowText(serialize(stepRange.minimum()));
+        return rangeUnderflowText(stepRange.minimum());
 
     if (numericValue > stepRange.maximum())
-        return validationMessageRangeOverflowText(serialize(stepRange.maximum()));
+        return rangeOverflowText(stepRange.maximum());
 
     if (stepRange.stepMismatch(numericValue)) {
         ASSERT(stepRange.hasStep());
@@ -823,24 +835,24 @@
 {
     StepRange stepRange(createStepRange(anyStepHandling));
     if (!stepRange.hasStep()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
     const Decimal current = parseToNumberOrNaN(element()->value());
     if (!current.isFinite()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     Decimal newValue = current + stepRange.step() * count;
     if (!newValue.isFinite()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
     const Decimal acceptableErrorValue = stepRange.acceptableError();
     if (newValue - stepRange.minimum() < -acceptableErrorValue) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     if (newValue < stepRange.minimum())
@@ -851,7 +863,7 @@
         newValue = stepRange.alignValueForStep(current, newValue);
 
     if (newValue - stepRange.maximum() > acceptableErrorValue) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     if (newValue > stepRange.maximum())
@@ -879,7 +891,7 @@
 void InputType::stepUp(int n, ExceptionState& es)
 {
     if (!isSteppable()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     applyStep(n, RejectAny, DispatchNoEvent, es);
diff --git a/Source/core/html/InputType.h b/Source/core/html/forms/InputType.h
similarity index 98%
rename from Source/core/html/InputType.h
rename to Source/core/html/forms/InputType.h
index bba7052..e294fe9 100644
--- a/Source/core/html/InputType.h
+++ b/Source/core/html/forms/InputType.h
@@ -34,8 +34,8 @@
 #define InputType_h
 
 #include "core/html/HTMLTextFormControlElement.h"
-#include "core/html/StepRange.h"
 #include "core/html/forms/InputTypeView.h"
+#include "core/html/forms/StepRange.h"
 #include "core/page/UseCounter.h"
 
 namespace WebCore {
@@ -145,6 +145,8 @@
     virtual void stepUp(int, ExceptionState&);
     virtual void stepUpFromRenderer(int);
     virtual String badInputText() const;
+    virtual String rangeOverflowText(const Decimal& maximum) const;
+    virtual String rangeUnderflowText(const Decimal& minimum) const;
     virtual String typeMismatchText() const;
     virtual String valueMissingText() const;
     virtual bool canSetStringValue() const;
@@ -167,8 +169,6 @@
     virtual void createShadowSubtree();
     virtual void destroyShadowSubtree();
 
-    virtual HTMLElement* containerElement() const { return 0; }
-    virtual HTMLElement* editingViewPortElement() const { return 0; }
     virtual HTMLElement* innerTextElement() const { return 0; }
     virtual HTMLElement* passwordGeneratorButtonElement() const { return 0; }
 
diff --git a/Source/core/html/InputTypeNames.cpp b/Source/core/html/forms/InputTypeNames.cpp
similarity index 98%
rename from Source/core/html/InputTypeNames.cpp
rename to Source/core/html/forms/InputTypeNames.cpp
index cefdac8..e4fa55a 100644
--- a/Source/core/html/InputTypeNames.cpp
+++ b/Source/core/html/forms/InputTypeNames.cpp
@@ -20,7 +20,7 @@
  */
 
 #include "config.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/InputTypeNames.h b/Source/core/html/forms/InputTypeNames.h
similarity index 100%
rename from Source/core/html/InputTypeNames.h
rename to Source/core/html/forms/InputTypeNames.h
diff --git a/Source/core/html/MonthInputType.cpp b/Source/core/html/forms/MonthInputType.cpp
similarity index 97%
rename from Source/core/html/MonthInputType.cpp
rename to Source/core/html/forms/MonthInputType.cpp
index 620e5c8..390a94b 100644
--- a/Source/core/html/MonthInputType.cpp
+++ b/Source/core/html/forms/MonthInputType.cpp
@@ -29,22 +29,19 @@
  */
 
 #include "config.h"
-#include "core/html/MonthInputType.h"
+#include "core/html/forms/MonthInputType.h"
 
 #include "HTMLNames.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/DateComponents.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/DateMath.h"
 #include "wtf/MathExtras.h"
 #include "wtf/PassOwnPtr.h"
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/DateTimeFieldsState.h"
-#include "core/platform/text/PlatformLocale.h"
 #include "wtf/text/WTFString.h"
-#endif
 
 namespace WebCore {
 
diff --git a/Source/core/html/MonthInputType.h b/Source/core/html/forms/MonthInputType.h
similarity index 95%
rename from Source/core/html/MonthInputType.h
rename to Source/core/html/forms/MonthInputType.h
index 9f2af94..73865be 100644
--- a/Source/core/html/MonthInputType.h
+++ b/Source/core/html/forms/MonthInputType.h
@@ -31,8 +31,8 @@
 #ifndef MonthInputType_h
 #define MonthInputType_h
 
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/NumberInputType.cpp b/Source/core/html/forms/NumberInputType.cpp
similarity index 90%
rename from Source/core/html/NumberInputType.cpp
rename to Source/core/html/forms/NumberInputType.cpp
index 8778db7..3fa5c6f 100644
--- a/Source/core/html/NumberInputType.cpp
+++ b/Source/core/html/forms/NumberInputType.cpp
@@ -30,24 +30,24 @@
  */
 
 #include "config.h"
-#include "core/html/NumberInputType.h"
+#include "core/html/forms/NumberInputType.h"
 
-#include <limits>
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
-#include "core/platform/LocalizedStrings.h"
 #include "core/platform/text/PlatformLocale.h"
 #include "core/rendering/RenderTextControl.h"
 #include "wtf/MathExtras.h"
 #include "wtf/PassOwnPtr.h"
+#include <limits>
 
 namespace WebCore {
 
+using WebKit::WebLocalizedString;
 using namespace HTMLNames;
 using namespace std;
 
@@ -55,8 +55,7 @@
 static const int numberDefaultStepBase = 0;
 static const int numberStepScaleFactor = 1;
 
-struct RealNumberRenderSize
-{
+struct RealNumberRenderSize {
     unsigned sizeBeforeDecimalPoint;
     unsigned sizeAfteDecimalPoint;
 
@@ -127,11 +126,11 @@
     // FIXME: We should use numeric_limits<double>::max for number input type.
     const double floatMax = numeric_limits<float>::max();
     if (newValue < -floatMax) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     if (newValue > floatMax) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     element()->setValue(serializeForNumberType(newValue), eventBehavior);
@@ -142,11 +141,11 @@
     // FIXME: We should use numeric_limits<double>::max for number input type.
     const Decimal floatMax = Decimal::fromDouble(numeric_limits<float>::max());
     if (newValue < -floatMax) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     if (newValue > floatMax) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     element()->setValue(serializeForNumberType(newValue), eventBehavior);
@@ -235,7 +234,7 @@
     if (proposedValue.isEmpty())
         return proposedValue;
     // We don't localize scientific notations.
-    if (proposedValue.find(isE) != notFound)
+    if (proposedValue.find(isE) != kNotFound)
         return proposedValue;
     return element()->locale().convertToLocalizedNumber(proposedValue);
 }
@@ -250,7 +249,7 @@
     if (visibleValue.isEmpty())
         return visibleValue;
     // We don't localize scientific notations.
-    if (visibleValue.find(isE) != notFound)
+    if (visibleValue.find(isE) != kNotFound)
         return visibleValue;
     return element()->locale().convertFromLocalizedNumber(visibleValue);
 }
@@ -270,7 +269,17 @@
 
 String NumberInputType::badInputText() const
 {
-    return validationMessageBadInputForNumberText();
+    return locale().queryString(WebLocalizedString::ValidationBadInputForNumber);
+}
+
+String NumberInputType::rangeOverflowText(const Decimal& maximum) const
+{
+    return locale().queryString(WebLocalizedString::ValidationRangeOverflow, localizeValue(serialize(maximum)));
+}
+
+String NumberInputType::rangeUnderflowText(const Decimal& minimum) const
+{
+    return locale().queryString(WebLocalizedString::ValidationRangeUnderflow, localizeValue(serialize(minimum)));
 }
 
 bool NumberInputType::shouldRespectSpeechAttribute()
diff --git a/Source/core/html/NumberInputType.h b/Source/core/html/forms/NumberInputType.h
similarity index 94%
rename from Source/core/html/NumberInputType.h
rename to Source/core/html/forms/NumberInputType.h
index 5b201c4..7507a30 100644
--- a/Source/core/html/NumberInputType.h
+++ b/Source/core/html/forms/NumberInputType.h
@@ -31,7 +31,7 @@
 #ifndef NumberInputType_h
 #define NumberInputType_h
 
-#include "core/html/TextFieldInputType.h"
+#include "core/html/forms/TextFieldInputType.h"
 
 namespace WebCore {
 
@@ -63,6 +63,8 @@
     virtual String sanitizeValue(const String&) const OVERRIDE;
     virtual bool hasBadInput() const OVERRIDE;
     virtual String badInputText() const OVERRIDE;
+    virtual String rangeOverflowText(const Decimal& maxmum) const OVERRIDE;
+    virtual String rangeUnderflowText(const Decimal& minimum) const OVERRIDE;
     virtual bool shouldRespectSpeechAttribute() OVERRIDE;
     virtual bool supportsPlaceholder() const OVERRIDE;
     virtual bool isNumberField() const OVERRIDE;
diff --git a/Source/core/html/PasswordInputType.cpp b/Source/core/html/forms/PasswordInputType.cpp
similarity index 96%
rename from Source/core/html/PasswordInputType.cpp
rename to Source/core/html/forms/PasswordInputType.cpp
index ddad942..f5b84a2 100644
--- a/Source/core/html/PasswordInputType.cpp
+++ b/Source/core/html/forms/PasswordInputType.cpp
@@ -30,11 +30,11 @@
  */
 
 #include "config.h"
-#include "core/html/PasswordInputType.h"
+#include "core/html/forms/PasswordInputType.h"
 
-#include "core/html/FormController.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/FormController.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
diff --git a/Source/core/html/PasswordInputType.h b/Source/core/html/forms/PasswordInputType.h
similarity index 98%
rename from Source/core/html/PasswordInputType.h
rename to Source/core/html/forms/PasswordInputType.h
index deb847f..b4cf2bf 100644
--- a/Source/core/html/PasswordInputType.h
+++ b/Source/core/html/forms/PasswordInputType.h
@@ -31,7 +31,7 @@
 #ifndef PasswordInputType_h
 #define PasswordInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 #include "core/html/shadow/PasswordGeneratorButtonElement.h"
 
 namespace WebCore {
diff --git a/Source/core/html/RadioInputType.cpp b/Source/core/html/forms/RadioInputType.cpp
similarity index 90%
rename from Source/core/html/RadioInputType.cpp
rename to Source/core/html/forms/RadioInputType.cpp
index 8b3dac2..0540cf0 100644
--- a/Source/core/html/RadioInputType.cpp
+++ b/Source/core/html/forms/RadioInputType.cpp
@@ -20,16 +20,16 @@
  */
 
 #include "config.h"
-#include "core/html/RadioInputType.h"
+#include "core/html/forms/RadioInputType.h"
 
 #include "HTMLNames.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/page/SpatialNavigation.h"
-#include "core/platform/LocalizedStrings.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
@@ -53,7 +53,7 @@
 
 String RadioInputType::valueMissingText() const
 {
-    return validationMessageValueMissingForRadioText();
+    return locale().queryString(WebKit::WebLocalizedString::ValidationValueMissingForRadio);
 }
 
 void RadioInputType::handleClickEvent(MouseEvent* event)
@@ -72,9 +72,10 @@
 
     // Left and up mean "previous radio button".
     // Right and down mean "next radio button".
-    // Tested in WinIE, and even for RTL, left still means previous radio button (and so moves
-    // to the right).  Seems strange, but we'll match it.
-    // However, when using Spatial Navigation, we need to be able to navigate without changing the selection.
+    // Tested in WinIE, and even for RTL, left still means previous radio button
+    // (and so moves to the right). Seems strange, but we'll match it. However,
+    // when using Spatial Navigation, we need to be able to navigate without
+    // changing the selection.
     Document& document = element()->document();
     if (isSpatialNavigationEnabled(document.frame()))
         return;
@@ -124,7 +125,7 @@
     if (isSpatialNavigationEnabled(element()->document().frame()))
         return true;
 
-    // Never allow keyboard tabbing to leave you in the same radio group.  Always
+    // Never allow keyboard tabbing to leave you in the same radio group. Always
     // skip any other elements in the group.
     Element* currentFocusedElement = element()->document().focusedElement();
     if (currentFocusedElement && currentFocusedElement->hasTagName(inputTag)) {
@@ -169,9 +170,9 @@
         // Make sure it is still a radio button and only do the restoration if it still belongs to our group.
         HTMLInputElement* checkedRadioButton = state.checkedRadioButton.get();
         if (checkedRadioButton
-                && checkedRadioButton->isRadioButton()
-                && checkedRadioButton->form() == element()->form()
-                && checkedRadioButton->name() == element()->name()) {
+            && checkedRadioButton->isRadioButton()
+            && checkedRadioButton->form() == element()->form()
+            && checkedRadioButton->name() == element()->name()) {
             checkedRadioButton->setChecked(true);
         }
     }
diff --git a/Source/core/html/RadioInputType.h b/Source/core/html/forms/RadioInputType.h
similarity index 97%
rename from Source/core/html/RadioInputType.h
rename to Source/core/html/forms/RadioInputType.h
index 2a3eaf7..667b3f2 100644
--- a/Source/core/html/RadioInputType.h
+++ b/Source/core/html/forms/RadioInputType.h
@@ -31,7 +31,7 @@
 #ifndef RadioInputType_h
 #define RadioInputType_h
 
-#include "core/html/BaseCheckableInputType.h"
+#include "core/html/forms/BaseCheckableInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/RangeInputType.cpp b/Source/core/html/forms/RangeInputType.cpp
similarity index 97%
rename from Source/core/html/RangeInputType.cpp
rename to Source/core/html/forms/RangeInputType.cpp
index 08f3608..125eb3d 100644
--- a/Source/core/html/RangeInputType.cpp
+++ b/Source/core/html/forms/RangeInputType.cpp
@@ -30,25 +30,24 @@
  */
 
 #include "config.h"
-#include "core/html/RangeInputType.h"
+#include "core/html/forms/RangeInputType.h"
 
-#include <limits>
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/accessibility/AXObjectCache.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/ScopedEventQueue.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/ScopedEventQueue.h"
 #include "core/dom/Touch.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/TouchList.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLDataListElement.h"
 #include "core/html/HTMLDivElement.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLOptionElement.h"
-#include "core/html/InputTypeNames.h"
-#include "core/html/StepRange.h"
+#include "core/html/forms/InputTypeNames.h"
+#include "core/html/forms/StepRange.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/html/shadow/SliderThumbElement.h"
@@ -57,6 +56,7 @@
 #include "wtf/MathExtras.h"
 #include "wtf/NonCopyingSort.h"
 #include "wtf/PassOwnPtr.h"
+#include <limits>
 
 namespace WebCore {
 
diff --git a/Source/core/html/RangeInputType.h b/Source/core/html/forms/RangeInputType.h
similarity index 98%
rename from Source/core/html/RangeInputType.h
rename to Source/core/html/forms/RangeInputType.h
index 5203989..b9d20df 100644
--- a/Source/core/html/RangeInputType.h
+++ b/Source/core/html/forms/RangeInputType.h
@@ -31,7 +31,7 @@
 #ifndef RangeInputType_h
 #define RangeInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/ResetInputType.cpp b/Source/core/html/forms/ResetInputType.cpp
similarity index 95%
rename from Source/core/html/ResetInputType.cpp
rename to Source/core/html/forms/ResetInputType.cpp
index 8a97278..b6209dd 100644
--- a/Source/core/html/ResetInputType.cpp
+++ b/Source/core/html/forms/ResetInputType.cpp
@@ -30,12 +30,12 @@
  */
 
 #include "config.h"
-#include "core/html/ResetInputType.h"
+#include "core/html/forms/ResetInputType.h"
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/LocalizedStrings.h"
 #include "wtf/PassOwnPtr.h"
 
diff --git a/Source/core/html/ResetInputType.h b/Source/core/html/forms/ResetInputType.h
similarity index 97%
rename from Source/core/html/ResetInputType.h
rename to Source/core/html/forms/ResetInputType.h
index 4b23e26..b467c82 100644
--- a/Source/core/html/ResetInputType.h
+++ b/Source/core/html/forms/ResetInputType.h
@@ -31,7 +31,7 @@
 #ifndef ResetInputType_h
 #define ResetInputType_h
 
-#include "core/html/BaseButtonInputType.h"
+#include "core/html/forms/BaseButtonInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/SearchInputType.cpp b/Source/core/html/forms/SearchInputType.cpp
similarity index 94%
rename from Source/core/html/SearchInputType.cpp
rename to Source/core/html/forms/SearchInputType.cpp
index bd6f952..a2bd867 100644
--- a/Source/core/html/SearchInputType.cpp
+++ b/Source/core/html/forms/SearchInputType.cpp
@@ -29,14 +29,14 @@
  */
 
 #include "config.h"
-#include "core/html/SearchInputType.h"
+#include "core/html/forms/SearchInputType.h"
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/html/shadow/TextControlInnerElements.h"
 #include "core/rendering/RenderSearchField.h"
@@ -90,8 +90,8 @@
 void SearchInputType::createShadowSubtree()
 {
     TextFieldInputType::createShadowSubtree();
-    HTMLElement* container = containerElement();
-    HTMLElement* viewPort = editingViewPortElement();
+    Element* container = containerElement();
+    Element* viewPort = element()->userAgentShadowRoot()->getElementById(ShadowElementNames::editingViewPort());
     ASSERT(container);
     ASSERT(viewPort);
 
diff --git a/Source/core/html/SearchInputType.h b/Source/core/html/forms/SearchInputType.h
similarity index 98%
rename from Source/core/html/SearchInputType.h
rename to Source/core/html/forms/SearchInputType.h
index 21c75a3..f2aa7fd 100644
--- a/Source/core/html/SearchInputType.h
+++ b/Source/core/html/forms/SearchInputType.h
@@ -31,7 +31,7 @@
 #ifndef SearchInputType_h
 #define SearchInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 #include "core/platform/Timer.h"
 
 namespace WebCore {
diff --git a/Source/core/html/StepRange.cpp b/Source/core/html/forms/StepRange.cpp
similarity index 99%
rename from Source/core/html/StepRange.cpp
rename to Source/core/html/forms/StepRange.cpp
index cc3768b..0e10a5f 100644
--- a/Source/core/html/StepRange.cpp
+++ b/Source/core/html/forms/StepRange.cpp
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "core/html/StepRange.h"
+#include "core/html/forms/StepRange.h"
 
 #include "HTMLNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
diff --git a/Source/core/html/StepRange.h b/Source/core/html/forms/StepRange.h
similarity index 100%
rename from Source/core/html/StepRange.h
rename to Source/core/html/forms/StepRange.h
diff --git a/Source/core/html/SubmitInputType.cpp b/Source/core/html/forms/SubmitInputType.cpp
similarity index 95%
rename from Source/core/html/SubmitInputType.cpp
rename to Source/core/html/forms/SubmitInputType.cpp
index a0d460f..f1272c1 100644
--- a/Source/core/html/SubmitInputType.cpp
+++ b/Source/core/html/forms/SubmitInputType.cpp
@@ -30,13 +30,13 @@
  */
 
 #include "config.h"
-#include "core/html/SubmitInputType.h"
+#include "core/html/forms/SubmitInputType.h"
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/FormDataList.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/LocalizedStrings.h"
 #include "wtf/PassOwnPtr.h"
 
diff --git a/Source/core/html/SubmitInputType.h b/Source/core/html/forms/SubmitInputType.h
similarity index 97%
rename from Source/core/html/SubmitInputType.h
rename to Source/core/html/forms/SubmitInputType.h
index 8d349fa..4a9c58f 100644
--- a/Source/core/html/SubmitInputType.h
+++ b/Source/core/html/forms/SubmitInputType.h
@@ -31,7 +31,7 @@
 #ifndef SubmitInputType_h
 #define SubmitInputType_h
 
-#include "core/html/BaseButtonInputType.h"
+#include "core/html/forms/BaseButtonInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/TelephoneInputType.cpp b/Source/core/html/forms/TelephoneInputType.cpp
similarity index 95%
rename from Source/core/html/TelephoneInputType.cpp
rename to Source/core/html/forms/TelephoneInputType.cpp
index e4e3e38..933e4ae 100644
--- a/Source/core/html/TelephoneInputType.cpp
+++ b/Source/core/html/forms/TelephoneInputType.cpp
@@ -29,9 +29,9 @@
  */
 
 #include "config.h"
-#include "core/html/TelephoneInputType.h"
+#include "core/html/forms/TelephoneInputType.h"
 
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/TelephoneInputType.h b/Source/core/html/forms/TelephoneInputType.h
similarity index 97%
rename from Source/core/html/TelephoneInputType.h
rename to Source/core/html/forms/TelephoneInputType.h
index b21cd41..b49b0a2 100644
--- a/Source/core/html/TelephoneInputType.h
+++ b/Source/core/html/forms/TelephoneInputType.h
@@ -31,7 +31,7 @@
 #ifndef TelephoneInputType_h
 #define TelephoneInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
similarity index 91%
rename from Source/core/html/TextFieldInputType.cpp
rename to Source/core/html/forms/TextFieldInputType.cpp
index 7915237..5286513 100644
--- a/Source/core/html/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -30,14 +30,14 @@
  */
 
 #include "config.h"
-#include "core/html/TextFieldInputType.h"
+#include "core/html/forms/TextFieldInputType.h"
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/BeforeTextInsertedEvent.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/BeforeTextInsertedEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/NodeRenderStyle.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/TextEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
@@ -192,8 +192,9 @@
             }
 
             renderTextControl->capsLockStateMayHaveChanged();
-        } else if (event->type() == eventNames().focusEvent)
+        } else if (event->type() == eventNames().focusEvent) {
             renderTextControl->capsLockStateMayHaveChanged();
+        }
 
         element()->forwardEvent(event);
     }
@@ -213,7 +214,7 @@
 
 bool TextFieldInputType::shouldSubmitImplicitly(Event* event)
 {
-    return (event->type() == eventNames().textInputEvent && event->hasInterface(eventNames().interfaceForTextEvent) && static_cast<TextEvent*>(event)->data() == "\n") || InputType::shouldSubmitImplicitly(event);
+    return (event->type() == eventNames().textInputEvent && event->hasInterface(eventNames().interfaceForTextEvent) && toTextEvent(event)->data() == "\n") || InputType::shouldSubmitImplicitly(event);
 }
 
 RenderObject* TextFieldInputType::createRenderer(RenderStyle*) const
@@ -238,9 +239,8 @@
 void TextFieldInputType::createShadowSubtree()
 {
     ASSERT(element()->shadow());
-
-    ASSERT(!m_innerText);
-    ASSERT(!m_editingViewPort);
+    ShadowRoot* shadowRoot = element()->userAgentShadowRoot();
+    ASSERT(!shadowRoot->hasChildNodes());
 
     Document& document = element()->document();
     bool shouldHaveSpinButton = this->shouldHaveSpinButton();
@@ -248,36 +248,30 @@
 
     m_innerText = TextControlInnerTextElement::create(document);
     if (!createsContainer) {
-        element()->userAgentShadowRoot()->appendChild(m_innerText);
+        shadowRoot->appendChild(m_innerText);
         return;
     }
 
-    ShadowRoot* shadowRoot = element()->userAgentShadowRoot();
-    m_container = TextControlInnerContainer::create(document);
-    m_container->setPart(AtomicString("-webkit-textfield-decoration-container", AtomicString::ConstructFromLiteral));
-    shadowRoot->appendChild(m_container);
+    RefPtr<TextControlInnerContainer> container = TextControlInnerContainer::create(document);
+    container->setPart(AtomicString("-webkit-textfield-decoration-container", AtomicString::ConstructFromLiteral));
+    shadowRoot->appendChild(container);
 
-    m_editingViewPort = EditingViewPortElement::create(document);
-    m_editingViewPort->appendChild(m_innerText);
-    m_container->appendChild(m_editingViewPort);
+    RefPtr<EditingViewPortElement> editingViewPort = EditingViewPortElement::create(document);
+    editingViewPort->appendChild(m_innerText);
+    container->appendChild(editingViewPort.release());
 
 #if ENABLE(INPUT_SPEECH)
     if (element()->isSpeechEnabled())
-        m_container->appendChild(InputFieldSpeechButtonElement::create(document));
+        container->appendChild(InputFieldSpeechButtonElement::create(document));
 #endif
 
     if (shouldHaveSpinButton)
-        m_container->appendChild(SpinButtonElement::create(document, *this));
+        container->appendChild(SpinButtonElement::create(document, *this));
 }
 
-HTMLElement* TextFieldInputType::containerElement() const
+Element* TextFieldInputType::containerElement() const
 {
-    return m_container.get();
-}
-
-HTMLElement* TextFieldInputType::editingViewPortElement() const
-{
-    return m_editingViewPort.get();
+    return element()->userAgentShadowRoot()->getElementById(ShadowElementNames::textFieldContainer());
 }
 
 HTMLElement* TextFieldInputType::innerTextElement() const
@@ -290,10 +284,8 @@
 {
     InputType::destroyShadowSubtree();
     m_innerText.clear();
-    m_editingViewPort.clear();
     if (SpinButtonElement* spinButton = spinButtonElement())
         spinButton->removeSpinButtonOwner();
-    m_container.clear();
 }
 
 void TextFieldInputType::attributeChanged()
@@ -410,7 +402,8 @@
         placeholder = newElement.get();
         placeholder->setPart(AtomicString("-webkit-input-placeholder", AtomicString::ConstructFromLiteral));
         placeholder->setAttribute(idAttr, ShadowElementNames::placeholder());
-        element()->userAgentShadowRoot()->insertBefore(placeholder, m_container ? m_container->nextSibling() : innerTextElement()->nextSibling());
+        Element* container = containerElement();
+        element()->userAgentShadowRoot()->insertBefore(placeholder, container ? container->nextSibling() : innerTextElement()->nextSibling());
     }
     placeholder->setTextContent(placeholderText, ASSERT_NO_EXCEPTION);
 }
diff --git a/Source/core/html/TextFieldInputType.h b/Source/core/html/forms/TextFieldInputType.h
similarity index 94%
rename from Source/core/html/TextFieldInputType.h
rename to Source/core/html/forms/TextFieldInputType.h
index 9ac5445..1516e8e 100644
--- a/Source/core/html/TextFieldInputType.h
+++ b/Source/core/html/forms/TextFieldInputType.h
@@ -31,7 +31,7 @@
 #ifndef TextFieldInputType_h
 #define TextFieldInputType_h
 
-#include "core/html/InputType.h"
+#include "core/html/forms/InputType.h"
 #include "core/html/shadow/SpinButtonElement.h"
 
 namespace WebCore {
@@ -48,8 +48,6 @@
     virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE;
     void handleKeydownEventForSpinButton(KeyboardEvent*);
 
-    virtual HTMLElement* containerElement() const OVERRIDE;
-    virtual HTMLElement* editingViewPortElement() const OVERRIDE;
     virtual HTMLElement* innerTextElement() const OVERRIDE;
 
 protected:
@@ -73,6 +71,8 @@
     };
     virtual void didSetValueByUserEdit(ValueChangeState);
 
+    Element* containerElement() const;
+
 private:
     virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE;
     virtual bool isTextField() const OVERRIDE;
@@ -97,8 +97,6 @@
 
     SpinButtonElement* spinButtonElement() const;
 
-    RefPtr<HTMLElement> m_container;
-    RefPtr<HTMLElement> m_editingViewPort;
     RefPtr<HTMLElement> m_innerText;
 };
 
diff --git a/Source/core/html/TextInputType.cpp b/Source/core/html/forms/TextInputType.cpp
similarity index 96%
rename from Source/core/html/TextInputType.cpp
rename to Source/core/html/forms/TextInputType.cpp
index 5ae6784..0b1d56d 100644
--- a/Source/core/html/TextInputType.cpp
+++ b/Source/core/html/forms/TextInputType.cpp
@@ -29,10 +29,10 @@
  */
 
 #include "config.h"
-#include "core/html/TextInputType.h"
+#include "core/html/forms/TextInputType.h"
 
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
diff --git a/Source/core/html/TextInputType.h b/Source/core/html/forms/TextInputType.h
similarity index 97%
rename from Source/core/html/TextInputType.h
rename to Source/core/html/forms/TextInputType.h
index 9d36ea8..378036a 100644
--- a/Source/core/html/TextInputType.h
+++ b/Source/core/html/forms/TextInputType.h
@@ -31,7 +31,7 @@
 #ifndef TextInputType_h
 #define TextInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/TimeInputType.cpp b/Source/core/html/forms/TimeInputType.cpp
similarity index 91%
rename from Source/core/html/TimeInputType.cpp
rename to Source/core/html/forms/TimeInputType.cpp
index 767c67a..08ee92d 100644
--- a/Source/core/html/TimeInputType.cpp
+++ b/Source/core/html/forms/TimeInputType.cpp
@@ -29,22 +29,19 @@
  */
 
 #include "config.h"
-#include "core/html/TimeInputType.h"
+#include "core/html/forms/TimeInputType.h"
 
 #include "HTMLNames.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/DateComponents.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/DateMath.h"
 #include "wtf/MathExtras.h"
 #include "wtf/PassOwnPtr.h"
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/DateTimeFieldsState.h"
-#include "core/platform/text/PlatformLocale.h"
 #include "wtf/text/WTFString.h"
-#endif
 
 namespace WebCore {
 
@@ -141,17 +138,19 @@
 {
     if (!dateTimeFieldsState.hasHour() || !dateTimeFieldsState.hasMinute() || !dateTimeFieldsState.hasAMPM())
         return emptyString();
-    if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond())
+    if (dateTimeFieldsState.hasMillisecond() && dateTimeFieldsState.millisecond()) {
         return String::format("%02u:%02u:%02u.%03u",
-                dateTimeFieldsState.hour23(),
-                dateTimeFieldsState.minute(),
-                dateTimeFieldsState.hasSecond() ? dateTimeFieldsState.second() : 0,
-                dateTimeFieldsState.millisecond());
-    if (dateTimeFieldsState.hasSecond() && dateTimeFieldsState.second())
+            dateTimeFieldsState.hour23(),
+            dateTimeFieldsState.minute(),
+            dateTimeFieldsState.hasSecond() ? dateTimeFieldsState.second() : 0,
+            dateTimeFieldsState.millisecond());
+    }
+    if (dateTimeFieldsState.hasSecond() && dateTimeFieldsState.second()) {
         return String::format("%02u:%02u:%02u",
-                dateTimeFieldsState.hour23(),
-                dateTimeFieldsState.minute(),
-                dateTimeFieldsState.second());
+            dateTimeFieldsState.hour23(),
+            dateTimeFieldsState.minute(),
+            dateTimeFieldsState.second());
+    }
     return String::format("%02u:%02u", dateTimeFieldsState.hour23(), dateTimeFieldsState.minute());
 }
 
diff --git a/Source/core/html/TimeInputType.h b/Source/core/html/forms/TimeInputType.h
similarity index 95%
rename from Source/core/html/TimeInputType.h
rename to Source/core/html/forms/TimeInputType.h
index 166bcd5..dfccfa1 100644
--- a/Source/core/html/TimeInputType.h
+++ b/Source/core/html/forms/TimeInputType.h
@@ -31,8 +31,8 @@
 #ifndef TimeInputType_h
 #define TimeInputType_h
 
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/TypeAhead.cpp b/Source/core/html/forms/TypeAhead.cpp
similarity index 97%
rename from Source/core/html/TypeAhead.cpp
rename to Source/core/html/forms/TypeAhead.cpp
index d93541f..e9a0052 100644
--- a/Source/core/html/TypeAhead.cpp
+++ b/Source/core/html/forms/TypeAhead.cpp
@@ -26,9 +26,9 @@
  */
 
 #include "config.h"
-#include "core/html/TypeAhead.h"
+#include "core/html/forms/TypeAhead.h"
 
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "wtf/unicode/CharacterNames.h"
 
 using namespace WTF::Unicode;
@@ -87,8 +87,9 @@
         if (m_buffer.length() > 1) {
             m_repeatingChar = 0;
             searchStartOffset = 0;
-        } else
+        } else {
             m_repeatingChar = c;
+        }
     }
 
     if (!prefix.isEmpty()) {
diff --git a/Source/core/html/TypeAhead.h b/Source/core/html/forms/TypeAhead.h
similarity index 100%
rename from Source/core/html/TypeAhead.h
rename to Source/core/html/forms/TypeAhead.h
diff --git a/Source/core/html/URLInputType.cpp b/Source/core/html/forms/URLInputType.cpp
similarity index 91%
rename from Source/core/html/URLInputType.cpp
rename to Source/core/html/forms/URLInputType.cpp
index a84fd2f..a97a70e 100644
--- a/Source/core/html/URLInputType.cpp
+++ b/Source/core/html/forms/URLInputType.cpp
@@ -29,11 +29,11 @@
  */
 
 #include "config.h"
-#include "core/html/URLInputType.h"
+#include "core/html/forms/URLInputType.h"
 
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
-#include "core/platform/LocalizedStrings.h"
+#include "core/html/forms/InputTypeNames.h"
+#include "core/platform/text/PlatformLocale.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
@@ -65,7 +65,7 @@
 
 String URLInputType::typeMismatchText() const
 {
-    return validationMessageTypeMismatchForURLText();
+    return locale().queryString(WebKit::WebLocalizedString::ValidationTypeMismatchForURL);
 }
 
 bool URLInputType::isURLField() const
diff --git a/Source/core/html/URLInputType.h b/Source/core/html/forms/URLInputType.h
similarity index 97%
rename from Source/core/html/URLInputType.h
rename to Source/core/html/forms/URLInputType.h
index d7ac3a9..7c310b5 100644
--- a/Source/core/html/URLInputType.h
+++ b/Source/core/html/forms/URLInputType.h
@@ -31,7 +31,7 @@
 #ifndef URLInputType_h
 #define URLInputType_h
 
-#include "core/html/BaseTextInputType.h"
+#include "core/html/forms/BaseTextInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/ValidationMessage.cpp b/Source/core/html/forms/ValidationMessage.cpp
similarity index 98%
rename from Source/core/html/ValidationMessage.cpp
rename to Source/core/html/forms/ValidationMessage.cpp
index faa67e2..57ee0eb 100644
--- a/Source/core/html/ValidationMessage.cpp
+++ b/Source/core/html/forms/ValidationMessage.cpp
@@ -29,7 +29,7 @@
  */
 
 #include "config.h"
-#include "core/html/ValidationMessage.h"
+#include "core/html/forms/ValidationMessage.h"
 
 #include "core/html/HTMLFormControlElement.h"
 #include "core/page/Page.h"
diff --git a/Source/core/html/ValidationMessage.h b/Source/core/html/forms/ValidationMessage.h
similarity index 100%
rename from Source/core/html/ValidationMessage.h
rename to Source/core/html/forms/ValidationMessage.h
diff --git a/Source/core/html/WeekInputType.cpp b/Source/core/html/forms/WeekInputType.cpp
similarity index 96%
rename from Source/core/html/WeekInputType.cpp
rename to Source/core/html/forms/WeekInputType.cpp
index bdffd0d..dd1cc4d 100644
--- a/Source/core/html/WeekInputType.cpp
+++ b/Source/core/html/forms/WeekInputType.cpp
@@ -29,19 +29,16 @@
  */
 
 #include "config.h"
-#include "core/html/WeekInputType.h"
+#include "core/html/forms/WeekInputType.h"
 
 #include "HTMLNames.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/DateTimeFieldsState.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/platform/DateComponents.h"
-#include "wtf/PassOwnPtr.h"
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/DateTimeFieldsState.h"
 #include "core/platform/LocalizedStrings.h"
+#include "wtf/PassOwnPtr.h"
 #include "wtf/text/WTFString.h"
-#endif
 
 namespace WebCore {
 
diff --git a/Source/core/html/WeekInputType.h b/Source/core/html/forms/WeekInputType.h
similarity index 95%
rename from Source/core/html/WeekInputType.h
rename to Source/core/html/forms/WeekInputType.h
index 418d2f5..0450eb1 100644
--- a/Source/core/html/WeekInputType.h
+++ b/Source/core/html/forms/WeekInputType.h
@@ -31,8 +31,8 @@
 #ifndef WeekInputType_h
 #define WeekInputType_h
 
-#include "core/html/BaseChooserOnlyDateAndTimeInputType.h"
-#include "core/html/BaseMultipleFieldsDateAndTimeInputType.h"
+#include "core/html/forms/BaseChooserOnlyDateAndTimeInputType.h"
+#include "core/html/forms/BaseMultipleFieldsDateAndTimeInputType.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/parser/CSSPreloadScanner.cpp b/Source/core/html/parser/CSSPreloadScanner.cpp
index 10ab28d..af3ff09 100644
--- a/Source/core/html/parser/CSSPreloadScanner.cpp
+++ b/Source/core/html/parser/CSSPreloadScanner.cpp
@@ -84,7 +84,7 @@
     // Searching for other types of resources is probably low payoff.
     switch (m_state) {
     case Initial:
-        if (isHTMLSpace(c))
+        if (isHTMLSpace<UChar>(c))
             break;
         if (c == '@')
             m_state = RuleStart;
@@ -121,7 +121,7 @@
             m_state = Initial;
         break;
     case Rule:
-        if (isHTMLSpace(c))
+        if (isHTMLSpace<UChar>(c))
             m_state = AfterRule;
         else if (c == ';')
             m_state = Initial;
@@ -129,7 +129,7 @@
             m_rule.append(c);
         break;
     case AfterRule:
-        if (isHTMLSpace(c))
+        if (isHTMLSpace<UChar>(c))
             break;
         if (c == ';')
             m_state = Initial;
@@ -141,7 +141,7 @@
         }
         break;
     case RuleValue:
-        if (isHTMLSpace(c))
+        if (isHTMLSpace<UChar>(c))
             m_state = AfterRuleValue;
         else if (c == ';')
             emitRule(source);
@@ -149,7 +149,7 @@
             m_ruleValue.append(c);
         break;
     case AfterRuleValue:
-        if (isHTMLSpace(c))
+        if (isHTMLSpace<UChar>(c))
             break;
         if (c == ';')
             emitRule(source);
@@ -171,11 +171,11 @@
     size_t offset = 0;
     size_t reducedLength = string.length();
 
-    while (reducedLength && isHTMLSpace(string[offset])) {
+    while (reducedLength && isHTMLSpace<UChar>(string[offset])) {
         ++offset;
         --reducedLength;
     }
-    while (reducedLength && isHTMLSpace(string[offset + reducedLength - 1]))
+    while (reducedLength && isHTMLSpace<UChar>(string[offset + reducedLength - 1]))
         --reducedLength;
 
     if (reducedLength >= 5
@@ -188,11 +188,11 @@
         reducedLength -= 5;
     }
 
-    while (reducedLength && isHTMLSpace(string[offset])) {
+    while (reducedLength && isHTMLSpace<UChar>(string[offset])) {
         ++offset;
         --reducedLength;
     }
-    while (reducedLength && isHTMLSpace(string[offset + reducedLength - 1]))
+    while (reducedLength && isHTMLSpace<UChar>(string[offset + reducedLength - 1]))
         --reducedLength;
 
     if (reducedLength < 2 || string[offset] != string[offset + reducedLength - 1] || !(string[offset] == '\'' || string[offset] == '"'))
@@ -200,11 +200,11 @@
     offset++;
     reducedLength -= 2;
 
-    while (reducedLength && isHTMLSpace(string[offset])) {
+    while (reducedLength && isHTMLSpace<UChar>(string[offset])) {
         ++offset;
         --reducedLength;
     }
-    while (reducedLength && isHTMLSpace(string[offset + reducedLength - 1]))
+    while (reducedLength && isHTMLSpace<UChar>(string[offset + reducedLength - 1]))
         --reducedLength;
 
     return string.substring(offset, reducedLength);
diff --git a/Source/core/html/parser/HTMLConstructionSite.cpp b/Source/core/html/parser/HTMLConstructionSite.cpp
index ddf3ed4..169f067 100644
--- a/Source/core/html/parser/HTMLConstructionSite.cpp
+++ b/Source/core/html/parser/HTMLConstructionSite.cpp
@@ -84,7 +84,7 @@
 
 static inline bool isAllWhitespace(const String& string)
 {
-    return string.isAllSpecialCharacters<isHTMLSpace>();
+    return string.isAllSpecialCharacters<isHTMLSpace<UChar> >();
 }
 
 static inline void insert(HTMLConstructionSiteTask& task)
diff --git a/Source/core/html/parser/HTMLDocumentParser.cpp b/Source/core/html/parser/HTMLDocumentParser.cpp
index 7fdef89..e377ee6 100644
--- a/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -559,7 +559,7 @@
     if (isWaitingForScripts()) {
         ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
         if (!m_preloadScanner) {
-            m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url()));
+            m_preloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url(), document()->devicePixelRatio()));
             m_preloadScanner->appendToEnd(m_input.current());
         }
         m_preloadScanner->scan(m_preloader.get(), document()->baseElementURL());
@@ -634,7 +634,8 @@
         // Check the document.write() output with a separate preload scanner as
         // the main scanner can't deal with insertions.
         if (!m_insertionPreloadScanner)
-            m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url()));
+            m_insertionPreloadScanner = adoptPtr(new HTMLPreloadScanner(m_options, document()->url(), document()->devicePixelRatio()));
+
         m_insertionPreloadScanner->appendToEnd(source);
         m_insertionPreloadScanner->scan(m_preloader.get(), document()->baseElementURL());
     }
@@ -658,7 +659,7 @@
     config->parser = m_weakFactory.createWeakPtr();
     config->xssAuditor = adoptPtr(new XSSAuditor);
     config->xssAuditor->init(document(), &m_xssAuditorDelegate);
-    config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy()));
+    config->preloadScanner = adoptPtr(new TokenPreloadScanner(document()->url().copy(), document()->devicePixelRatio()));
 
     ASSERT(config->xssAuditor->isSafeToSendToAnotherThread());
     ASSERT(config->preloadScanner->isSafeToSendToAnotherThread());
diff --git a/Source/core/html/parser/HTMLFormattingElementList.cpp b/Source/core/html/parser/HTMLFormattingElementList.cpp
index de76f9b..34215d7 100644
--- a/Source/core/html/parser/HTMLFormattingElementList.cpp
+++ b/Source/core/html/parser/HTMLFormattingElementList.cpp
@@ -65,7 +65,7 @@
 HTMLFormattingElementList::Entry* HTMLFormattingElementList::find(Element* element)
 {
     size_t index = m_entries.reverseFind(element);
-    if (index != notFound) {
+    if (index != kNotFound) {
         // This is somewhat of a hack, and is why this method can't be const.
         return &m_entries[index];
     }
@@ -75,7 +75,7 @@
 HTMLFormattingElementList::Bookmark HTMLFormattingElementList::bookmarkFor(Element* element)
 {
     size_t index = m_entries.reverseFind(element);
-    ASSERT(index != notFound);
+    ASSERT(index != kNotFound);
     return Bookmark(&at(index));
 }
 
@@ -103,7 +103,7 @@
 void HTMLFormattingElementList::remove(Element* element)
 {
     size_t index = m_entries.reverseFind(element);
-    if (index != notFound)
+    if (index != kNotFound)
         m_entries.remove(index);
 }
 
diff --git a/Source/core/html/parser/HTMLMetaCharsetParser.cpp b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
index 0319fce..7f3c34d 100644
--- a/Source/core/html/parser/HTMLMetaCharsetParser.cpp
+++ b/Source/core/html/parser/HTMLMetaCharsetParser.cpp
@@ -62,7 +62,7 @@
 
     while (pos < length) {
         pos = value.find(charsetString, pos, false);
-        if (pos == notFound)
+        if (pos == kNotFound)
             break;
 
         pos += charsetLength;
diff --git a/Source/core/html/parser/HTMLParserIdioms.cpp b/Source/core/html/parser/HTMLParserIdioms.cpp
index 6f13630..493627c 100644
--- a/Source/core/html/parser/HTMLParserIdioms.cpp
+++ b/Source/core/html/parser/HTMLParserIdioms.cpp
@@ -36,13 +36,13 @@
 namespace WebCore {
 
 template <typename CharType>
-static String stripLeadingAndTrailingHTMLSpaces(String string, CharType characters, unsigned length)
+static String stripLeadingAndTrailingHTMLSpaces(String string, const CharType* characters, unsigned length)
 {
     unsigned numLeadingSpaces = 0;
     unsigned numTrailingSpaces = 0;
 
     for (; numLeadingSpaces < length; ++numLeadingSpaces) {
-        if (isNotHTMLSpace(characters[numLeadingSpaces]))
+        if (isNotHTMLSpace<CharType>(characters[numLeadingSpaces]))
             break;
     }
 
@@ -50,7 +50,7 @@
         return string.isNull() ? string : emptyAtom.string();
 
     for (; numTrailingSpaces < length; ++numTrailingSpaces) {
-        if (isNotHTMLSpace(characters[length - numTrailingSpaces - 1]))
+        if (isNotHTMLSpace<CharType>(characters[length - numTrailingSpaces - 1]))
             break;
     }
 
@@ -70,9 +70,9 @@
         return string.isNull() ? string : emptyAtom.string();
 
     if (string.is8Bit())
-        return stripLeadingAndTrailingHTMLSpaces(string, string.characters8(), length);
+        return stripLeadingAndTrailingHTMLSpaces<LChar>(string, string.characters8(), length);
 
-    return stripLeadingAndTrailingHTMLSpaces(string, string.characters16(), length);
+    return stripLeadingAndTrailingHTMLSpaces<UChar>(string, string.characters16(), length);
 }
 
 String serializeForNumberType(const Decimal& number)
@@ -160,7 +160,7 @@
 
     // Step 4
     while (position < end) {
-        if (!isHTMLSpace(*position))
+        if (!isHTMLSpace<CharacterType>(*position))
             break;
         ++position;
     }
@@ -221,7 +221,7 @@
 {
     // Step 3
     while (position < end) {
-        if (!isHTMLSpace(*position))
+        if (!isHTMLSpace<CharacterType>(*position))
             break;
         ++position;
     }
diff --git a/Source/core/html/parser/HTMLParserIdioms.h b/Source/core/html/parser/HTMLParserIdioms.h
index 68c7ded..5c3e9df 100644
--- a/Source/core/html/parser/HTMLParserIdioms.h
+++ b/Source/core/html/parser/HTMLParserIdioms.h
@@ -67,7 +67,8 @@
 
 // Inline implementations of some of the functions declared above.
 
-inline bool isHTMLSpace(UChar character)
+template<typename CharType>
+inline bool isHTMLSpace(CharType character)
 {
     // Histogram from Apple's page load test combined with some ad hoc browsing some other test suites.
     //
@@ -82,14 +83,21 @@
     return character <= ' ' && (character == ' ' || character == '\n' || character == '\t' || character == '\r' || character == '\f');
 }
 
+template<typename CharType>
+inline bool isHTMLSpaceOrComma(CharType character)
+{
+    return isHTMLSpace<CharType>(character) || character == ',';
+}
+
 inline bool isHTMLLineBreak(UChar character)
 {
     return character <= '\r' && (character == '\n' || character == '\r');
 }
 
-inline bool isNotHTMLSpace(UChar character)
+template<typename CharType>
+inline bool isNotHTMLSpace(CharType character)
 {
-    return !isHTMLSpace(character);
+    return !isHTMLSpace<CharType>(character);
 }
 
 bool threadSafeMatch(const QualifiedName&, const QualifiedName&);
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp
index 0b51791..e4a3abb 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -29,9 +29,11 @@
 #include "core/html/parser/HTMLPreloadScanner.h"
 
 #include "HTMLNames.h"
-#include "core/html/InputTypeNames.h"
+#include "RuntimeEnabledFeatures.h"
 #include "core/html/LinkRelAttribute.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
+#include "core/html/parser/HTMLSrcsetParser.h"
 #include "core/html/parser/HTMLTokenizer.h"
 #include "core/platform/chromium/TraceEvent.h"
 #include "wtf/MainThread.h"
@@ -90,10 +92,12 @@
 
 class TokenPreloadScanner::StartTagScanner {
 public:
-    explicit StartTagScanner(const StringImpl* tagImpl)
+    StartTagScanner(const StringImpl* tagImpl, float deviceScaleFactor)
         : m_tagImpl(tagImpl)
         , m_linkIsStyleSheet(false)
         , m_inputIsImage(false)
+        , m_deviceScaleFactor(deviceScaleFactor)
+        , m_encounteredImgSrc(false)
     {
         if (!match(m_tagImpl, imgTag)
             && !match(m_tagImpl, inputTag)
@@ -102,6 +106,11 @@
             m_tagImpl = 0;
     }
 
+    enum URLReplacement {
+        AllowURLReplacement,
+        DisallowURLReplacement
+    };
+
     void processAttributes(const HTMLToken::AttributeList& attributes)
     {
         ASSERT(isMainThread());
@@ -142,21 +151,33 @@
         if (match(attributeName, charsetAttr))
             m_charset = attributeValue;
 
-        if (match(m_tagImpl, scriptTag) || match(m_tagImpl, imgTag)) {
+        if (match(m_tagImpl, scriptTag)) {
             if (match(attributeName, srcAttr))
-                setUrlToLoad(attributeValue);
+                setUrlToLoad(attributeValue, DisallowURLReplacement);
             else if (match(attributeName, crossoriginAttr) && !attributeValue.isNull())
                 m_crossOriginMode = stripLeadingAndTrailingHTMLSpaces(attributeValue);
+        } else if (match(m_tagImpl, imgTag)) {
+            if (match(attributeName, srcAttr) && !m_encounteredImgSrc) {
+                m_encounteredImgSrc = true;
+                setUrlToLoad(bestFitSourceForImageAttributes(m_deviceScaleFactor, attributeValue, m_srcsetImageCandidate), AllowURLReplacement);
+            } else if (match(attributeName, crossoriginAttr) && !attributeValue.isNull()) {
+                m_crossOriginMode = stripLeadingAndTrailingHTMLSpaces(attributeValue);
+            } else if (RuntimeEnabledFeatures::srcsetEnabled()
+                && match(attributeName, srcsetAttr)
+                && m_srcsetImageCandidate.isEmpty()) {
+                m_srcsetImageCandidate = bestFitSourceForSrcsetAttribute(m_deviceScaleFactor, attributeValue);
+                setUrlToLoad(bestFitSourceForImageAttributes(m_deviceScaleFactor, m_urlToLoad, m_srcsetImageCandidate), AllowURLReplacement);
+            }
         } else if (match(m_tagImpl, linkTag)) {
             if (match(attributeName, hrefAttr))
-                setUrlToLoad(attributeValue);
+                setUrlToLoad(attributeValue, DisallowURLReplacement);
             else if (match(attributeName, relAttr))
                 m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue);
             else if (match(attributeName, mediaAttr))
                 m_mediaAttribute = attributeValue;
         } else if (match(m_tagImpl, inputTag)) {
             if (match(attributeName, srcAttr))
-                setUrlToLoad(attributeValue);
+                setUrlToLoad(attributeValue, DisallowURLReplacement);
             else if (match(attributeName, typeAttr))
                 m_inputIsImage = equalIgnoringCase(attributeValue, InputTypeNames::image());
         }
@@ -168,13 +189,16 @@
         return rel.isStyleSheet() && !rel.isAlternate() && rel.iconType() == InvalidIcon && !rel.isDNSPrefetch();
     }
 
-    void setUrlToLoad(const String& attributeValue)
+    void setUrlToLoad(const String& value, URLReplacement replacement)
     {
         // We only respect the first src/href, per HTML5:
         // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#attribute-name-state
-        if (!m_urlToLoad.isEmpty())
+        if (replacement == DisallowURLReplacement && !m_urlToLoad.isEmpty())
             return;
-        m_urlToLoad = stripLeadingAndTrailingHTMLSpaces(attributeValue);
+        String url = stripLeadingAndTrailingHTMLSpaces(value);
+        if (url.isEmpty())
+            return;
+        m_urlToLoad = url;
     }
 
     const String& charset() const
@@ -215,16 +239,20 @@
 
     const StringImpl* m_tagImpl;
     String m_urlToLoad;
+    ImageCandidate m_srcsetImageCandidate;
     String m_charset;
     String m_crossOriginMode;
     bool m_linkIsStyleSheet;
     String m_mediaAttribute;
     bool m_inputIsImage;
+    float m_deviceScaleFactor;
+    bool m_encounteredImgSrc;
 };
 
-TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL)
+TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL, float deviceScaleFactor)
     : m_documentURL(documentURL)
     , m_inStyle(false)
+    , m_deviceScaleFactor(deviceScaleFactor)
     , m_templateCount(0)
 {
 }
@@ -305,7 +333,7 @@
             return;
         }
 
-        StartTagScanner scanner(tagImpl);
+        StartTagScanner scanner(tagImpl, m_deviceScaleFactor);
         scanner.processAttributes(token.attributes());
         OwnPtr<PreloadRequest> request = scanner.createPreloadRequest(m_predictedBaseElementURL, source);
         if (request)
@@ -326,8 +354,8 @@
         m_predictedBaseElementURL = KURL(m_documentURL, stripLeadingAndTrailingHTMLSpaces(hrefAttribute->value)).copy();
 }
 
-HTMLPreloadScanner::HTMLPreloadScanner(const HTMLParserOptions& options, const KURL& documentURL)
-    : m_scanner(documentURL)
+HTMLPreloadScanner::HTMLPreloadScanner(const HTMLParserOptions& options, const KURL& documentURL, float deviceScaleFactor)
+    : m_scanner(documentURL, deviceScaleFactor)
     , m_tokenizer(HTMLTokenizer::create(options))
 {
 }
diff --git a/Source/core/html/parser/HTMLPreloadScanner.h b/Source/core/html/parser/HTMLPreloadScanner.h
index ba63bab..50366d1 100644
--- a/Source/core/html/parser/HTMLPreloadScanner.h
+++ b/Source/core/html/parser/HTMLPreloadScanner.h
@@ -44,7 +44,7 @@
 class TokenPreloadScanner {
     WTF_MAKE_NONCOPYABLE(TokenPreloadScanner); WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit TokenPreloadScanner(const KURL& documentURL);
+    TokenPreloadScanner(const KURL& documentURL, float deviceScaleFactor);
     ~TokenPreloadScanner();
 
     void scan(const HTMLToken&, const SegmentedString&, PreloadRequestStream& requests);
@@ -89,6 +89,7 @@
     const KURL m_documentURL;
     KURL m_predictedBaseElementURL;
     bool m_inStyle;
+    float m_deviceScaleFactor;
     size_t m_templateCount;
 
     Vector<Checkpoint> m_checkpoints;
@@ -97,7 +98,7 @@
 class HTMLPreloadScanner {
     WTF_MAKE_NONCOPYABLE(HTMLPreloadScanner); WTF_MAKE_FAST_ALLOCATED;
 public:
-    HTMLPreloadScanner(const HTMLParserOptions&, const KURL& documentURL);
+    HTMLPreloadScanner(const HTMLParserOptions&, const KURL& documentURL, float deviceScaleFactor);
     ~HTMLPreloadScanner();
 
     void appendToEnd(const SegmentedString&);
diff --git a/Source/core/html/parser/HTMLScriptRunner.cpp b/Source/core/html/parser/HTMLScriptRunner.cpp
index f03d204..ea8411c 100644
--- a/Source/core/html/parser/HTMLScriptRunner.cpp
+++ b/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -28,7 +28,7 @@
 
 #include "bindings/v8/ScriptSourceCode.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/IgnoreDestructiveWriteCountIncrementer.h"
 #include "core/dom/Microtask.h"
 #include "core/dom/ScriptLoader.h"
diff --git a/Source/core/html/parser/HTMLSrcsetParser.cpp b/Source/core/html/parser/HTMLSrcsetParser.cpp
new file mode 100644
index 0000000..40c95a1
--- /dev/null
+++ b/Source/core/html/parser/HTMLSrcsetParser.cpp
@@ -0,0 +1,186 @@
+/*
+ * 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.
+ */
+
+#include "config.h"
+#include "core/html/parser/HTMLSrcsetParser.h"
+
+#include "core/html/parser/HTMLParserIdioms.h"
+#include "core/platform/ParsingUtilities.h"
+
+namespace WebCore {
+
+static bool compareByScaleFactor(const ImageCandidate& first, const ImageCandidate& second)
+{
+    return first.scaleFactor() < second.scaleFactor();
+}
+
+template<typename CharType>
+inline bool isComma(CharType character)
+{
+    return character == ',';
+}
+
+template<typename CharType>
+static bool parseDescriptors(const CharType* descriptorsStart, const CharType* descriptorsEnd, float& imgScaleFactor)
+{
+    const CharType* position = descriptorsStart;
+    bool isValid = true;
+    bool isScaleFactorFound = false;
+    while (position < descriptorsEnd) {
+        // 13.1. Let descriptor list be the result of splitting unparsed descriptors on spaces.
+        skipWhile<CharType, isHTMLSpace<CharType> >(position, descriptorsEnd);
+        const CharType* currentDescriptorStart = position;
+        skipWhile<CharType, isNotHTMLSpace<CharType> >(position, descriptorsEnd);
+        const CharType* currentDescriptorEnd = position;
+
+        ++position;
+        ASSERT(currentDescriptorEnd > currentDescriptorStart);
+        --currentDescriptorEnd;
+        unsigned descriptorLength = currentDescriptorEnd - currentDescriptorStart;
+        if (*currentDescriptorEnd == 'x') {
+            if (isScaleFactorFound)
+                return false;
+            imgScaleFactor = charactersToFloat(currentDescriptorStart, descriptorLength, &isValid);
+            isScaleFactorFound = true;
+        } else {
+            continue;
+        }
+    }
+    return isValid;
+}
+
+// http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#processing-the-image-candidates
+template<typename CharType>
+static void parseImageCandidatesFromSrcsetAttribute(const String& attribute, const CharType* attributeStart, unsigned length, Vector<ImageCandidate>& imageCandidates)
+{
+    const CharType* position = attributeStart;
+    const CharType* attributeEnd = position + length;
+
+    while (position < attributeEnd) {
+        float imgScaleFactor = 1.0;
+
+        // 4. Splitting loop: Skip whitespace.
+        skipWhile<CharType, isHTMLSpace<CharType> >(position, attributeEnd);
+        if (position == attributeEnd)
+            break;
+        const CharType* imageURLStart = position;
+
+        // If The current candidate is either totally empty or only contains space, skipping.
+        if (*position == ',') {
+            ++position;
+            continue;
+        }
+
+        // 5. Collect a sequence of characters that are not space characters, and let that be url.
+        skipUntil<CharType, isHTMLSpace<CharType> >(position, attributeEnd);
+        const CharType* imageURLEnd = position;
+
+        if (position != attributeEnd && *(position - 1) == ',') {
+            --imageURLEnd;
+        } else {
+            // 7. Collect a sequence of characters that are not "," (U+002C) characters, and let that be descriptors.
+            skipWhile<CharType, isHTMLSpace<CharType> >(position, attributeEnd);
+            const CharType* descriptorsStart = position;
+            skipUntil<CharType, isComma<CharType> >(position, attributeEnd);
+            const CharType* descriptorsEnd = position;
+            if (!parseDescriptors(descriptorsStart, descriptorsEnd, imgScaleFactor))
+                continue;
+        }
+
+        imageCandidates.append(ImageCandidate(attribute, imageURLStart - attributeStart, imageURLEnd - imageURLStart, imgScaleFactor));
+        // 11. Return to the step labeled splitting loop.
+    }
+}
+
+static void parseImageCandidatesFromSrcsetAttribute(const String& attribute, Vector<ImageCandidate>& imageCandidates)
+{
+    if (attribute.isNull())
+        return;
+
+    if (attribute.is8Bit())
+        parseImageCandidatesFromSrcsetAttribute<LChar>(attribute, attribute.characters8(), attribute.length(), imageCandidates);
+    else
+        parseImageCandidatesFromSrcsetAttribute<UChar>(attribute, attribute.characters16(), attribute.length(), imageCandidates);
+}
+
+static ImageCandidate pickBestImageCandidate(float deviceScaleFactor, Vector<ImageCandidate>& imageCandidates)
+{
+    if (imageCandidates.isEmpty())
+        return ImageCandidate();
+
+    std::stable_sort(imageCandidates.begin(), imageCandidates.end(), compareByScaleFactor);
+
+    unsigned i;
+    for (i = 0; i < imageCandidates.size() - 1; ++i) {
+        if (imageCandidates[i].scaleFactor() >= deviceScaleFactor)
+            break;
+    }
+    return imageCandidates[i];
+}
+
+ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const String& srcsetAttribute)
+{
+    Vector<ImageCandidate> imageCandidates;
+
+    parseImageCandidatesFromSrcsetAttribute(srcsetAttribute, imageCandidates);
+
+    return pickBestImageCandidate(deviceScaleFactor, imageCandidates);
+}
+
+String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, const String& srcsetAttribute)
+{
+    if (srcsetAttribute.isNull())
+        return srcAttribute;
+
+    Vector<ImageCandidate> imageCandidates;
+
+    parseImageCandidatesFromSrcsetAttribute(srcsetAttribute, imageCandidates);
+
+    if (!srcAttribute.isEmpty())
+        imageCandidates.append(ImageCandidate(srcAttribute, 0, srcAttribute.length(), 1.0));
+
+    return pickBestImageCandidate(deviceScaleFactor, imageCandidates).toString();
+}
+
+String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, ImageCandidate& srcsetImageCandidate)
+{
+    if (srcsetImageCandidate.isEmpty())
+        return srcAttribute;
+
+    Vector<ImageCandidate> imageCandidates;
+    imageCandidates.append(srcsetImageCandidate);
+
+    if (!srcAttribute.isEmpty())
+        imageCandidates.append(ImageCandidate(srcAttribute, 0, srcAttribute.length(), 1.0));
+
+    return pickBestImageCandidate(deviceScaleFactor, imageCandidates).toString();
+}
+
+}
diff --git a/Source/core/dom/PromiseResolver.h b/Source/core/html/parser/HTMLSrcsetParser.h
similarity index 60%
rename from Source/core/dom/PromiseResolver.h
rename to Source/core/html/parser/HTMLSrcsetParser.h
index 664018a..bb53cb8 100644
--- a/Source/core/dom/PromiseResolver.h
+++ b/Source/core/html/parser/HTMLSrcsetParser.h
@@ -28,19 +28,52 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// FIXME: This file should be deleted.
-#ifndef PromiseResolver_h
-#define PromiseResolver_h
+#ifndef HTMLSrcsetParser_h
+#define HTMLSrcsetParser_h
 
-#include "wtf/RefCounted.h"
+#include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
-// An empty class. This is here because a generated file use it.
-class PromiseResolver : public RefCounted<PromiseResolver> {
+class ImageCandidate {
+public:
+    ImageCandidate()
+        : m_scaleFactor(1.0)
+    {
+    }
+
+    ImageCandidate(const String& source, unsigned start, unsigned length, float scaleFactor)
+        : m_string(source.createView(start, length))
+        , m_scaleFactor(scaleFactor)
+    {
+    }
+
+    String toString() const
+    {
+        return m_string.toString();
+    }
+
+    inline float scaleFactor() const
+    {
+        return m_scaleFactor;
+    }
+
+    inline bool isEmpty() const
+    {
+        return m_string.isEmpty();
+    }
+
+private:
+    StringView m_string;
+    float m_scaleFactor;
 };
 
-} // namespace WebCore
+ImageCandidate bestFitSourceForSrcsetAttribute(float deviceScaleFactor, const String& srcsetAttribute);
 
+String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, const String& srcsetAttribute);
 
-#endif // PromiseResolver_h
+String bestFitSourceForImageAttributes(float deviceScaleFactor, const String& srcAttribute, ImageCandidate& srcsetImageCandidate);
+
+}
+
+#endif
diff --git a/Source/core/html/parser/HTMLTreeBuilder.cpp b/Source/core/html/parser/HTMLTreeBuilder.cpp
index 1d887d7..ac516a2 100644
--- a/Source/core/html/parser/HTMLTreeBuilder.cpp
+++ b/Source/core/html/parser/HTMLTreeBuilder.cpp
@@ -59,7 +59,7 @@
 
 inline bool isHTMLSpaceOrReplacementCharacter(UChar character)
 {
-    return isHTMLSpace(character) || character == replacementCharacter;
+    return isHTMLSpace<UChar>(character) || character == replacementCharacter;
 }
 
 }
@@ -71,7 +71,7 @@
 
 static inline bool isAllWhitespace(const String& string)
 {
-    return string.isAllSpecialCharacters<isHTMLSpace>();
+    return string.isAllSpecialCharacters<isHTMLSpace<UChar> >();
 }
 
 static inline bool isAllWhitespaceOrReplacementCharacters(const String& string)
@@ -185,17 +185,17 @@
 
     void skipLeadingWhitespace()
     {
-        skipLeading<isHTMLSpace>();
+        skipLeading<isHTMLSpace<UChar> >();
     }
 
     String takeLeadingWhitespace()
     {
-        return takeLeading<isHTMLSpace>();
+        return takeLeading<isHTMLSpace<UChar> >();
     }
 
     void skipLeadingNonWhitespace()
     {
-        skipLeading<isNotHTMLSpace>();
+        skipLeading<isNotHTMLSpace<UChar> >();
     }
 
     String takeRemaining()
@@ -224,7 +224,7 @@
 
         unsigned length = 0;
         for (unsigned i = start; i < m_end; ++i) {
-            if (isHTMLSpace((*m_characters)[i]))
+            if (isHTMLSpace<UChar>((*m_characters)[i]))
                 ++length;
         }
         // Returning the null string when there aren't any whitespace
@@ -239,7 +239,7 @@
         result.reserveCapacity(length);
         for (unsigned i = start; i < m_end; ++i) {
             UChar c = (*m_characters)[i];
-            if (isHTMLSpace(c))
+            if (isHTMLSpace<UChar>(c))
                 result.append(c);
         }
 
diff --git a/Source/core/mathml/mathattrs.in b/Source/core/html/parser/MathMLAttributeNames.in
similarity index 100%
rename from Source/core/mathml/mathattrs.in
rename to Source/core/html/parser/MathMLAttributeNames.in
diff --git a/Source/core/mathml/mathtags.in b/Source/core/html/parser/MathMLTagNames.in
similarity index 63%
rename from Source/core/mathml/mathtags.in
rename to Source/core/html/parser/MathMLTagNames.in
index 95688e1..80d830f 100644
--- a/Source/core/mathml/mathtags.in
+++ b/Source/core/html/parser/MathMLTagNames.in
@@ -6,10 +6,7 @@
 mn
 mo
 mtext
-
-#if 0 // Curently only for MathMLNames used by HTMLTreeBuilder.
 ms
 mglyph
 malignmark
 annotation-xml
-#endif
diff --git a/Source/core/html/parser/XSSAuditor.cpp b/Source/core/html/parser/XSSAuditor.cpp
index a7646ac..3cb8c12 100644
--- a/Source/core/html/parser/XSSAuditor.cpp
+++ b/Source/core/html/parser/XSSAuditor.cpp
@@ -261,7 +261,7 @@
         m_encoding = document->encoding();
 
     m_decodedURL = fullyDecodeString(m_documentURL.string(), m_encoding);
-    if (m_decodedURL.find(isRequiredForInjection) == notFound)
+    if (m_decodedURL.find(isRequiredForInjection) == kNotFound)
         m_decodedURL = String();
 
     String httpBodyAsString;
@@ -299,7 +299,7 @@
             httpBodyAsString = httpBody->flattenToString();
             if (!httpBodyAsString.isEmpty()) {
                 m_decodedHTTPBody = fullyDecodeString(httpBodyAsString, m_encoding);
-                if (m_decodedHTTPBody.find(isRequiredForInjection) == notFound)
+                if (m_decodedHTTPBody.find(isRequiredForInjection) == kNotFound)
                     m_decodedHTTPBody = String();
                 if (m_decodedHTTPBody.length() >= miniumLengthForSuffixTree)
                     m_decodedHTTPBodySuffixTree = adoptPtr(new SuffixTree<ASCIICodebook>(m_decodedHTTPBody, suffixTreeDepth));
@@ -611,9 +611,9 @@
         // !-- following a less-than sign. We stop instead on any ampersand
         // slash, or less-than sign.
         size_t position = 0;
-        if ((position = decodedSnippet.find("=")) != notFound
-            && (position = decodedSnippet.find(isNotHTMLSpace, position + 1)) != notFound
-            && (position = decodedSnippet.find(isTerminatingCharacter, isHTMLQuote(decodedSnippet[position]) ? position + 1 : position)) != notFound) {
+        if ((position = decodedSnippet.find("=")) != kNotFound
+            && (position = decodedSnippet.find(isNotHTMLSpace<UChar>, position + 1)) != kNotFound
+            && (position = decodedSnippet.find(isTerminatingCharacter, isHTMLQuote(decodedSnippet[position]) ? position + 1 : position)) != kNotFound) {
             decodedSnippet.truncate(position);
         }
     }
@@ -625,11 +625,11 @@
     String string = request.sourceTracker.sourceForToken(request.token);
     size_t startPosition = 0;
     size_t endPosition = string.length();
-    size_t foundPosition = notFound;
+    size_t foundPosition = kNotFound;
 
     // Skip over initial comments to find start of code.
     while (startPosition < endPosition) {
-        while (startPosition < endPosition && isHTMLSpace(string[startPosition]))
+        while (startPosition < endPosition && isHTMLSpace<UChar>(string[startPosition]))
             startPosition++;
 
         // Under SVG/XML rules, only HTML comment syntax matters and the parser returns
@@ -644,7 +644,7 @@
             while (startPosition < endPosition && !isJSNewline(string[startPosition]))
                 startPosition++;
         } else if (startsMultiLineCommentAt(string, startPosition)) {
-            if (startPosition + 2 < endPosition && (foundPosition = string.find("*/", startPosition + 2)) != notFound)
+            if (startPosition + 2 < endPosition && (foundPosition = string.find("*/", startPosition + 2)) != kNotFound)
                 startPosition = foundPosition + 2;
             else
                 startPosition = endPosition;
@@ -672,7 +672,7 @@
                     break;
                 }
             }
-            if (string[foundPosition] == ',' || (foundPosition > startPosition + kMaximumFragmentLengthTarget && isHTMLSpace(string[foundPosition]))) {
+            if (string[foundPosition] == ',' || (foundPosition > startPosition + kMaximumFragmentLengthTarget && isHTMLSpace<UChar>(string[foundPosition]))) {
                 break;
             }
         }
@@ -687,11 +687,11 @@
 {
     if (decodedSnippet.isEmpty())
         return false;
-    if (m_decodedURL.find(decodedSnippet, 0, false) != notFound)
+    if (m_decodedURL.find(decodedSnippet, 0, false) != kNotFound)
         return true;
     if (m_decodedHTTPBodySuffixTree && !m_decodedHTTPBodySuffixTree->mightContain(decodedSnippet))
         return false;
-    return m_decodedHTTPBody.find(decodedSnippet, 0, false) != notFound;
+    return m_decodedHTTPBody.find(decodedSnippet, 0, false) != kNotFound;
 }
 
 bool XSSAuditor::isLikelySafeResource(const String& url)
diff --git a/Source/core/html/shadow/ClearButtonElement.cpp b/Source/core/html/shadow/ClearButtonElement.cpp
index fc91016..e608999 100644
--- a/Source/core/html/shadow/ClearButtonElement.cpp
+++ b/Source/core/html/shadow/ClearButtonElement.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "core/html/shadow/ClearButtonElement.h"
 
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/EventHandler.h"
 #include "core/page/Frame.h"
diff --git a/Source/core/html/shadow/DateTimeEditElement.cpp b/Source/core/html/shadow/DateTimeEditElement.cpp
index c56edae..6f799a9 100644
--- a/Source/core/html/shadow/DateTimeEditElement.cpp
+++ b/Source/core/html/shadow/DateTimeEditElement.cpp
@@ -29,9 +29,9 @@
 
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/Text.h"
-#include "core/html/DateTimeFieldsState.h"
+#include "core/html/forms/DateTimeFieldsState.h"
 #include "core/html/shadow/DateTimeFieldElements.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/platform/DateComponents.h"
diff --git a/Source/core/html/shadow/DateTimeEditElement.h b/Source/core/html/shadow/DateTimeEditElement.h
index ecb06ac..f6a54d7 100644
--- a/Source/core/html/shadow/DateTimeEditElement.h
+++ b/Source/core/html/shadow/DateTimeEditElement.h
@@ -27,7 +27,7 @@
 #define DateTimeEditElement_h
 
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/StepRange.h"
+#include "core/html/forms/StepRange.h"
 #include "core/html/shadow/DateTimeFieldElement.h"
 #include "core/platform/DateComponents.h"
 
diff --git a/Source/core/html/shadow/DateTimeFieldElement.cpp b/Source/core/html/shadow/DateTimeFieldElement.cpp
index 76c20d4..29217a2 100644
--- a/Source/core/html/shadow/DateTimeFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeFieldElement.cpp
@@ -28,7 +28,7 @@
 #include "core/html/shadow/DateTimeFieldElement.h"
 
 #include "HTMLNames.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/dom/Text.h"
 #include "core/platform/LocalizedStrings.h"
 #include "core/platform/text/PlatformLocale.h"
diff --git a/Source/core/html/shadow/DateTimeFieldElements.cpp b/Source/core/html/shadow/DateTimeFieldElements.cpp
index 9ffa69f..4fc9f6e 100644
--- a/Source/core/html/shadow/DateTimeFieldElements.cpp
+++ b/Source/core/html/shadow/DateTimeFieldElements.cpp
@@ -27,7 +27,7 @@
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
 #include "core/html/shadow/DateTimeFieldElements.h"
 
-#include "core/html/DateTimeFieldsState.h"
+#include "core/html/forms/DateTimeFieldsState.h"
 #include "core/platform/DateComponents.h"
 #include "core/platform/LocalizedStrings.h"
 #include "wtf/CurrentTime.h"
diff --git a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
index 15703d5..d8ff016 100644
--- a/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeNumericFieldElement.cpp
@@ -29,7 +29,7 @@
 
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/platform/graphics/Font.h"
 #include "core/platform/text/PlatformLocale.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp b/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
index 16d6244..0ff04ac 100644
--- a/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
+++ b/Source/core/html/shadow/DateTimeSymbolicFieldElement.cpp
@@ -27,7 +27,7 @@
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
 #include "core/html/shadow/DateTimeSymbolicFieldElement.h"
 
-#include "core/dom/KeyboardEvent.h"
+#include "core/events/KeyboardEvent.h"
 #include "core/platform/graphics/Font.h"
 #include "core/platform/text/TextBreakIterator.h"
 #include "wtf/text/StringBuilder.h"
diff --git a/Source/core/html/shadow/DateTimeSymbolicFieldElement.h b/Source/core/html/shadow/DateTimeSymbolicFieldElement.h
index 65b8c44..04f7372 100644
--- a/Source/core/html/shadow/DateTimeSymbolicFieldElement.h
+++ b/Source/core/html/shadow/DateTimeSymbolicFieldElement.h
@@ -27,7 +27,7 @@
 #define DateTimeSymbolicFieldElement_h
 
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-#include "core/html/TypeAhead.h"
+#include "core/html/forms/TypeAhead.h"
 #include "core/html/shadow/DateTimeFieldElement.h"
 
 namespace WebCore {
diff --git a/Source/core/html/shadow/MediaControlElementTypes.cpp b/Source/core/html/shadow/MediaControlElementTypes.cpp
index 6065a8f..29d161e 100644
--- a/Source/core/html/shadow/MediaControlElementTypes.cpp
+++ b/Source/core/html/shadow/MediaControlElementTypes.cpp
@@ -35,7 +35,7 @@
 #include "HTMLNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/css/StylePropertySet.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp
index cf339da..93e81e9 100644
--- a/Source/core/html/shadow/MediaControlElements.cpp
+++ b/Source/core/html/shadow/MediaControlElements.cpp
@@ -32,9 +32,9 @@
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/DOMTokenList.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/FullscreenElementStack.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/HTMLVideoElement.h"
 #include "core/html/shadow/MediaControls.h"
 #include "core/html/track/TextTrack.h"
diff --git a/Source/core/html/shadow/MediaControls.h b/Source/core/html/shadow/MediaControls.h
index 4342ac1..ff7b39d 100644
--- a/Source/core/html/shadow/MediaControls.h
+++ b/Source/core/html/shadow/MediaControls.h
@@ -27,7 +27,7 @@
 #ifndef MediaControls_h
 #define MediaControls_h
 
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/HTMLDivElement.h"
 #include "core/html/shadow/MediaControlElements.h"
 #include "core/page/Page.h"
diff --git a/Source/core/html/shadow/MediaControlsChromiumAndroid.h b/Source/core/html/shadow/MediaControlsChromiumAndroid.h
index 5935f38..8b8a900 100644
--- a/Source/core/html/shadow/MediaControlsChromiumAndroid.h
+++ b/Source/core/html/shadow/MediaControlsChromiumAndroid.h
@@ -38,6 +38,7 @@
     virtual void setMediaController(MediaControllerInterface*) OVERRIDE;
     virtual void playbackStarted() OVERRIDE;
     virtual void playbackStopped() OVERRIDE;
+    virtual bool shouldHideControls() OVERRIDE { return true; }
 
     void insertTextTrackContainer(PassRefPtr<MediaControlTextTrackContainerElement>) OVERRIDE;
 
diff --git a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
index 33d4428..7050eb4 100644
--- a/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
+++ b/Source/core/html/shadow/PasswordGeneratorButtonElement.cpp
@@ -33,7 +33,7 @@
 
 #include "CSSPropertyNames.h"
 #include "CSSValueKeywords.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/ShadowRoot.h"
diff --git a/Source/core/html/shadow/PickerIndicatorElement.cpp b/Source/core/html/shadow/PickerIndicatorElement.cpp
index 208475d..71fabda 100644
--- a/Source/core/html/shadow/PickerIndicatorElement.cpp
+++ b/Source/core/html/shadow/PickerIndicatorElement.cpp
@@ -32,7 +32,7 @@
 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
 #include "core/html/shadow/PickerIndicatorElement.h"
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/Chrome.h"
 #include "core/page/Page.h"
diff --git a/Source/core/html/shadow/ShadowElementNames.cpp b/Source/core/html/shadow/ShadowElementNames.cpp
index c62c6a7..0767b85 100644
--- a/Source/core/html/shadow/ShadowElementNames.cpp
+++ b/Source/core/html/shadow/ShadowElementNames.cpp
@@ -53,6 +53,12 @@
     return name;
 }
 
+const AtomicString& editingViewPort()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("editing-view-port", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 const AtomicString& pickerIndicator()
 {
     DEFINE_STATIC_LOCAL(AtomicString, name, ("picker", AtomicString::ConstructFromLiteral));
@@ -89,6 +95,12 @@
     return name;
 }
 
+const AtomicString& textFieldContainer()
+{
+    DEFINE_STATIC_LOCAL(AtomicString, name, ("text-field-container", AtomicString::ConstructFromLiteral));
+    return name;
+}
+
 }
 
 }
diff --git a/Source/core/html/shadow/ShadowElementNames.h b/Source/core/html/shadow/ShadowElementNames.h
index b3ef3cb..a3cc5d2 100644
--- a/Source/core/html/shadow/ShadowElementNames.h
+++ b/Source/core/html/shadow/ShadowElementNames.h
@@ -40,12 +40,14 @@
 const AtomicString& dateTimeEdit();
 const AtomicString& spinButton();
 const AtomicString& clearButton();
+const AtomicString& editingViewPort();
 const AtomicString& pickerIndicator();
 const AtomicString& placeholder();
 const AtomicString& searchDecoration();
 const AtomicString& sliderThumb();
 const AtomicString& sliderTrack();
 const AtomicString& speechButton();
+const AtomicString& textFieldContainer();
 
 }
 
diff --git a/Source/core/html/shadow/SliderThumbElement.cpp b/Source/core/html/shadow/SliderThumbElement.cpp
index 14165d4..8e794d4 100644
--- a/Source/core/html/shadow/SliderThumbElement.cpp
+++ b/Source/core/html/shadow/SliderThumbElement.cpp
@@ -33,11 +33,11 @@
 #include "config.h"
 #include "core/html/shadow/SliderThumbElement.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/Event.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLInputElement.h"
-#include "core/html/StepRange.h"
+#include "core/html/forms/StepRange.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/EventHandler.h"
diff --git a/Source/core/html/shadow/SpinButtonElement.cpp b/Source/core/html/shadow/SpinButtonElement.cpp
index 4521b32..7a0fbcd 100644
--- a/Source/core/html/shadow/SpinButtonElement.cpp
+++ b/Source/core/html/shadow/SpinButtonElement.cpp
@@ -28,9 +28,9 @@
 #include "core/html/shadow/SpinButtonElement.h"
 
 #include "HTMLNames.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/WheelEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/WheelEvent.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/Chrome.h"
 #include "core/page/EventHandler.h"
diff --git a/Source/core/html/shadow/SpinButtonElement.h b/Source/core/html/shadow/SpinButtonElement.h
index 715f434..a749036 100644
--- a/Source/core/html/shadow/SpinButtonElement.h
+++ b/Source/core/html/shadow/SpinButtonElement.h
@@ -97,6 +97,20 @@
     return static_cast<SpinButtonElement*>(element);
 }
 
+inline SpinButtonElement* toSpinButtonElement(Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || toElement(node)->isSpinButtonElement());
+    return static_cast<SpinButtonElement*>(node);
+}
+
+inline const SpinButtonElement* toSpinButtonElement(const Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || toElement(node)->isSpinButtonElement());
+    return static_cast<const SpinButtonElement*>(node);
+}
+
+void toSpinButtonElement(const SpinButtonElement*);
+
 } // namespace
 
 #endif
diff --git a/Source/core/html/shadow/TextControlInnerElements.cpp b/Source/core/html/shadow/TextControlInnerElements.cpp
index 90de6f9..88f9326 100644
--- a/Source/core/html/shadow/TextControlInnerElements.cpp
+++ b/Source/core/html/shadow/TextControlInnerElements.cpp
@@ -30,11 +30,11 @@
 #include "HTMLNames.h"
 #include "bindings/v8/ScriptController.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/NodeRenderStyle.h"
-#include "core/dom/TextEvent.h"
-#include "core/dom/TextEventInputType.h"
+#include "core/events/TextEvent.h"
+#include "core/events/TextEventInputType.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/shadow/ShadowElementNames.h"
 #include "core/page/EventHandler.h"
@@ -55,7 +55,9 @@
 
 PassRefPtr<TextControlInnerContainer> TextControlInnerContainer::create(Document& document)
 {
-    return adoptRef(new TextControlInnerContainer(document));
+    RefPtr<TextControlInnerContainer> element = adoptRef(new TextControlInnerContainer(document));
+    element->setAttribute(idAttr, ShadowElementNames::textFieldContainer());
+    return element.release();
 }
 
 RenderObject* TextControlInnerContainer::createRenderer(RenderStyle*)
@@ -73,7 +75,9 @@
 
 PassRefPtr<EditingViewPortElement> EditingViewPortElement::create(Document& document)
 {
-    return adoptRef(new EditingViewPortElement(document));
+    RefPtr<EditingViewPortElement> element = adoptRef(new EditingViewPortElement(document));
+    element->setAttribute(idAttr, ShadowElementNames::editingViewPort());
+    return element.release();
 }
 
 PassRefPtr<RenderStyle> EditingViewPortElement::customStyleForRenderer()
diff --git a/Source/core/html/track/TextTrack.cpp b/Source/core/html/track/TextTrack.cpp
index 6a392ef..70fed99 100644
--- a/Source/core/html/track/TextTrack.cpp
+++ b/Source/core/html/track/TextTrack.cpp
@@ -266,13 +266,13 @@
     // 1. If the given cue is not currently listed in the method's TextTrack
     // object's text track's text track list of cues, then throw a NotFoundError exception.
     if (cue->track() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
     // 2. Remove cue from the method's TextTrack object's text track's text track list of cues.
     if (!m_cues || !m_cues->remove(cue)) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
@@ -347,12 +347,12 @@
     // 1. If the given region is not currently listed in the method's TextTrack
     // object's text track list of regions, then throw a NotFoundError exception.
     if (region->track() != this) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return;
     }
 
     if (!m_regions || !m_regions->remove(region)) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
 
diff --git a/Source/core/html/track/TextTrackCue.cpp b/Source/core/html/track/TextTrackCue.cpp
index 167f032..f80d78c 100644
--- a/Source/core/html/track/TextTrackCue.cpp
+++ b/Source/core/html/track/TextTrackCue.cpp
@@ -37,7 +37,7 @@
 #include "CSSValueKeywords.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/DocumentFragment.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/html/HTMLDivElement.h"
 #include "core/html/track/TextTrack.h"
@@ -348,7 +348,7 @@
     else if (value == verticalGrowingRightKeyword())
         direction = VerticalGrowingRight;
     else
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
 
     if (direction == m_writingDirection)
         return;
@@ -374,7 +374,7 @@
     // On setting, if the text track cue snap-to-lines flag is not set, and the new
     // value is negative or greater than 100, then throw an IndexSizeError exception.
     if (!m_snapToLines && (position < 0 || position > 100)) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -394,7 +394,7 @@
     // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception.
     // Otherwise, set the text track cue text position to the new value.
     if (position < 0 || position > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -413,7 +413,7 @@
     // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError
     // exception. Otherwise, set the text track cue size to the new value.
     if (size < 0 || size > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -457,7 +457,7 @@
     else if (value == endKeyword())
         alignment = End;
     else
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
 
     if (alignment == m_cueAlignment)
         return;
@@ -931,7 +931,7 @@
         String setting = WebVTTParser::collectWord(input, &endOfSetting);
         CueSetting name;
         size_t colonOffset = setting.find(':', 1);
-        if (colonOffset == notFound || colonOffset == 0 || colonOffset == setting.length() - 1)
+        if (colonOffset == kNotFound || !colonOffset || colonOffset == setting.length() - 1)
             goto NextSetting;
 
         // 2. Let name be the leading substring of setting up to and excluding the first U+003A COLON character (:) in that string.
@@ -978,7 +978,7 @@
             // 4. If any character in value other than the last character is a U+0025 PERCENT SIGN character (%), then
             //    jump to the step labeled next setting.
             String linePosition = linePositionBuilder.toString();
-            if (linePosition.find('-', 1) != notFound || linePosition.reverseFind("%", linePosition.length() - 2) != notFound)
+            if (linePosition.find('-', 1) != kNotFound || linePosition.reverseFind("%", linePosition.length() - 2) != kNotFound)
                 break;
 
             // 5. If the first character in value is a U+002D HYPHEN-MINUS character (-) and the last character in value is a
diff --git a/Source/core/html/track/TextTrackCue.h b/Source/core/html/track/TextTrackCue.h
index 61fd450..92047be 100644
--- a/Source/core/html/track/TextTrackCue.h
+++ b/Source/core/html/track/TextTrackCue.h
@@ -33,7 +33,7 @@
 #define TextTrackCue_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/html/HTMLDivElement.h"
 #include "wtf/RefCounted.h"
 
diff --git a/Source/core/html/track/TextTrackCueList.cpp b/Source/core/html/track/TextTrackCueList.cpp
index ff4710d..43fa9b5 100644
--- a/Source/core/html/track/TextTrackCueList.cpp
+++ b/Source/core/html/track/TextTrackCueList.cpp
@@ -109,7 +109,7 @@
 bool TextTrackCueList::remove(TextTrackCue* cue)
 {
     size_t index = m_list.find(cue);
-    if (index == notFound)
+    if (index == kNotFound)
         return false;
 
     cue->setIsActive(false);
diff --git a/Source/core/html/track/TextTrackList.cpp b/Source/core/html/track/TextTrackList.cpp
index 719f96e..0bff78f 100644
--- a/Source/core/html/track/TextTrackList.cpp
+++ b/Source/core/html/track/TextTrackList.cpp
@@ -27,7 +27,7 @@
 #include "core/html/track/TextTrackList.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/track/InbandTextTrack.h"
 #include "core/html/track/LoadableTextTrack.h"
@@ -151,7 +151,7 @@
         ASSERT_NOT_REACHED();
 
     size_t index = tracks->find(track);
-    if (index == notFound)
+    if (index == kNotFound)
         return;
 
     for (size_t i = index; i < tracks->size(); ++i)
@@ -200,7 +200,7 @@
     }
 
     size_t index = tracks->find(track);
-    if (index == notFound)
+    if (index == kNotFound)
         return;
 
     invalidateTrackIndexesAfterTrack(track);
@@ -227,7 +227,7 @@
     else
         ASSERT_NOT_REACHED();
 
-    return tracks->find(track) != notFound;
+    return tracks->find(track) != kNotFound;
 }
 
 const AtomicString& TextTrackList::interfaceName() const
diff --git a/Source/core/html/track/TextTrackList.h b/Source/core/html/track/TextTrackList.h
index ac4621a..8a9e876 100644
--- a/Source/core/html/track/TextTrackList.h
+++ b/Source/core/html/track/TextTrackList.h
@@ -27,8 +27,8 @@
 #define TextTrackList_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventTarget.h"
 #include "core/platform/Timer.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
diff --git a/Source/core/html/track/TextTrackRegion.cpp b/Source/core/html/track/TextTrackRegion.cpp
index d5c30b3..cb7181e 100644
--- a/Source/core/html/track/TextTrackRegion.cpp
+++ b/Source/core/html/track/TextTrackRegion.cpp
@@ -108,7 +108,7 @@
     }
 
     if (value < 0 || value > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -118,7 +118,7 @@
 void TextTrackRegion::setHeight(long value, ExceptionState& es)
 {
     if (value < 0) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -133,7 +133,7 @@
     }
 
     if (value < 0 || value > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -148,7 +148,7 @@
     }
 
     if (value < 0 || value > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -163,7 +163,7 @@
     }
 
     if (value < 0 || value > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -178,7 +178,7 @@
     }
 
     if (value < 0 || value > 100) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
@@ -200,7 +200,7 @@
     DEFINE_STATIC_LOCAL(const AtomicString, upScrollValueKeyword, ("up", AtomicString::ConstructFromLiteral));
 
     if (value != emptyString() && value != upScrollValueKeyword) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
@@ -271,7 +271,7 @@
 
     switch (setting) {
     case Id:
-        if (value.find("-->") == notFound)
+        if (value.find("-->") == kNotFound)
             m_id = value;
         break;
     case Width:
@@ -322,7 +322,7 @@
     String setting = WebVTTParser::collectWord(input, position);
 
     size_t equalOffset = setting.find('=', 1);
-    if (equalOffset == notFound || !equalOffset || equalOffset == setting.length() - 1)
+    if (equalOffset == kNotFound || !equalOffset || equalOffset == setting.length() - 1)
         return;
 
     RegionSetting name = getSettingFromString(setting.substring(0, equalOffset));
diff --git a/Source/core/html/track/TextTrackRegionList.cpp b/Source/core/html/track/TextTrackRegionList.cpp
index 41bf56e..8004a9c 100644
--- a/Source/core/html/track/TextTrackRegionList.cpp
+++ b/Source/core/html/track/TextTrackRegionList.cpp
@@ -69,7 +69,7 @@
 bool TextTrackRegionList::remove(TextTrackRegion* region)
 {
     size_t index = m_list.find(region);
-    if (index == notFound)
+    if (index == kNotFound)
         return false;
 
     m_list.remove(index);
diff --git a/Source/core/html/track/TrackBase.h b/Source/core/html/track/TrackBase.h
index c8b5927..41e5a5b 100644
--- a/Source/core/html/track/TrackBase.h
+++ b/Source/core/html/track/TrackBase.h
@@ -26,7 +26,7 @@
 #ifndef TrackBase_h
 #define TrackBase_h
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "wtf/RefCounted.h"
 
 namespace WebCore {
diff --git a/Source/core/html/track/TrackEvent.cpp b/Source/core/html/track/TrackEvent.cpp
index 7e20843..262be3a 100644
--- a/Source/core/html/track/TrackEvent.cpp
+++ b/Source/core/html/track/TrackEvent.cpp
@@ -27,7 +27,7 @@
 
 #include "core/html/track/TrackEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/html/track/TrackEvent.h b/Source/core/html/track/TrackEvent.h
index 8df7bb7..606bc14 100644
--- a/Source/core/html/track/TrackEvent.h
+++ b/Source/core/html/track/TrackEvent.h
@@ -26,7 +26,7 @@
 #ifndef TrackEvent_h
 #define TrackEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/track/TrackBase.h"
 
 namespace WebCore {
diff --git a/Source/core/html/track/WebVTTParser.cpp b/Source/core/html/track/WebVTTParser.cpp
index 27507c4..e249da4 100644
--- a/Source/core/html/track/WebVTTParser.cpp
+++ b/Source/core/html/track/WebVTTParser.cpp
@@ -96,7 +96,7 @@
     // percentages (x%,y%) implies that at least the first two characters
     // are the first percentage value.
     size_t delimiterOffset = value.find(delimiter, 2);
-    if (delimiterOffset == notFound || delimiterOffset == value.length() - 1) {
+    if (delimiterOffset == kNotFound || delimiterOffset == value.length() - 1) {
         isValidSetting = false;
         return FloatPoint(0, 0);
     }
@@ -280,7 +280,7 @@
     skipWhiteSpace(line, &position);
 
     // 6-9 - If the next three characters are not "-->", abort and return failure.
-    if (line.find("-->", position) == notFound)
+    if (line.find("-->", position) == kNotFound)
         return BadCue;
     position += 3;
     if (position >= line.length())
diff --git a/Source/core/inspector/ContentSearchUtils.cpp b/Source/core/inspector/ContentSearchUtils.cpp
index 48ecdc4..da62f3b 100644
--- a/Source/core/inspector/ContentSearchUtils.cpp
+++ b/Source/core/inspector/ContentSearchUtils.cpp
@@ -49,7 +49,7 @@
     String specials(regexSpecialCharacters);
 
     for (unsigned i = 0; i < text.length(); i++) {
-        if (specials.find(text[i]) != notFound)
+        if (specials.find(text[i]) != kNotFound)
             result.append("\\");
         result.append(text[i]);
     }
@@ -129,54 +129,71 @@
 
 static String findMagicComment(const String& content, const String& name, MagicCommentType commentType, bool* deprecated = 0)
 {
-    ASSERT(name.find("=") == notFound);
+    ASSERT(name.find("=") == kNotFound);
     if (deprecated)
         *deprecated = false;
-    String pattern;
-    String deprecatedPattern;
-    switch (commentType) {
-    case JavaScriptMagicComment:
-        pattern = "//#[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
-        deprecatedPattern = "//@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s\'\"]*)[\040\t]*$";
+
+    const unsigned limitSearchLength = 1000; // limit to 1000 last characters.
+    unsigned length = content.length();
+    unsigned nameLength = name.length();
+    unsigned stop = length > limitSearchLength ? length - limitSearchLength : 0;
+
+    size_t pos = length;
+    size_t equalSignPos = 0;
+    size_t closingCommentPos = 0;
+    while (true) {
+        pos = content.reverseFind(name, pos, stop);
+        if (pos == kNotFound)
+            return String();
+
+        // Check for a /\/[\/*][@#][ \t]/ regexp (length of 4) before found name.
+        if (pos < stop + 4)
+            return String();
+        pos -= 4;
+        if (content[pos] != '/')
+            continue;
+        if ((content[pos + 1] != '/' || commentType != JavaScriptMagicComment)
+            && (content[pos + 1] != '*' || commentType != CSSMagicComment))
+            continue;
+        if (content[pos + 2] != '#' && content[pos + 2] != '@')
+            continue;
+        if (content[pos + 3] != ' ' && content[pos + 3] != '\t')
+            continue;
+        equalSignPos = pos + 4 + nameLength;
+        if (equalSignPos < length && content[equalSignPos] != '=')
+            continue;
+        if (commentType == CSSMagicComment) {
+            closingCommentPos = content.find("*/", equalSignPos + 1);
+            if (closingCommentPos == kNotFound)
+                return String();
+            if (!content.substring(closingCommentPos + 2).containsOnlyWhitespace())
+                return String();
+        }
+
         break;
-    case CSSMagicComment:
-        pattern = "/\\*#[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s]*)[\040\t]*\\*/[\040\t]*$";
-        deprecatedPattern = "/\\*@[\040\t]" + createSearchRegexSource(name) + "=[\040\t]*([^\\s]*)[\040\t]*\\*/[\040\t]*$";
-        break;
-    default:
-        ASSERT_NOT_REACHED();
-        return String();
     }
-    RegularExpression regex(pattern, TextCaseSensitive, MultilineEnabled);
-    RegularExpression deprecatedRegex(deprecatedPattern, TextCaseSensitive, MultilineEnabled);
 
-    int matchLength;
-    int offset = regex.match(content, 0, &matchLength);
-    if (offset == -1) {
-        offset = deprecatedRegex.match(content, 0, &matchLength);
-        if (offset != -1 && deprecated)
-            *deprecated = true;
-    }
-    if (offset == -1)
+    if (pos < stop)
         return String();
 
-    String match = content.substring(offset, matchLength);
-    size_t separator = match.find("=");
-    ASSERT(separator != notFound);
-    match = match.substring(separator + 1);
+    if (deprecated && content[pos + 2] == '@')
+        *deprecated = true;
 
-    switch (commentType) {
-    case JavaScriptMagicComment:
-        return match.stripWhiteSpace();
-    case CSSMagicComment: {
-        size_t lastStarIndex = match.reverseFind('*');
-        ASSERT(lastStarIndex != notFound);
-        return match.substring(0, lastStarIndex).stripWhiteSpace();
+    ASSERT(equalSignPos);
+    ASSERT(commentType != CSSMagicComment || closingCommentPos);
+    size_t urlPos = equalSignPos + 1;
+    String match = commentType == CSSMagicComment
+        ? content.substring(urlPos, closingCommentPos - urlPos)
+        : content.substring(urlPos);
+    match = match.stripWhiteSpace();
+
+    String disallowedChars("\"' \t\n\r");
+    for (unsigned i = 0; i < match.length(); ++i) {
+        if (disallowedChars.find(match[i]) != kNotFound)
+            return String();
     }
-    default:
-        ASSERT_NOT_REACHED();
-        return String();
-    }
+
+    return match;
 }
 
 String findSourceURL(const String& content, MagicCommentType commentType, bool* deprecated)
diff --git a/Source/core/inspector/DOMPatchSupport.cpp b/Source/core/inspector/DOMPatchSupport.cpp
index 7f98678..5fed805 100644
--- a/Source/core/inspector/DOMPatchSupport.cpp
+++ b/Source/core/inspector/DOMPatchSupport.cpp
@@ -144,9 +144,9 @@
     for (Node* child = parentNode->firstChild(); child != node; child = child->nextSibling())
         newList.append(createDigest(child, 0));
     for (Node* child = fragment->firstChild(); child; child = child->nextSibling()) {
-        if (child->hasTagName(headTag) && !child->firstChild() && markupCopy.find("</head>") == notFound)
+        if (child->hasTagName(headTag) && !child->firstChild() && markupCopy.find("</head>") == kNotFound)
             continue; // HTML5 parser inserts empty <head> tag whenever it parses <body>
-        if (child->hasTagName(bodyTag) && !child->firstChild() && markupCopy.find("</body>") == notFound)
+        if (child->hasTagName(bodyTag) && !child->firstChild() && markupCopy.find("</body>") == kNotFound)
             continue; // HTML5 parser inserts empty <body> tag whenever it parses </head>
         newList.append(createDigest(child, &m_unusedNodesMap));
     }
diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp
index 52f3e09..98394a7 100644
--- a/Source/core/inspector/InjectedScript.cpp
+++ b/Source/core/inspector/InjectedScript.cpp
@@ -296,6 +296,21 @@
     return resultValue;
 }
 
+ScriptValue InjectedScript::findCallframeById(ErrorString* errorString, const ScriptValue& topCallFrame, const String& callFrameId)
+{
+    ScriptFunctionCall function(injectedScriptObject(), "callFrameForId");
+    function.appendArgument(topCallFrame);
+    function.appendArgument(callFrameId);
+    bool hadException = false;
+    ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException);
+    ASSERT(!hadException);
+    if (hadException || resultValue.hasNoValue() || !resultValue.isObject()) {
+        *errorString = "Internal error";
+        return ScriptValue();
+    }
+    return resultValue;
+}
+
 void InjectedScript::inspectNode(Node* node)
 {
     ASSERT(!hasNoValue());
diff --git a/Source/core/inspector/InjectedScript.h b/Source/core/inspector/InjectedScript.h
index 207f5ae..81a1379 100644
--- a/Source/core/inspector/InjectedScript.h
+++ b/Source/core/inspector/InjectedScript.h
@@ -91,6 +91,7 @@
     PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapTable(const ScriptValue& table, const ScriptValue& columns) const;
     PassRefPtr<TypeBuilder::Runtime::RemoteObject> wrapNode(Node*, const String& groupName);
     ScriptValue findObjectById(const String& objectId) const;
+    ScriptValue findCallframeById(ErrorString*, const ScriptValue& topCallFrame, const String& callFrameId);
 
     void inspectNode(Node*);
     void releaseObjectGroup(const String&);
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index 59eac83..f38edb6 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -618,7 +618,7 @@
      */
     evaluateOnCallFrame: function(topCallFrame, callFrameId, expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview)
     {
-        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
+        var callFrame = this.callFrameForId(topCallFrame, callFrameId);
         if (!callFrame)
             return "Could not find call frame with given id";
         return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview);
@@ -631,7 +631,7 @@
      */
     restartFrame: function(topCallFrame, callFrameId)
     {
-        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
+        var callFrame = this.callFrameForId(topCallFrame, callFrameId);
         if (!callFrame)
             return "Could not find call frame with given id";
         var result = callFrame.restart();
@@ -647,7 +647,7 @@
      */
     getStepInPositions: function(topCallFrame, callFrameId)
     {
-        var callFrame = this._callFrameForId(topCallFrame, callFrameId);
+        var callFrame = this.callFrameForId(topCallFrame, callFrameId);
         if (!callFrame)
             return "Could not find call frame with given id";
         var stepInPositionsUnpacked = JSON.parse(callFrame.stepInPositions);
@@ -670,7 +670,7 @@
     {   
         var setter;
         if (typeof callFrameId === "string") {
-            var callFrame = this._callFrameForId(topCallFrame, callFrameId);
+            var callFrame = this.callFrameForId(topCallFrame, callFrameId);
             if (!callFrame)
                 return "Could not find call frame with given id";
             setter = callFrame.setVariableValue.bind(callFrame);    
@@ -706,7 +706,7 @@
      * @param {string} callFrameId
      * @return {Object}
      */
-    _callFrameForId: function(topCallFrame, callFrameId)
+    callFrameForId: function(topCallFrame, callFrameId)
     {
         var parsedCallFrameId = InjectedScriptHost.evaluate("(" + callFrameId + ")");
         var ordinal = parsedCallFrameId["ordinal"];
diff --git a/Source/core/inspector/InspectorCSSAgent.cpp b/Source/core/inspector/InspectorCSSAgent.cpp
index fdace37..ee326aa 100644
--- a/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/Source/core/inspector/InspectorCSSAgent.cpp
@@ -26,6 +26,7 @@
 #include "core/inspector/InspectorCSSAgent.h"
 
 #include "CSSPropertyNames.h"
+#include "FetchInitiatorTypeNames.h"
 #include "InspectorTypeBuilder.h"
 #include "StylePropertyShorthand.h"
 #include "bindings/v8/ExceptionState.h"
@@ -49,10 +50,15 @@
 #include "core/dom/NamedFlowCollection.h"
 #include "core/dom/Node.h"
 #include "core/dom/NodeList.h"
+#include "core/fetch/CSSStyleSheetResource.h"
+#include "core/fetch/ResourceClient.h"
+#include "core/fetch/ResourceFetcher.h"
+#include "core/fetch/StyleSheetResourceClient.h"
 #include "core/html/HTMLHeadElement.h"
 #include "core/inspector/InspectorDOMAgent.h"
 #include "core/inspector/InspectorHistory.h"
 #include "core/inspector/InspectorPageAgent.h"
+#include "core/inspector/InspectorResourceAgent.h"
 #include "core/inspector/InspectorState.h"
 #include "core/inspector/InstrumentingAgents.h"
 #include "core/loader/DocumentLoader.h"
@@ -77,6 +83,8 @@
 static const char cssAgentEnabled[] = "cssAgentEnabled";
 }
 
+typedef WebCore::InspectorBackendDispatcher::CSSCommandHandler::EnableCallback EnableCallback;
+
 namespace WebCore {
 
 enum ForcePseudoClassFlags {
@@ -105,7 +113,7 @@
         for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
             CSSRule* rule = styleSheet->item(i);
             if (rule->type() == CSSRule::IMPORT_RULE) {
-                CSSStyleSheet* importedStyleSheet = static_cast<CSSImportRule*>(rule)->styleSheet();
+                CSSStyleSheet* importedStyleSheet = toCSSImportRule(rule)->styleSheet();
                 if (importedStyleSheet)
                     run(importedStyleSheet);
             }
@@ -268,6 +276,47 @@
     RefPtr<InspectorStyleSheet> m_styleSheet;
 };
 
+class InspectorCSSAgent::EnableResourceClient : public StyleSheetResourceClient {
+public:
+    EnableResourceClient(InspectorCSSAgent*, const Vector<InspectorStyleSheet*>&, PassRefPtr<EnableCallback>);
+
+    virtual void setCSSStyleSheet(const String&, const KURL&, const String&, const CSSStyleSheetResource*) OVERRIDE;
+
+private:
+    RefPtr<EnableCallback> m_callback;
+    InspectorCSSAgent* m_cssAgent;
+    int m_pendingResources;
+    Vector<InspectorStyleSheet*> m_styleSheets;
+};
+
+InspectorCSSAgent::EnableResourceClient::EnableResourceClient(InspectorCSSAgent* cssAgent, const Vector<InspectorStyleSheet*>& styleSheets, PassRefPtr<EnableCallback> callback)
+    : m_callback(callback)
+    , m_cssAgent(cssAgent)
+    , m_pendingResources(styleSheets.size())
+    , m_styleSheets(styleSheets)
+{
+    for (size_t i = 0; i < styleSheets.size(); ++i) {
+        InspectorStyleSheet* styleSheet = styleSheets.at(i);
+        Document* document = styleSheet->ownerDocument();
+        FetchRequest request(ResourceRequest(styleSheet->finalURL()), FetchInitiatorTypeNames::inspector);
+        ResourcePtr<Resource> resource = document->fetcher()->fetchCSSStyleSheet(request);
+        resource->addClient(this);
+    }
+}
+
+void InspectorCSSAgent::EnableResourceClient::setCSSStyleSheet(const String&, const KURL& url, const String&, const CSSStyleSheetResource* resource)
+{
+    const_cast<CSSStyleSheetResource*>(resource)->removeClient(this);
+    --m_pendingResources;
+    if (m_pendingResources)
+        return;
+
+    // enable always succeeds.
+    if (m_callback->isActive())
+        m_cssAgent->wasEnabled(m_callback.release());
+    delete this;
+}
+
 class InspectorCSSAgent::SetStyleSheetTextAction : public InspectorCSSAgent::StyleSheetAction {
     WTF_MAKE_NONCOPYABLE(SetStyleSheetTextAction);
 public:
@@ -537,7 +586,7 @@
 {
     if (!rule || rule->type() != CSSRule::STYLE_RULE)
         return 0;
-    return static_cast<CSSStyleRule*>(rule);
+    return toCSSStyleRule(rule);
 }
 
 template <typename CharType, size_t bufferLength>
@@ -724,11 +773,12 @@
     return true;
 }
 
-InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAgent)
+InspectorCSSAgent::InspectorCSSAgent(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent)
     : InspectorBaseAgent<InspectorCSSAgent>("CSS", instrumentingAgents, state)
     , m_frontend(0)
     , m_domAgent(domAgent)
     , m_pageAgent(pageAgent)
+    , m_resourceAgent(resourceAgent)
     , m_lastStyleSheetId(1)
     , m_creatingViaInspectorStyleSheet(false)
     , m_isSettingStyleSheetText(false)
@@ -763,10 +813,8 @@
 
 void InspectorCSSAgent::restore()
 {
-    if (m_state->getBoolean(CSSAgentState::cssAgentEnabled)) {
-        ErrorString error;
-        enable(&error);
-    }
+    if (m_state->getBoolean(CSSAgentState::cssAgentEnabled))
+        wasEnabled(0);
 }
 
 void InspectorCSSAgent::reset()
@@ -788,17 +836,57 @@
     resetPseudoStates();
 }
 
-void InspectorCSSAgent::enable(ErrorString*)
+void InspectorCSSAgent::enable(ErrorString*, PassRefPtr<EnableCallback> prpCallback)
 {
     m_state->setBoolean(CSSAgentState::cssAgentEnabled, true);
-    m_instrumentingAgents->setInspectorCSSAgent(this);
 
-    if (!m_frontend)
+    Vector<InspectorStyleSheet*> styleSheets;
+    collectAllStyleSheets(styleSheets);
+
+    // Re-issue stylesheet requets for resources that are no longer in memory cache.
+    Vector<InspectorStyleSheet*> styleSheetsToFetch;
+    HashSet<String> urlsToFetch;
+    for (size_t i = 0; i < styleSheets.size(); ++i) {
+        InspectorStyleSheet* styleSheet = styleSheets.at(i);
+        String url = styleSheet->finalURL();
+        if (urlsToFetch.contains(url))
+            continue;
+        CSSStyleSheet* pageStyleSheet = styleSheet->pageStyleSheet();
+        if (pageStyleSheet->isInline() || !pageStyleSheet->contents()->loadCompleted())
+            continue;
+        Document* document = styleSheet->ownerDocument();
+        if (!document)
+            continue;
+        Resource* cachedResource = document->fetcher()->cachedResource(url);
+        if (cachedResource)
+            continue;
+        urlsToFetch.add(styleSheet->finalURL());
+        styleSheetsToFetch.append(styleSheet);
+    }
+
+    if (styleSheetsToFetch.isEmpty()) {
+        wasEnabled(prpCallback);
         return;
+    }
+    new EnableResourceClient(this, styleSheetsToFetch, prpCallback);
+}
+
+void InspectorCSSAgent::wasEnabled(PassRefPtr<EnableCallback> callback)
+{
+    if (!m_state->getBoolean(CSSAgentState::cssAgentEnabled)) {
+        // We were disabled while fetching resources.
+        return;
+    }
+
+    // Re-read stylesheets, we know for sure we have content for all of them.
     Vector<InspectorStyleSheet*> styleSheets;
     collectAllStyleSheets(styleSheets);
     for (size_t i = 0; i < styleSheets.size(); ++i)
         m_frontend->styleSheetAdded(styleSheets.at(i)->buildObjectForStyleSheetInfo());
+    if (callback)
+        callback->sendSuccess();
+
+    m_instrumentingAgents->setInspectorCSSAgent(this);
 }
 
 void InspectorCSSAgent::disable(ErrorString*)
@@ -1375,7 +1463,7 @@
             mediaList = mediaRule->media();
             parentStyleSheet = mediaRule->parentStyleSheet();
         } else if (parentRule->type() == CSSRule::IMPORT_RULE) {
-            CSSImportRule* importRule = static_cast<CSSImportRule*>(parentRule);
+            CSSImportRule* importRule = toCSSImportRule(parentRule);
             mediaList = importRule->media();
             parentStyleSheet = importRule->parentStyleSheet();
             isMediaRule = false;
@@ -1434,7 +1522,7 @@
         return 0;
 
     String newStyleSheetId = String::number(m_lastStyleSheetId++);
-    RefPtr<InspectorStyleSheetForInlineStyle> inspectorStyleSheet = InspectorStyleSheetForInlineStyle::create(m_pageAgent, newStyleSheetId, element, TypeBuilder::CSS::StyleSheetOrigin::Regular, this);
+    RefPtr<InspectorStyleSheetForInlineStyle> inspectorStyleSheet = InspectorStyleSheetForInlineStyle::create(m_pageAgent, m_resourceAgent, newStyleSheetId, element, TypeBuilder::CSS::StyleSheetOrigin::Regular, this);
     m_idToInspectorStyleSheet.set(newStyleSheetId, inspectorStyleSheet);
     m_nodeToInspectorStyleSheet.set(element, inspectorStyleSheet);
     return inspectorStyleSheet.get();
@@ -1483,7 +1571,7 @@
     for (unsigned i = 0, size = styleSheet->length(); i < size; ++i) {
         CSSRule* rule = styleSheet->item(i);
         if (rule->type() == CSSRule::IMPORT_RULE) {
-            CSSStyleSheet* importedStyleSheet = static_cast<CSSImportRule*>(rule)->styleSheet();
+            CSSStyleSheet* importedStyleSheet = toCSSImportRule(rule)->styleSheet();
             if (importedStyleSheet)
                 collectStyleSheets(importedStyleSheet, result);
         }
@@ -1496,7 +1584,7 @@
     if (!inspectorStyleSheet) {
         String id = String::number(m_lastStyleSheetId++);
         Document* document = styleSheet->ownerDocument();
-        inspectorStyleSheet = InspectorStyleSheet::create(m_pageAgent, id, styleSheet, detectOrigin(styleSheet, document), InspectorDOMAgent::documentURLString(document), this);
+        inspectorStyleSheet = InspectorStyleSheet::create(m_pageAgent, m_resourceAgent, id, styleSheet, detectOrigin(styleSheet, document), InspectorDOMAgent::documentURLString(document), this);
         m_idToInspectorStyleSheet.set(id, inspectorStyleSheet);
         m_cssStyleSheetToInspectorStyleSheet.set(styleSheet, inspectorStyleSheet);
         if (m_creatingViaInspectorStyleSheet)
diff --git a/Source/core/inspector/InspectorCSSAgent.h b/Source/core/inspector/InspectorCSSAgent.h
index 0ee8071..207c787 100644
--- a/Source/core/inspector/InspectorCSSAgent.h
+++ b/Source/core/inspector/InspectorCSSAgent.h
@@ -50,6 +50,7 @@
 class Document;
 class Element;
 class InspectorFrontend;
+class InspectorResourceAgent;
 class InstrumentingAgents;
 class MediaList;
 class Node;
@@ -95,9 +96,9 @@
     static CSSStyleRule* asCSSStyleRule(CSSRule*);
     static bool cssErrorFilter(const CSSParserString& content, int propertyId, int errorType);
 
-    static PassOwnPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAgent)
+    static PassOwnPtr<InspectorCSSAgent> create(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent)
     {
-        return adoptPtr(new InspectorCSSAgent(instrumentingAgents, state, domAgent, pageAgent));
+        return adoptPtr(new InspectorCSSAgent(instrumentingAgents, state, domAgent, pageAgent, resourceAgent));
     }
     ~InspectorCSSAgent();
 
@@ -106,7 +107,7 @@
     virtual void clearFrontend();
     virtual void discardAgent();
     virtual void restore();
-    virtual void enable(ErrorString*);
+    virtual void enable(ErrorString*, PassRefPtr<EnableCallback>);
     virtual void disable(ErrorString*);
     void reset();
     void didCommitLoad(Frame*, DocumentLoader*);
@@ -153,14 +154,16 @@
     class TogglePropertyAction;
     class SetRuleSelectorAction;
     class AddRuleAction;
+    class EnableResourceClient;
 
-    InspectorCSSAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorDOMAgent*, InspectorPageAgent*);
+    InspectorCSSAgent(InstrumentingAgents*, InspectorCompositeState*, InspectorDOMAgent*, InspectorPageAgent*, InspectorResourceAgent*);
 
     typedef HashMap<String, RefPtr<InspectorStyleSheet> > IdToInspectorStyleSheet;
     typedef HashMap<Node*, RefPtr<InspectorStyleSheetForInlineStyle> > NodeToInspectorStyleSheet; // bogus "stylesheets" with elements' inline styles
     typedef HashMap<RefPtr<Document>, RefPtr<InspectorStyleSheet> > DocumentToViaInspectorStyleSheet; // "via inspector" stylesheets
     typedef HashMap<int, unsigned> NodeIdToForcedPseudoState;
 
+    void wasEnabled(PassRefPtr<EnableCallback>);
     void resetNonPersistentData();
     InspectorStyleSheetForInlineStyle* asInspectorStyleSheet(Element* element);
     Element* elementForId(ErrorString*, int nodeId);
@@ -198,6 +201,7 @@
     InspectorFrontend::CSS* m_frontend;
     InspectorDOMAgent* m_domAgent;
     InspectorPageAgent* m_pageAgent;
+    InspectorResourceAgent* m_resourceAgent;
 
     IdToInspectorStyleSheet m_idToInspectorStyleSheet;
     CSSStyleSheetToInspectorStyleSheet m_cssStyleSheetToInspectorStyleSheet;
@@ -213,6 +217,7 @@
     bool m_isSettingStyleSheetText;
 
     friend class ChangeRegionOversetTask;
+    friend class EnableResourceClient;
     friend class StyleSheetBinder;
     friend class UpdateRegionLayoutTask;
 };
diff --git a/Source/core/inspector/InspectorController.cpp b/Source/core/inspector/InspectorController.cpp
index 0d78760..963282e 100644
--- a/Source/core/inspector/InspectorController.cpp
+++ b/Source/core/inspector/InspectorController.cpp
@@ -91,7 +91,11 @@
     InspectorDOMAgent* domAgent = domAgentPtr.get();
     m_agents.append(domAgentPtr.release());
 
-    m_agents.append(InspectorCSSAgent::create(m_instrumentingAgents.get(), m_state.get(), domAgent, pageAgent));
+    OwnPtr<InspectorResourceAgent> resourceAgentPtr(InspectorResourceAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get(), m_overlay.get()));
+    InspectorResourceAgent* resourceAgent = resourceAgentPtr.get();
+    m_agents.append(resourceAgentPtr.release());
+
+    m_agents.append(InspectorCSSAgent::create(m_instrumentingAgents.get(), m_state.get(), domAgent, pageAgent, resourceAgent));
 
     m_agents.append(InspectorDatabaseAgent::create(m_instrumentingAgents.get(), m_state.get()));
 
@@ -111,7 +115,6 @@
     m_agents.append(timelineAgentPtr.release());
 
     m_agents.append(InspectorApplicationCacheAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent));
-    m_agents.append(InspectorResourceAgent::create(m_instrumentingAgents.get(), pageAgent, inspectorClient, m_state.get(), m_overlay.get()));
 
     PageScriptDebugServer* pageScriptDebugServer = &PageScriptDebugServer::shared();
 
diff --git a/Source/core/inspector/InspectorDOMAgent.cpp b/Source/core/inspector/InspectorDOMAgent.cpp
index 7426d72..c9783be 100644
--- a/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/Source/core/inspector/InspectorDOMAgent.cpp
@@ -43,8 +43,8 @@
 #include "core/dom/DocumentFragment.h"
 #include "core/dom/DocumentType.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/Node.h"
 #include "core/dom/NodeList.h"
 #include "core/dom/NodeTraversal.h"
@@ -960,12 +960,12 @@
             case Node::COMMENT_NODE:
             case Node::CDATA_SECTION_NODE: {
                 String text = node->nodeValue();
-                if (text.findIgnoringCase(whitespaceTrimmedQuery) != notFound)
+                if (text.findIgnoringCase(whitespaceTrimmedQuery) != kNotFound)
                     resultCollector.add(node);
                 break;
             }
             case Node::ELEMENT_NODE: {
-                if ((!startTagFound && !endTagFound && (node->nodeName().findIgnoringCase(tagNameQuery) != notFound))
+                if ((!startTagFound && !endTagFound && (node->nodeName().findIgnoringCase(tagNameQuery) != kNotFound))
                     || (startTagFound && endTagFound && equalIgnoringCase(node->nodeName(), tagNameQuery))
                     || (startTagFound && !endTagFound && node->nodeName().startsWith(tagNameQuery, false))
                     || (!startTagFound && endTagFound && node->nodeName().endsWith(tagNameQuery, false))) {
@@ -981,12 +981,12 @@
                 for (unsigned i = 0; i < numAttrs; ++i) {
                     // Add attribute pair
                     const Attribute* attribute = element->attributeItem(i);
-                    if (attribute->localName().find(whitespaceTrimmedQuery) != notFound) {
+                    if (attribute->localName().find(whitespaceTrimmedQuery) != kNotFound) {
                         resultCollector.add(node);
                         break;
                     }
                     size_t foundPosition = attribute->value().find(attributeQuery);
-                    if (foundPosition != notFound) {
+                    if (foundPosition != kNotFound) {
                         if (!exactAttributeMatch || (!foundPosition && attribute->value().length() == attributeQuery.length())) {
                             resultCollector.add(node);
                             break;
@@ -1982,6 +1982,22 @@
     }
 }
 
+void InspectorDOMAgent::getRelayoutBoundary(ErrorString* errorString, int nodeId, int* relayoutBoundaryNodeId)
+{
+    Node* node = assertNode(errorString, nodeId);
+    if (!node)
+        return;
+    RenderObject* renderer = node->renderer();
+    if (!renderer) {
+        *errorString = "No renderer for node, perhaps orphan or hidden node";
+        return;
+    }
+    while (renderer && !renderer->isRoot() && !renderer->isRelayoutBoundaryForInspector())
+        renderer = renderer->container();
+    Node* resultNode = renderer ? renderer->generatingNode() : node->ownerDocument();
+    *relayoutBoundaryNodeId = pushNodePathToFrontend(resultNode);
+}
+
 PassRefPtr<TypeBuilder::Runtime::RemoteObject> InspectorDOMAgent::resolveNode(Node* node, const String& objectGroup)
 {
     Document* document = node->isDocumentNode() ? &node->document() : node->ownerDocument();
diff --git a/Source/core/inspector/InspectorDOMAgent.h b/Source/core/inspector/InspectorDOMAgent.h
index b70b4b0..7ee0b45 100644
--- a/Source/core/inspector/InspectorDOMAgent.h
+++ b/Source/core/inspector/InspectorDOMAgent.h
@@ -150,6 +150,7 @@
     virtual void setFileInputFiles(ErrorString*, int nodeId, const RefPtr<JSONArray>& files);
     virtual void getBoxModel(ErrorString*, int nodeId, RefPtr<TypeBuilder::DOM::BoxModel>&);
     virtual void getNodeForLocation(ErrorString*, int x, int y, int* nodeId);
+    virtual void getRelayoutBoundary(ErrorString*, int nodeId, int* relayoutBoundaryNodeId);
 
     static void getEventListeners(Node*, Vector<EventListenerInfo>& listenersArray, bool includeAncestors);
 
diff --git a/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index c6eb6fa..055bdaf 100644
--- a/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -32,7 +32,7 @@
 #include "core/inspector/InspectorDOMDebuggerAgent.h"
 
 #include "InspectorFrontend.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/inspector/InspectorDOMAgent.h"
 #include "core/inspector/InspectorDebuggerAgent.h"
 #include "core/inspector/InspectorState.h"
@@ -459,7 +459,7 @@
 
 void InspectorDOMDebuggerAgent::didFireWebGLErrorOrWarning(const String& message)
 {
-    if (message.findIgnoringCase("error") != WTF::notFound)
+    if (message.findIgnoringCase("error") != WTF::kNotFound)
         didFireWebGLError(String());
     else
         didFireWebGLWarning();
diff --git a/Source/core/inspector/InspectorDatabaseAgent.cpp b/Source/core/inspector/InspectorDatabaseAgent.cpp
index e4bb33e..22ead3e 100644
--- a/Source/core/inspector/InspectorDatabaseAgent.cpp
+++ b/Source/core/inspector/InspectorDatabaseAgent.cpp
@@ -217,6 +217,7 @@
 
 InspectorDatabaseAgent::InspectorDatabaseAgent(InstrumentingAgents* instrumentingAgents, InspectorCompositeState* state)
     : InspectorBaseAgent<InspectorDatabaseAgent>("Database", instrumentingAgents, state)
+    , m_frontend(0)
     , m_enabled(false)
 {
     m_instrumentingAgents->setInspectorDatabaseAgent(this);
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index db63572..78c91aa 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -675,12 +675,27 @@
     scriptDebugServer().continueProgram();
 }
 
-void InspectorDebuggerAgent::stepOver(ErrorString* errorString)
+void InspectorDebuggerAgent::stepOver(ErrorString* errorString, const String* callFrameId)
 {
     if (!assertPaused(errorString))
         return;
+    ScriptValue frame;
+    if (callFrameId) {
+        if (m_currentCallStack.isNull()) {
+            *errorString = "Attempt to access callframe when debugger is not on pause";
+            return;
+        }
+        InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(*callFrameId);
+        if (injectedScript.hasNoValue()) {
+            *errorString = "Inspected frame has gone";
+            return;
+        }
+        frame = injectedScript.findCallframeById(errorString, m_currentCallStack, *callFrameId);
+        if (!errorString->isEmpty())
+            return;
+    }
     m_injectedScriptManager->releaseObjectGroup(InspectorDebuggerAgent::backtraceObjectGroup);
-    scriptDebugServer().stepOverStatement();
+    scriptDebugServer().stepOverStatement(frame);
 }
 
 void InspectorDebuggerAgent::stepInto(ErrorString* errorString)
diff --git a/Source/core/inspector/InspectorDebuggerAgent.h b/Source/core/inspector/InspectorDebuggerAgent.h
index b4b281e..d1018f2 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.h
+++ b/Source/core/inspector/InspectorDebuggerAgent.h
@@ -106,7 +106,7 @@
     virtual void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>&);
     virtual void pause(ErrorString*);
     virtual void resume(ErrorString*);
-    virtual void stepOver(ErrorString*);
+    virtual void stepOver(ErrorString*, const String* callFrameId);
     virtual void stepInto(ErrorString*);
     virtual void stepOut(ErrorString*);
     virtual void setPauseOnExceptions(ErrorString*, const String& pauseState);
diff --git a/Source/core/inspector/InspectorFileSystemAgent.cpp b/Source/core/inspector/InspectorFileSystemAgent.cpp
index b16d966..73ae624 100644
--- a/Source/core/inspector/InspectorFileSystemAgent.cpp
+++ b/Source/core/inspector/InspectorFileSystemAgent.cpp
@@ -34,7 +34,7 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/fetch/TextResourceDecoder.h"
 #include "core/fileapi/File.h"
 #include "core/fileapi/FileError.h"
diff --git a/Source/core/inspector/InspectorFrontendHost.cpp b/Source/core/inspector/InspectorFrontendHost.cpp
index c4b6fbc..a8e0d6b 100644
--- a/Source/core/inspector/InspectorFrontendHost.cpp
+++ b/Source/core/inspector/InspectorFrontendHost.cpp
@@ -45,6 +45,7 @@
 #include "core/platform/ContextMenuItem.h"
 #include "core/platform/JSONValues.h"
 #include "core/platform/Pasteboard.h"
+#include "core/platform/SharedBuffer.h"
 #include "core/platform/network/ResourceError.h"
 #include "core/platform/network/ResourceRequest.h"
 #include "core/platform/network/ResourceResponse.h"
@@ -218,21 +219,19 @@
 
 String InspectorFrontendHost::loadResourceSynchronously(const String& url)
 {
-    ResourceRequest request(url);
-    request.setHTTPMethod("GET");
-
-    Vector<char> data;
-    ResourceError error;
-    ResourceResponse response;
-    m_frontendPage->mainFrame()->document()->fetcher()->fetchSynchronously(request, DoNotAllowStoredCredentials, error, response, data);
-    WTF::TextEncoding textEncoding(response.textEncodingName());
+    FetchRequest request(url, FetchInitiatorInfo());
+    ResourcePtr<Resource> resource = m_frontendPage->mainFrame()->document()->fetcher()->fetchSynchronously(request);
+    if (!resource)
+        return emptyString();
+    WTF::TextEncoding textEncoding(resource->response().textEncodingName());
     bool useDetector = false;
     if (!textEncoding.isValid()) {
         textEncoding = UTF8Encoding();
         useDetector = true;
     }
     RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", textEncoding, useDetector);
-    return decoder->decode(data.data(), data.size()) + decoder->flush();
+    SharedBuffer* data = resource->resourceBuffer();
+    return decoder->decode(data->data(), data->size()) + decoder->flush();
 }
 
 String InspectorFrontendHost::getSelectionBackgroundColor()
diff --git a/Source/core/inspector/InspectorHeapProfilerAgent.cpp b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
index d85ed88..b8c9e1b 100644
--- a/Source/core/inspector/InspectorHeapProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorHeapProfilerAgent.cpp
@@ -44,8 +44,6 @@
 static const char profileHeadersRequested[] = "profileHeadersRequested";
 }
 
-static const char* const userInitiatedProfileNameHeap = "org.webkit.profiles.user-initiated";
-
 class InspectorHeapProfilerAgent::HeapStatsUpdateTask {
 public:
     HeapStatsUpdateTask(InspectorHeapProfilerAgent*);
@@ -263,9 +261,7 @@
         int m_totalWork;
     };
 
-    String title = String(userInitiatedProfileNameHeap) + "." + String::number(m_nextUserInitiatedHeapSnapshotNumber);
-    ++m_nextUserInitiatedHeapSnapshotNumber;
-
+    String title = "Snapshot " + String::number(m_nextUserInitiatedHeapSnapshotNumber++);
     HeapSnapshotProgress progress(reportProgress && *reportProgress ? m_frontend : 0);
     RefPtr<ScriptHeapSnapshot> snapshot = ScriptProfiler::takeHeapSnapshot(title, &progress);
     if (snapshot) {
diff --git a/Source/core/inspector/InspectorIndexedDBAgent.cpp b/Source/core/inspector/InspectorIndexedDBAgent.cpp
index b6c1bde..27195b4 100644
--- a/Source/core/inspector/InspectorIndexedDBAgent.cpp
+++ b/Source/core/inspector/InspectorIndexedDBAgent.cpp
@@ -36,8 +36,8 @@
 #include "bindings/v8/ScriptController.h"
 #include "core/dom/DOMStringList.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventListener.h"
+#include "core/events/Event.h"
+#include "core/events/EventListener.h"
 #include "core/inspector/InjectedScript.h"
 #include "core/inspector/InspectorPageAgent.h"
 #include "core/inspector/InspectorState.h"
diff --git a/Source/core/inspector/InspectorInstrumentation.cpp b/Source/core/inspector/InspectorInstrumentation.cpp
index 4788d69..c3d4718 100644
--- a/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/Source/core/inspector/InspectorInstrumentation.cpp
@@ -249,6 +249,7 @@
 const char Layer[] = "Layer";
 const char BeginFrame[] = "BeginFrame";
 const char UpdateLayer[] = "UpdateLayer";
+const char DrawLazyPixelRef[] = "DrawLazyPixelRef";
 };
 
 namespace InstrumentationEventArguments {
@@ -256,6 +257,7 @@
 const char LayerTreeId[] = "layerTreeId";
 const char NodeId[] = "nodeId";
 const char PageId[] = "pageId";
+const char PixelRefId[] = "pixelRefId";
 };
 
 InstrumentingAgents* instrumentationForPage(Page* page)
diff --git a/Source/core/inspector/InspectorInstrumentation.h b/Source/core/inspector/InspectorInstrumentation.h
index 3e4f9e2..bd16823 100644
--- a/Source/core/inspector/InspectorInstrumentation.h
+++ b/Source/core/inspector/InspectorInstrumentation.h
@@ -35,7 +35,7 @@
 #include "core/css/CSSSelector.h"
 #include "core/css/CSSStyleSheet.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/inspector/ConsoleAPITypes.h"
 #include "core/page/Frame.h"
@@ -133,6 +133,7 @@
 extern const char LayerTreeId[];
 extern const char NodeId[];
 extern const char PageId[];
+extern const char PixelRefId[];
 };
 
 namespace InspectorInstrumentation {
diff --git a/Source/core/inspector/InspectorInstrumentation.idl b/Source/core/inspector/InspectorInstrumentation.idl
index eadbef4..578c857 100644
--- a/Source/core/inspector/InspectorInstrumentation.idl
+++ b/Source/core/inspector/InspectorInstrumentation.idl
@@ -307,12 +307,6 @@
     void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
 
     [Resource]
-    void willLoadXHRSynchronously(ScriptExecutionContext*);
-
-    [Resource]
-    void didLoadXHRSynchronously(ScriptExecutionContext*);
-
-    [Resource]
     void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
 
     [Debugger]
diff --git a/Source/core/inspector/InspectorOverlay.cpp b/Source/core/inspector/InspectorOverlay.cpp
index cb81f13..6811ffd 100644
--- a/Source/core/inspector/InspectorOverlay.cpp
+++ b/Source/core/inspector/InspectorOverlay.cpp
@@ -35,6 +35,7 @@
 #include "bindings/v8/ScriptSourceCode.h"
 #include "core/dom/Element.h"
 #include "core/dom/Node.h"
+#include "core/dom/PseudoElement.h"
 #include "core/inspector/InspectorClient.h"
 #include "core/inspector/InspectorOverlayHost.h"
 #include "core/loader/DocumentLoader.h"
@@ -51,6 +52,7 @@
 #include "core/rendering/RenderBoxModelObject.h"
 #include "core/rendering/RenderInline.h"
 #include "core/rendering/RenderObject.h"
+#include "core/rendering/style/RenderStyleConstants.h"
 #include "wtf/text/StringBuilder.h"
 
 namespace WebCore {
@@ -532,13 +534,19 @@
     if (node->isElementNode() && m_nodeHighlightConfig.showInfo && node->renderer() && node->document().frame()) {
         RefPtr<JSONObject> elementInfo = JSONObject::create();
         Element* element = toElement(node);
-        bool isXHTML = element->document().isXHTMLDocument();
-        elementInfo->setString("tagName", isXHTML ? element->nodeName() : element->nodeName().lower());
-        elementInfo->setString("idValue", element->getIdAttribute());
-        HashSet<AtomicString> usedClassNames;
-        if (element->hasClass() && element->isStyledElement()) {
-            StringBuilder classNames;
-            const SpaceSplitString& classNamesString = element->classNames();
+        Element* realElement = element;
+        PseudoElement* pseudoElement = 0;
+        if (element->isPseudoElement()) {
+            pseudoElement = toPseudoElement(element);
+            realElement = element->parentOrShadowHostElement();
+        }
+        bool isXHTML = realElement->document().isXHTMLDocument();
+        elementInfo->setString("tagName", isXHTML ? realElement->nodeName() : realElement->nodeName().lower());
+        elementInfo->setString("idValue", realElement->getIdAttribute());
+        StringBuilder classNames;
+        if (realElement->hasClass() && realElement->isStyledElement()) {
+            HashSet<AtomicString> usedClassNames;
+            const SpaceSplitString& classNamesString = realElement->classNames();
             size_t classNameCount = classNamesString.size();
             for (size_t i = 0; i < classNameCount; ++i) {
                 const AtomicString& className = classNamesString[i];
@@ -547,8 +555,15 @@
                 classNames.append('.');
                 classNames.append(className);
             }
-            elementInfo->setString("className", classNames.toString());
         }
+        if (pseudoElement) {
+            if (pseudoElement->pseudoId() == BEFORE)
+                classNames.append(":before");
+            else if (pseudoElement->pseudoId() == AFTER)
+                classNames.append(":after");
+        }
+        if (!classNames.isEmpty())
+            elementInfo->setString("className", classNames.toString());
 
         RenderObject* renderer = node->renderer();
         Frame* containingFrame = node->document().frame();
diff --git a/Source/core/inspector/InspectorPageAgent.cpp b/Source/core/inspector/InspectorPageAgent.cpp
index 51f34a4..00bef93 100644
--- a/Source/core/inspector/InspectorPageAgent.cpp
+++ b/Source/core/inspector/InspectorPageAgent.cpp
@@ -156,17 +156,16 @@
 
 static PassRefPtr<TextResourceDecoder> createXHRTextDecoder(const String& mimeType, const String& textEncodingName)
 {
-    RefPtr<TextResourceDecoder> decoder;
     if (!textEncodingName.isEmpty())
-        decoder = TextResourceDecoder::create("text/plain", textEncodingName);
-    else if (DOMImplementation::isXMLMIMEType(mimeType.lower())) {
-        decoder = TextResourceDecoder::create("application/xml");
+        return TextResourceDecoder::create("text/plain", textEncodingName);
+    if (DOMImplementation::isXMLMIMEType(mimeType.lower())) {
+        RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
         decoder->useLenientXMLDecoding();
-    } else if (equalIgnoringCase(mimeType, "text/html"))
-        decoder = TextResourceDecoder::create("text/html", "UTF-8");
-    else
-        decoder = TextResourceDecoder::create("text/plain", "UTF-8");
-    return decoder;
+        return decoder;
+    }
+    if (equalIgnoringCase(mimeType, "text/html"))
+        return TextResourceDecoder::create("text/html", "UTF-8");
+    return TextResourceDecoder::create("text/plain", "UTF-8");
 }
 
 bool InspectorPageAgent::cachedResourceContent(Resource* cachedResource, String* result, bool* base64Encoded)
@@ -207,9 +206,6 @@
             if (!buffer)
                 return false;
             RefPtr<TextResourceDecoder> decoder = createXHRTextDecoder(cachedResource->response().mimeType(), cachedResource->response().textEncodingName());
-            // We show content for raw resources only for certain mime types (text, html and xml). Otherwise decoder will be null.
-            if (!decoder)
-                return false;
             String content = decoder->decode(buffer->data(), buffer->size());
             *result = content + decoder->flush();
             return true;
diff --git a/Source/core/inspector/InspectorPageAgent.h b/Source/core/inspector/InspectorPageAgent.h
index 8ae2721..b1dd8ac 100644
--- a/Source/core/inspector/InspectorPageAgent.h
+++ b/Source/core/inspector/InspectorPageAgent.h
@@ -78,7 +78,6 @@
 
     static bool cachedResourceContent(Resource*, String* result, bool* base64Encoded);
     static bool sharedBufferContent(PassRefPtr<SharedBuffer>, const String& textEncodingName, bool withBase64Encode, String* result);
-    static void resourceContent(ErrorString*, Frame*, const KURL&, String* result, bool* base64Encoded);
 
     static PassRefPtr<SharedBuffer> resourceData(Frame*, const KURL&, String* textEncodingName);
     static Resource* cachedResource(Frame*, const KURL&);
@@ -178,6 +177,8 @@
     static DocumentLoader* assertDocumentLoader(ErrorString*, Frame*);
 
 private:
+    static void resourceContent(ErrorString*, Frame*, const KURL&, String* result, bool* base64Encoded);
+
     InspectorPageAgent(InstrumentingAgents*, Page*, InspectorCompositeState*, InjectedScriptManager*, InspectorClient*, InspectorOverlay*);
     bool deviceMetricsChanged(int width, int height, double fontScaleFactor, bool fitWindow);
     void updateViewMetrics(int, int, double, bool);
diff --git a/Source/core/inspector/InspectorProfilerAgent.cpp b/Source/core/inspector/InspectorProfilerAgent.cpp
index e842474..1eeca34 100644
--- a/Source/core/inspector/InspectorProfilerAgent.cpp
+++ b/Source/core/inspector/InspectorProfilerAgent.cpp
@@ -47,12 +47,12 @@
 namespace WebCore {
 
 namespace ProfilerAgentState {
+static const char samplingInterval[] = "samplingInterval";
 static const char userInitiatedProfiling[] = "userInitiatedProfiling";
 static const char profilerEnabled[] = "profilerEnabled";
 static const char profileHeadersRequested[] = "profileHeadersRequested";
 }
 
-static const char* const userInitiatedProfileName = "org.webkit.profiles.user-initiated";
 static const char* const CPUProfileType = "CPU";
 
 PassOwnPtr<InspectorProfilerAgent> InspectorProfilerAgent::create(InstrumentingAgents* instrumentingAgents, InspectorConsoleAgent* consoleAgent, InspectorCompositeState* inspectorState, InjectedScriptManager* injectedScriptManager)
@@ -112,6 +112,11 @@
 void InspectorProfilerAgent::enable(ErrorString*)
 {
     m_state->setBoolean(ProfilerAgentState::profilerEnabled, true);
+    doEnable();
+}
+
+void InspectorProfilerAgent::doEnable()
+{
     m_instrumentingAgents->setInspectorProfilerAgent(this);
 }
 
@@ -127,12 +132,22 @@
     return m_state->getBoolean(ProfilerAgentState::profilerEnabled);
 }
 
+void InspectorProfilerAgent::setSamplingInterval(ErrorString* error, int interval)
+{
+    if (m_recordingCPUProfile) {
+        *error = "Cannot change sampling interval when profiling.";
+        return;
+    }
+    m_state->setLong(ProfilerAgentState::samplingInterval, interval);
+    ScriptProfiler::setSamplingInterval(interval);
+}
+
 String InspectorProfilerAgent::getCurrentUserInitiatedProfileName(bool incrementProfileNumber)
 {
     if (incrementProfileNumber)
         m_currentUserInitiatedProfileNumber = m_nextUserInitiatedProfileNumber++;
 
-    return String(userInitiatedProfileName) + "." + String::number(m_currentUserInitiatedProfileNumber);
+    return "Profile " + String::number(m_currentUserInitiatedProfileNumber);
 }
 
 void InspectorProfilerAgent::getProfileHeaders(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Profiler::ProfileHeader> >& headers)
@@ -204,7 +219,11 @@
 
 void InspectorProfilerAgent::restore()
 {
+    if (m_state->getBoolean(ProfilerAgentState::profilerEnabled))
+        doEnable();
     resetFrontendProfiles();
+    if (long interval = m_state->getLong(ProfilerAgentState::samplingInterval, 0))
+        ScriptProfiler::setSamplingInterval(interval);
     if (m_state->getBoolean(ProfilerAgentState::userInitiatedProfiling))
         start();
 }
diff --git a/Source/core/inspector/InspectorProfilerAgent.h b/Source/core/inspector/InspectorProfilerAgent.h
index 42fe08b..1f9c2a0 100644
--- a/Source/core/inspector/InspectorProfilerAgent.h
+++ b/Source/core/inspector/InspectorProfilerAgent.h
@@ -61,6 +61,7 @@
 
     virtual void enable(ErrorString*);
     virtual void disable(ErrorString*);
+    virtual void setSamplingInterval(ErrorString*, int);
     virtual void start(ErrorString* = 0);
     virtual void stop(ErrorString*, RefPtr<TypeBuilder::Profiler::ProfileHeader>& header);
 
@@ -84,6 +85,8 @@
 private:
     InspectorProfilerAgent(InstrumentingAgents*, InspectorConsoleAgent*, InspectorCompositeState*, InjectedScriptManager*);
 
+    void doEnable();
+
     void addProfile(PassRefPtr<ScriptProfile> prpProfile, unsigned lineNumber, const String& sourceURL);
 
     void resetFrontendProfiles();
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index fad8d67..643b99c 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -40,6 +40,7 @@
 #include "core/fetch/FetchInitiatorInfo.h"
 #include "core/fetch/MemoryCache.h"
 #include "core/fetch/Resource.h"
+#include "core/fetch/ResourceFetcher.h"
 #include "core/fetch/ResourceLoader.h"
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorClient.h"
@@ -286,6 +287,8 @@
 
 void InspectorResourceAgent::willSendRequest(unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiatorInfo& initiatorInfo)
 {
+    if (initiatorInfo.name == FetchInitiatorTypeNames::inspector)
+        return;
     String requestId = IdentifiersFactory::requestId(identifier);
     m_resourcesData->resourceCreated(requestId, m_pageAgent->loaderId(loader));
 
@@ -350,7 +353,7 @@
     }
 
     InspectorPageAgent::ResourceType type = cachedResource ? InspectorPageAgent::cachedResourceType(*cachedResource) : InspectorPageAgent::OtherResource;
-    if (m_loadingXHRSynchronously || m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
+    if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::XHRResource)
         type = InspectorPageAgent::XHRResource;
     else if (m_resourcesData->resourceType(requestId) == InspectorPageAgent::ScriptResource)
         type = InspectorPageAgent::ScriptResource;
@@ -377,7 +380,7 @@
 
     if (data) {
         NetworkResourcesData::ResourceData const* resourceData = m_resourcesData->data(requestId);
-        if (resourceData && !m_loadingXHRSynchronously && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
+        if (resourceData && (!resourceData->cachedResource() || resourceData->cachedResource()->dataBufferingPolicy() == DoNotBufferData || isErrorStatusCode(resourceData->httpStatusCode())))
             m_resourcesData->maybeAddResourceData(requestId, data, dataLength);
     }
 
@@ -452,10 +455,6 @@
 
 void InspectorResourceAgent::didFinishXHRLoading(ThreadableLoaderClient* client, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned)
 {
-    // For Asynchronous XHRs, the inspector can grab the data directly off of the Resource. For sync XHRs, we need to
-    // provide the data here, since no Resource was involved.
-    if (m_loadingXHRSynchronously)
-        m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString.flattenToString());
     m_pendingXHRReplayData.remove(client);
 }
 
@@ -464,16 +463,6 @@
     m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::XHRResource);
 }
 
-void InspectorResourceAgent::willLoadXHRSynchronously()
-{
-    m_loadingXHRSynchronously = true;
-}
-
-void InspectorResourceAgent::didLoadXHRSynchronously()
-{
-    m_loadingXHRSynchronously = false;
-}
-
 void InspectorResourceAgent::willDestroyResource(Resource* cachedResource)
 {
     Vector<String> requestIds = m_resourcesData->removeResource(cachedResource);
@@ -776,6 +765,27 @@
     m_frameNavigationInitiatorMap.remove(m_pageAgent->frameId(frame));
 }
 
+bool InspectorResourceAgent::fetchResourceContent(Frame* frame, const KURL& url, String* content, bool* base64Encoded)
+{
+    // First try to fetch content from the cached resource.
+    Resource* cachedResource = frame->document()->fetcher()->cachedResource(url);
+    if (!cachedResource)
+        cachedResource = memoryCache()->resourceForURL(url);
+    if (cachedResource && InspectorPageAgent::cachedResourceContent(cachedResource, content, base64Encoded))
+        return true;
+
+    // Then fall back to resource data.
+    Vector<NetworkResourcesData::ResourceData*> resources = m_resourcesData->resources();
+    for (Vector<NetworkResourcesData::ResourceData*>::iterator it = resources.begin(); it != resources.end(); ++it) {
+        if ((*it)->url() == url) {
+            *content = (*it)->content();
+            *base64Encoded = (*it)->base64Encoded();
+            return true;
+        }
+    }
+    return false;
+}
+
 InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client, InspectorCompositeState* state, InspectorOverlay* overlay)
     : InspectorBaseAgent<InspectorResourceAgent>("Network", instrumentingAgents, state)
     , m_pageAgent(pageAgent)
@@ -783,10 +793,8 @@
     , m_overlay(overlay)
     , m_frontend(0)
     , m_resourcesData(adoptPtr(new NetworkResourcesData()))
-    , m_loadingXHRSynchronously(false)
     , m_isRecalculatingStyle(false)
 {
 }
 
 } // namespace WebCore
-
diff --git a/Source/core/inspector/InspectorResourceAgent.h b/Source/core/inspector/InspectorResourceAgent.h
index df8578b..5d5e15c 100644
--- a/Source/core/inspector/InspectorResourceAgent.h
+++ b/Source/core/inspector/InspectorResourceAgent.h
@@ -88,6 +88,7 @@
 
     ~InspectorResourceAgent();
 
+    // Called from instrumentation.
     void willSendRequest(unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse, const FetchInitiatorInfo&);
     void markResourceAsCached(unsigned long identifier);
     void didReceiveResourceResponse(unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
@@ -104,14 +105,12 @@
     void didFailXHRLoading(ThreadableLoaderClient*);
     void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, ScriptString sourceString, const String&, const String&, unsigned);
     void didReceiveXHRResponse(unsigned long identifier);
-    void willLoadXHRSynchronously();
-    void didLoadXHRSynchronously();
 
     void willDestroyResource(Resource*);
 
     void applyUserAgentOverride(String* userAgent);
 
-    // FIXME: InspectorResourceAgent should now be aware of style recalculation.
+    // FIXME: InspectorResourceAgent should not be aware of style recalculation.
     void willRecalculateStyle(Document*);
     void didRecalculateStyle();
     void didScheduleStyleRecalculation(Document*);
@@ -149,6 +148,9 @@
 
     virtual void loadResourceForFrontend(ErrorString*, const String& frameId, const String& url, const RefPtr<JSONObject>* requestHeaders, PassRefPtr<LoadResourceForFrontendCallback>);
 
+    // Called from other agents.
+    bool fetchResourceContent(Frame*, const KURL&, String* content, bool* base64Encoded);
+
 private:
     InspectorResourceAgent(InstrumentingAgents*, InspectorPageAgent*, InspectorClient*, InspectorCompositeState*, InspectorOverlay*);
 
@@ -160,7 +162,6 @@
     InspectorFrontend::Network* m_frontend;
     String m_userAgentOverride;
     OwnPtr<NetworkResourcesData> m_resourcesData;
-    bool m_loadingXHRSynchronously;
 
     typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData> > PendingXHRReplayDataMap;
     PendingXHRReplayDataMap m_pendingXHRReplayData;
diff --git a/Source/core/inspector/InspectorStyleSheet.cpp b/Source/core/inspector/InspectorStyleSheet.cpp
index 56d40a9..54e9ee3 100644
--- a/Source/core/inspector/InspectorStyleSheet.cpp
+++ b/Source/core/inspector/InspectorStyleSheet.cpp
@@ -50,6 +50,7 @@
 #include "core/inspector/ContentSearchUtils.h"
 #include "core/inspector/InspectorCSSAgent.h"
 #include "core/inspector/InspectorPageAgent.h"
+#include "core/inspector/InspectorResourceAgent.h"
 #include "core/page/Page.h"
 #include "core/page/PageConsole.h"
 #include "core/platform/JSONValues.h"
@@ -208,7 +209,7 @@
 inline void StyleSheetHandler::setRuleHeaderEnd(const CharacterType* dataStart, unsigned listEndOffset)
 {
     while (listEndOffset > 1) {
-        if (isHTMLSpace(*(dataStart + listEndOffset - 1)))
+        if (isHTMLSpace<CharacterType>(*(dataStart + listEndOffset - 1)))
             --listEndOffset;
         else
             break;
@@ -303,7 +304,7 @@
         else
             propertyEndInStyleSheet = styleStart + nextData->range.start - 1;
 
-        while (isHTMLSpace(characters[propertyEndInStyleSheet]))
+        while (isHTMLSpace<CharacterType>(characters[propertyEndInStyleSheet]))
             --propertyEndInStyleSheet;
 
         // propertyEndInStyleSheet points at the last property text character.
@@ -315,7 +316,7 @@
                 ++valueStartInStyleSheet;
             if (valueStartInStyleSheet < propertyEndInStyleSheet)
                 ++valueStartInStyleSheet; // Shift past the ':'.
-            while (valueStartInStyleSheet < propertyEndInStyleSheet && isHTMLSpace(characters[valueStartInStyleSheet]))
+            while (valueStartInStyleSheet < propertyEndInStyleSheet && isHTMLSpace<CharacterType>(characters[valueStartInStyleSheet]))
                 ++valueStartInStyleSheet;
             // Need to exclude the trailing ';' from the property value.
             currentData->value = String(characters + valueStartInStyleSheet, propertyEndInStyleSheet - valueStartInStyleSheet + (characters[propertyEndInStyleSheet] == ';' ? 0 : 1));
@@ -362,7 +363,7 @@
     if (propertyString.endsWith(';'))
         propertyString = propertyString.left(propertyString.length() - 1);
     size_t colonIndex = propertyString.find(':');
-    ASSERT(colonIndex != notFound);
+    ASSERT(colonIndex != kNotFound);
 
     String name = propertyString.left(colonIndex).stripWhiteSpace();
     String value = propertyString.substring(colonIndex + 1, propertyString.length()).stripWhiteSpace();
@@ -554,7 +555,7 @@
     DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee"));
 
     if (!m_parentStyleSheet->ensureParsedDataReady()) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -569,27 +570,27 @@
 
         // At least one property + the bogus property added just above should be present.
         if (propertyCount < 2) {
-            es.throwDOMException(SyntaxError);
+            es.throwUninformativeAndGenericDOMException(SyntaxError);
             return false;
         }
 
         // Check for the proper propertyText termination (the parser could at least restore to the PROPERTY_NAME state).
         if (propertyData.at(propertyCount - 1).name != bogusPropertyName) {
-            es.throwDOMException(SyntaxError);
+            es.throwUninformativeAndGenericDOMException(SyntaxError);
             return false;
         }
     }
 
     RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
     if (!sourceData) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     String text;
     bool success = styleText(&text);
     if (!success) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -599,7 +600,7 @@
     InspectorStyleTextEditor editor(&allProperties, text, newLineAndWhitespaceDelimiters());
     if (overwrite) {
         if (index >= allProperties.size()) {
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return false;
         }
         *oldText = allProperties.at(index).rawText;
@@ -614,27 +615,27 @@
 {
     ASSERT(m_parentStyleSheet);
     if (!m_parentStyleSheet->ensureParsedDataReady()) {
-        es.throwDOMException(NoModificationAllowedError);
+        es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
         return false;
     }
 
     RefPtr<CSSRuleSourceData> sourceData = extractSourceData();
     if (!sourceData) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     String text;
     bool success = styleText(&text);
     if (!success) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     Vector<InspectorStyleProperty> allProperties;
     populateAllProperties(allProperties);
     if (index >= allProperties.size()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return false;
     }
 
@@ -914,7 +915,7 @@
                 if (!lineFeedTerminated)
                     formatLineFeed.append(ch);
                 prefix.clear();
-            } else if (isHTMLSpace(ch))
+            } else if (isHTMLSpace<UChar>(ch))
                 prefix.append(ch);
             else {
                 candidatePrefix = prefix.toString();
@@ -943,9 +944,9 @@
     return m_parentStyleSheet->pageStyleSheet() ? m_parentStyleSheet->pageStyleSheet()->ownerDocument() : 0;
 }
 
-PassRefPtr<InspectorStyleSheet> InspectorStyleSheet::create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* listener)
+PassRefPtr<InspectorStyleSheet> InspectorStyleSheet::create(InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* listener)
 {
-    return adoptRef(new InspectorStyleSheet(pageAgent, id, pageStyleSheet, origin, documentURL, listener));
+    return adoptRef(new InspectorStyleSheet(pageAgent, resourceAgent, id, pageStyleSheet, origin, documentURL, listener));
 }
 
 // static
@@ -983,8 +984,9 @@
     }
 }
 
-InspectorStyleSheet::InspectorStyleSheet(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* listener)
+InspectorStyleSheet::InspectorStyleSheet(InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, const String& documentURL, Listener* listener)
     : m_pageAgent(pageAgent)
+    , m_resourceAgent(resourceAgent)
     , m_id(id)
     , m_pageStyleSheet(pageStyleSheet)
     , m_origin(origin)
@@ -1048,7 +1050,7 @@
 {
     CSSStyleRule* rule = ruleForId(id);
     if (!rule) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return "";
     }
     return rule->selectorText();
@@ -1060,19 +1062,19 @@
         return false;
     CSSStyleRule* rule = ruleForId(id);
     if (!rule) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
     CSSStyleSheet* styleSheet = rule->parentStyleSheet();
     if (!styleSheet || !ensureParsedDataReady()) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     rule->setSelectorText(selector);
     RefPtr<CSSRuleSourceData> sourceData = ruleSourceDataFor(rule->style());
     if (!sourceData) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -1095,14 +1097,14 @@
     if (!checkPageStyleSheet(es))
         return 0;
     if (!checkStyleRuleSelector(m_pageStyleSheet->ownerDocument(), selector)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
     String text;
     bool success = getText(&text);
     if (!success) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return 0;
     }
     StringBuilder styleSheetText;
@@ -1121,7 +1123,7 @@
         // What we just added has to be a CSSStyleRule - we cannot handle other types of rules yet.
         // If it is not a style rule, pretend we never touched the stylesheet.
         m_pageStyleSheet->deleteRule(lastRuleIndex, ASSERT_NO_EXCEPTION);
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -1144,18 +1146,18 @@
         return false;
     RefPtr<CSSStyleRule> rule = ruleForId(id);
     if (!rule) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
     CSSStyleSheet* styleSheet = rule->parentStyleSheet();
     if (!styleSheet || !ensureParsedDataReady()) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     RefPtr<CSSRuleSourceData> sourceData = ruleSourceDataFor(rule->style());
     if (!sourceData) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -1335,13 +1337,13 @@
 {
     RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
     if (!inspectorStyle || !inspectorStyle->cssStyle()) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
     bool success = inspectorStyle->styleText(oldText);
     if (!success) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -1349,7 +1351,7 @@
     if (success)
         fireStyleSheetChanged();
     else
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
     return success;
 }
 
@@ -1357,7 +1359,7 @@
 {
     RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
     if (!inspectorStyle) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -1371,7 +1373,7 @@
 {
     RefPtr<InspectorStyle> inspectorStyle = inspectorStyleForId(id);
     if (!inspectorStyle) {
-        es.throwDOMException(NotFoundError);
+        es.throwUninformativeAndGenericDOMException(NotFoundError);
         return false;
     }
 
@@ -1539,13 +1541,13 @@
 {
     ensureFlatRules();
     size_t index = m_flatRules.find(rule);
-    return index == notFound ? UINT_MAX : static_cast<unsigned>(index);
+    return index == kNotFound ? UINT_MAX : static_cast<unsigned>(index);
 }
 
 bool InspectorStyleSheet::checkPageStyleSheet(ExceptionState& es) const
 {
     if (!m_pageStyleSheet) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return false;
     }
     return true;
@@ -1679,10 +1681,9 @@
     if (!m_pageStyleSheet || !ownerDocument() || !ownerDocument()->frame())
         return false;
 
-    String error;
     bool base64Encoded;
-    InspectorPageAgent::resourceContent(&error, ownerDocument()->frame(), KURL(ParsedURLString, m_pageStyleSheet->href()), result, &base64Encoded);
-    return error.isEmpty() && !base64Encoded;
+    bool success = m_resourceAgent->fetchResourceContent(ownerDocument()->frame(), KURL(ParsedURLString, m_pageStyleSheet->href()), result, &base64Encoded) && !base64Encoded;
+    return success;
 }
 
 bool InspectorStyleSheet::inlineStyleSheetText(String* result) const
@@ -1701,13 +1702,13 @@
     return true;
 }
 
-PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle::create(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<Element> element, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
+PassRefPtr<InspectorStyleSheetForInlineStyle> InspectorStyleSheetForInlineStyle::create(InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent, const String& id, PassRefPtr<Element> element, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
 {
-    return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, id, element, origin, listener));
+    return adoptRef(new InspectorStyleSheetForInlineStyle(pageAgent, resourceAgent, id, element, origin, listener));
 }
 
-InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPageAgent* pageAgent, const String& id, PassRefPtr<Element> element, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
-    : InspectorStyleSheet(pageAgent, id, 0, origin, "", listener)
+InspectorStyleSheetForInlineStyle::InspectorStyleSheetForInlineStyle(InspectorPageAgent* pageAgent, InspectorResourceAgent* resourceAgent, const String& id, PassRefPtr<Element> element, TypeBuilder::CSS::StyleSheetOrigin::Enum origin, Listener* listener)
+    : InspectorStyleSheet(pageAgent, resourceAgent, id, 0, origin, "", listener)
     , m_element(element)
     , m_ruleSourceData(0)
     , m_isStyleTextValid(false)
diff --git a/Source/core/inspector/InspectorStyleSheet.h b/Source/core/inspector/InspectorStyleSheet.h
index a3f37be..69d43a9 100644
--- a/Source/core/inspector/InspectorStyleSheet.h
+++ b/Source/core/inspector/InspectorStyleSheet.h
@@ -48,6 +48,7 @@
 class Element;
 class ExceptionState;
 class InspectorPageAgent;
+class InspectorResourceAgent;
 class InspectorStyleSheet;
 
 typedef Vector<RefPtr<CSSRule> > CSSRuleVector;
@@ -172,7 +173,7 @@
     };
 
     typedef HashMap<CSSStyleDeclaration*, RefPtr<InspectorStyle> > InspectorStyleMap;
-    static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
+    static PassRefPtr<InspectorStyleSheet> create(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
     static String styleSheetURL(CSSStyleSheet* pageStyleSheet);
     static void collectFlatRules(PassRefPtr<CSSRuleList>, CSSRuleVector* result);
 
@@ -180,6 +181,7 @@
 
     String id() const { return m_id; }
     String finalURL() const;
+    virtual Document* ownerDocument() const;
     bool canBind() const { return m_origin != TypeBuilder::CSS::StyleSheetOrigin::User_agent && m_origin != TypeBuilder::CSS::StyleSheetOrigin::User; }
     CSSStyleSheet* pageStyleSheet() const { return m_pageStyleSheet.get(); }
     bool isReparsing() const { return m_isReparsing; }
@@ -208,10 +210,9 @@
     InspectorCSSId styleId(CSSStyleDeclaration* style) const { return ruleOrStyleId(style); }
 
 protected:
-    InspectorStyleSheet(InspectorPageAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
+    InspectorStyleSheet(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<CSSStyleSheet> pageStyleSheet, TypeBuilder::CSS::StyleSheetOrigin::Enum, const String& documentURL, Listener*);
 
     InspectorCSSId ruleOrStyleId(CSSStyleDeclaration* style) const;
-    virtual Document* ownerDocument() const;
     virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration*) const;
     virtual unsigned ruleIndexByStyle(CSSStyleDeclaration*) const;
     virtual unsigned ruleIndexByRule(const CSSRule*) const;
@@ -242,6 +243,7 @@
     bool startsAtZero() const;
 
     InspectorPageAgent* m_pageAgent;
+    InspectorResourceAgent* m_resourceAgent;
     String m_id;
     RefPtr<CSSStyleSheet> m_pageStyleSheet;
     TypeBuilder::CSS::StyleSheetOrigin::Enum m_origin;
@@ -256,7 +258,7 @@
 
 class InspectorStyleSheetForInlineStyle : public InspectorStyleSheet {
 public:
-    static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAgent*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
+    static PassRefPtr<InspectorStyleSheetForInlineStyle> create(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
 
     void didModifyElementAttribute();
     virtual bool getText(String* result) const;
@@ -264,7 +266,7 @@
     virtual TypeBuilder::CSS::StyleSheetOrigin::Enum origin() const { return TypeBuilder::CSS::StyleSheetOrigin::Regular; }
 
 protected:
-    InspectorStyleSheetForInlineStyle(InspectorPageAgent*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
+    InspectorStyleSheetForInlineStyle(InspectorPageAgent*, InspectorResourceAgent*, const String& id, PassRefPtr<Element>, TypeBuilder::CSS::StyleSheetOrigin::Enum, Listener*);
 
     virtual Document* ownerDocument() const;
     virtual PassRefPtr<CSSRuleSourceData> ruleSourceDataFor(CSSStyleDeclaration* style) const { ASSERT_UNUSED(style, style == inlineStyle()); return m_ruleSourceData; }
diff --git a/Source/core/inspector/InspectorStyleTextEditor.cpp b/Source/core/inspector/InspectorStyleTextEditor.cpp
index f7044ff..1c538ea 100644
--- a/Source/core/inspector/InspectorStyleTextEditor.cpp
+++ b/Source/core/inspector/InspectorStyleTextEditor.cpp
@@ -69,7 +69,7 @@
         propertyStart = styleBodyLength;
         if (propertyStart && textToSet.length()) {
             long curPos = propertyStart - 1; // The last position of style declaration, since propertyStart points past one.
-            while (curPos && isHTMLSpace(m_styleText[curPos]))
+            while (curPos && isHTMLSpace<UChar>(m_styleText[curPos]))
                 --curPos;
             if (curPos) {
                 bool terminated = m_styleText[curPos] == ';' || (m_styleText[curPos] == '/' && m_styleText[curPos - 1] == '*');
diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
index 8ccb28e..411818e 100644
--- a/Source/core/inspector/InspectorTimelineAgent.cpp
+++ b/Source/core/inspector/InspectorTimelineAgent.cpp
@@ -32,7 +32,7 @@
 #include "core/inspector/InspectorTimelineAgent.h"
 
 #include "InspectorFrontend.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectorCounters.h"
 #include "core/inspector/InspectorDOMAgent.h"
@@ -51,6 +51,7 @@
 #include "core/page/PageConsole.h"
 #include "core/platform/MemoryUsageSupport.h"
 #include "core/platform/chromium/TraceEvent.h"
+#include "core/platform/graphics/chromium/DeferredImageDecoder.h"
 #include "core/platform/network/ResourceRequest.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/RenderView.h"
@@ -67,6 +68,7 @@
 static const char timelineMaxCallStackDepth[] = "timelineMaxCallStackDepth";
 static const char includeDomCounters[] = "includeDomCounters";
 static const char includeNativeMemoryStatistics[] = "includeNativeMemoryStatistics";
+static const char bufferEvents[] = "bufferEvents";
 }
 
 // Must be kept in sync with WebInspector.TimelineModel.RecordType in TimelineModel.js
@@ -128,6 +130,7 @@
 
 namespace {
 const char BackendNodeIdGroup[] = "timeline";
+const char InternalEventCategory[] = "instrumentation";
 }
 
 static Frame* frameForScriptExecutionContext(ScriptExecutionContext* context)
@@ -191,7 +194,8 @@
 void InspectorTimelineAgent::clearFrontend()
 {
     ErrorString error;
-    stop(&error);
+    RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > events;
+    stop(&error, events);
     disable(&error);
     releaseNodeIds();
     m_frontend = 0;
@@ -200,6 +204,8 @@
 void InspectorTimelineAgent::restore()
 {
     if (m_state->getBoolean(TimelineAgentState::startedFromProtocol)) {
+        if (m_state->getBoolean(TimelineAgentState::bufferEvents))
+            m_bufferedEvents = TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent>::create();
         innerStart();
     } else if (isStarted()) {
         // Timeline was started from console.timeline, it is not restored.
@@ -220,7 +226,7 @@
     m_state->setBoolean(TimelineAgentState::enabled, false);
 }
 
-void InspectorTimelineAgent::start(ErrorString* errorString, const int* maxCallStackDepth, const bool* includeDomCounters, const bool* includeNativeMemoryStatistics)
+void InspectorTimelineAgent::start(ErrorString* errorString, const int* maxCallStackDepth, const bool* bufferEvents, const bool* includeDomCounters, const bool* includeNativeMemoryStatistics)
 {
     if (!m_frontend)
         return;
@@ -236,9 +242,14 @@
         m_maxCallStackDepth = *maxCallStackDepth;
     else
         m_maxCallStackDepth = 5;
+
+    if (bufferEvents && *bufferEvents)
+        m_bufferedEvents = TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent>::create();
+
     m_state->setLong(TimelineAgentState::timelineMaxCallStackDepth, m_maxCallStackDepth);
     m_state->setBoolean(TimelineAgentState::includeDomCounters, includeDomCounters && *includeDomCounters);
     m_state->setBoolean(TimelineAgentState::includeNativeMemoryStatistics, includeNativeMemoryStatistics && *includeNativeMemoryStatistics);
+    m_state->setBoolean(TimelineAgentState::bufferEvents, bufferEvents && *bufferEvents);
 
     innerStart();
     bool fromConsole = false;
@@ -260,14 +271,18 @@
         m_traceEventProcessor = adoptRef(new TimelineTraceEventProcessor(m_weakFactory.createWeakPtr(), m_client));
 }
 
-void InspectorTimelineAgent::stop(ErrorString* errorString)
+void InspectorTimelineAgent::stop(ErrorString* errorString, RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> >& events)
 {
     m_state->setBoolean(TimelineAgentState::startedFromProtocol, false);
+    m_state->setBoolean(TimelineAgentState::bufferEvents, false);
+
     if (!isStarted()) {
         *errorString = "Timeline was not started";
         return;
     }
     innerStop(false);
+    if (m_bufferedEvents)
+        events = m_bufferedEvents.release();
 }
 
 void InspectorTimelineAgent::innerStop(bool fromConsole)
@@ -296,7 +311,7 @@
 
 void InspectorTimelineAgent::didBeginFrame()
 {
-    TRACE_EVENT_INSTANT0("webkit", InstrumentationEvents::BeginFrame);
+    TRACE_EVENT_INSTANT0(InternalEventCategory, InstrumentationEvents::BeginFrame);
     m_pendingFrameRecord = TimelineRecordFactory::createGenericRecord(timestamp(), 0, TimelineRecordType::BeginFrame);
 }
 
@@ -413,7 +428,7 @@
 void InspectorTimelineAgent::willPaint(RenderObject* renderer)
 {
     Frame* frame = renderer->frame();
-    TRACE_EVENT_INSTANT2("instrumentation", InstrumentationEvents::Paint,
+    TRACE_EVENT_INSTANT2(InternalEventCategory, InstrumentationEvents::Paint,
         InstrumentationEventArguments::PageId, reinterpret_cast<unsigned long long>(frame->page()),
         InstrumentationEventArguments::NodeId, idForNode(renderer->generatingNode()));
 
@@ -652,7 +667,7 @@
         return;
 
     size_t index = m_consoleTimelines.find(title);
-    if (index == notFound) {
+    if (index == kNotFound) {
         String message = String::format("Timeline '%s' was not started.", title.utf8().data());
         page()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, 0, state);
         return;
@@ -851,6 +866,10 @@
 {
     // FIXME: runtimeCast is a hack. We do it because we can't build TimelineEvent directly now.
     RefPtr<TypeBuilder::Timeline::TimelineEvent> recordChecked = TypeBuilder::Timeline::TimelineEvent::runtimeCast(event);
+    if (m_bufferedEvents) {
+        m_bufferedEvents->addItem(recordChecked.release());
+        return;
+    }
     m_frontend->eventRecorded(recordChecked.release());
 }
 
diff --git a/Source/core/inspector/InspectorTimelineAgent.h b/Source/core/inspector/InspectorTimelineAgent.h
index 425090e..1f2d8f2 100644
--- a/Source/core/inspector/InspectorTimelineAgent.h
+++ b/Source/core/inspector/InspectorTimelineAgent.h
@@ -34,7 +34,7 @@
 
 #include "InspectorFrontend.h"
 #include "bindings/v8/ScriptGCEvent.h"
-#include "core/dom/EventContext.h"
+#include "core/events/EventContext.h"
 #include "core/inspector/InspectorBaseAgent.h"
 #include "core/inspector/ScriptGCEventListener.h"
 #include "core/platform/JSONValues.h"
@@ -120,8 +120,8 @@
 
     virtual void enable(ErrorString*);
     virtual void disable(ErrorString*);
-    virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* includeDomCounters, const bool* includeNativeMemoryStatistics);
-    virtual void stop(ErrorString*);
+    virtual void start(ErrorString*, const int* maxCallStackDepth, const bool* bufferEvents, const bool* includeDomCounters, const bool* includeNativeMemoryStatistics);
+    virtual void stop(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> >& events);
 
     void setLayerTreeId(int layerTreeId) { m_layerTreeId = layerTreeId; }
     int layerTreeId() const { return m_layerTreeId; }
@@ -258,6 +258,7 @@
 
     void localToPageQuad(const RenderObject& renderer, const LayoutRect&, FloatQuad*);
     const TimelineTimeConverter& timeConverter() const { return m_timeConverter; }
+    const RenderImage* imageBeingPainted() const { return m_imageBeingPainted; }
     long long idForNode(Node*);
     void releaseNodeIds();
 
@@ -301,6 +302,7 @@
     int m_layerTreeId;
     RenderImage* m_imageBeingPainted;
     Vector<String> m_consoleTimelines;
+    RefPtr<TypeBuilder::Array<TypeBuilder::Timeline::TimelineEvent> > m_bufferedEvents;
 };
 
 } // namespace WebCore
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index abc5d83..ffaf8ab 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -145,6 +145,11 @@
     return result;
 }
 
+v8::Handle<v8::Object> JavaScriptCallFrame::innerCallFrame()
+{
+    return m_callFrame.newLocal(m_isolate);
+}
+
 v8::Handle<v8::Value> JavaScriptCallFrame::setVariableValue(int scopeNumber, const String& variableName, v8::Handle<v8::Value> newValue)
 {
     v8::Handle<v8::Object> callFrame = m_callFrame.newLocal(m_isolate);
diff --git a/Source/core/inspector/JavaScriptCallFrame.h b/Source/core/inspector/JavaScriptCallFrame.h
index 62aec90..2d6e857 100644
--- a/Source/core/inspector/JavaScriptCallFrame.h
+++ b/Source/core/inspector/JavaScriptCallFrame.h
@@ -63,6 +63,7 @@
     v8::Handle<v8::Value> evaluate(const String& expression);
     v8::Handle<v8::Value> restart();
     v8::Handle<v8::Value> setVariableValue(int scopeNumber, const String& variableName, v8::Handle<v8::Value> newValue);
+    v8::Handle<v8::Object> innerCallFrame();
 
 private:
     JavaScriptCallFrame(v8::Handle<v8::Context> debuggerContext, v8::Handle<v8::Object> callFrame);
diff --git a/Source/core/inspector/NetworkResourcesData.cpp b/Source/core/inspector/NetworkResourcesData.cpp
index dab7c31..7ba8df6 100644
--- a/Source/core/inspector/NetworkResourcesData.cpp
+++ b/Source/core/inspector/NetworkResourcesData.cpp
@@ -310,6 +310,14 @@
     resourceData->setXHRReplayData(reusedResourceData->xhrReplayData());
 }
 
+Vector<NetworkResourcesData::ResourceData*> NetworkResourcesData::resources()
+{
+    Vector<ResourceData*> result;
+    for (ResourceDataMap::iterator it = m_requestIdToResourceDataMap.begin(); it != m_requestIdToResourceDataMap.end(); ++it)
+        result.append(it->value);
+    return result;
+}
+
 Vector<String> NetworkResourcesData::removeResource(Resource* cachedResource)
 {
     Vector<String> result;
diff --git a/Source/core/inspector/NetworkResourcesData.h b/Source/core/inspector/NetworkResourcesData.h
index 3ed6f70..52b1cfa 100644
--- a/Source/core/inspector/NetworkResourcesData.h
+++ b/Source/core/inspector/NetworkResourcesData.h
@@ -85,8 +85,8 @@
         String frameId() const { return m_frameId; }
         void setFrameId(const String& frameId) { m_frameId = frameId; }
 
-        String url() const { return m_url; }
-        void setUrl(const String& url) { m_url = url; }
+        KURL url() const { return m_url; }
+        void setUrl(const KURL& url) { m_url = url; }
 
         bool hasContent() const { return !m_content.isNull(); }
         String content() const { return m_content; }
@@ -128,7 +128,7 @@
         String m_requestId;
         String m_loaderId;
         String m_frameId;
-        String m_url;
+        KURL m_url;
         String m_content;
         RefPtr<XHRReplayData> m_xhrReplayData;
         bool m_base64Encoded;
@@ -165,6 +165,7 @@
     void setXHRReplayData(const String& requestId, XHRReplayData*);
     void reuseXHRReplayData(const String& requestId, const String& reusedRequestId);
     XHRReplayData* xhrReplayData(const String& requestId);
+    Vector<ResourceData*> resources();
 
 private:
     ResourceData* resourceDataForRequestId(const String& requestId);
diff --git a/Source/core/inspector/PageDebuggerAgent.cpp b/Source/core/inspector/PageDebuggerAgent.cpp
index b306986..f7410c9 100644
--- a/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/Source/core/inspector/PageDebuggerAgent.cpp
@@ -109,7 +109,7 @@
 void PageDebuggerAgent::overlaySteppedOver()
 {
     ErrorString error;
-    stepOver(&error);
+    stepOver(&error, 0);
 }
 
 InjectedScript PageDebuggerAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
diff --git a/Source/core/inspector/TimelineRecordFactory.cpp b/Source/core/inspector/TimelineRecordFactory.cpp
index 75badf8..6a31dc6 100644
--- a/Source/core/inspector/TimelineRecordFactory.cpp
+++ b/Source/core/inspector/TimelineRecordFactory.cpp
@@ -32,7 +32,7 @@
 #include "core/inspector/TimelineRecordFactory.h"
 
 #include "bindings/v8/ScriptCallStackFactory.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/platform/JSONValues.h"
 #include "core/platform/graphics/FloatQuad.h"
diff --git a/Source/core/inspector/TimelineTraceEventProcessor.cpp b/Source/core/inspector/TimelineTraceEventProcessor.cpp
index ba28720..5d4984f 100644
--- a/Source/core/inspector/TimelineTraceEventProcessor.cpp
+++ b/Source/core/inspector/TimelineTraceEventProcessor.cpp
@@ -31,9 +31,11 @@
 #include "config.h"
 #include "core/inspector/TimelineTraceEventProcessor.h"
 
+#include "core/fetch/ImageResource.h"
 #include "core/inspector/InspectorClient.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/TimelineRecordFactory.h"
+#include "core/rendering/RenderImage.h"
 
 #include "wtf/CurrentTime.h"
 #include "wtf/MainThread.h"
@@ -66,7 +68,7 @@
         MutexLocker locker(m_mutex);
 
         size_t index = m_processors.find(processor);
-        if (index == notFound) {
+        if (index == kNotFound) {
             ASSERT_NOT_REACHED();
             return;
         }
@@ -172,6 +174,8 @@
     registerHandler(InstrumentationEvents::Paint, TracePhaseInstant, &TimelineTraceEventProcessor::onPaint);
     registerHandler(PlatformInstrumentation::ImageDecodeEvent, TracePhaseBegin, &TimelineTraceEventProcessor::onImageDecodeBegin);
     registerHandler(PlatformInstrumentation::ImageDecodeEvent, TracePhaseEnd, &TimelineTraceEventProcessor::onImageDecodeEnd);
+    registerHandler(PlatformInstrumentation::DrawLazyPixelRefEvent, TracePhaseInstant, &TimelineTraceEventProcessor::onDrawLazyPixelRef);
+    registerHandler(PlatformInstrumentation::LazyPixelRef, TracePhaseDeleteObject, &TimelineTraceEventProcessor::onLazyPixelRefDeleted);
 
     TraceEventDispatcher::instance()->addProcessor(this, m_inspectorClient);
 }
@@ -196,14 +200,14 @@
         if (!strcmp(name, m_argumentNames[i]))
             return i;
     }
-    return notFound;
+    return kNotFound;
 }
 
 const TimelineTraceEventProcessor::TraceValueUnion& TimelineTraceEventProcessor::TraceEvent::parameter(const char* name, TraceValueTypes expectedType) const
 {
     static TraceValueUnion missingValue;
     size_t index = findParameter(name);
-    if (index == notFound || m_argumentTypes[index] != expectedType) {
+    if (index == kNotFound || m_argumentTypes[index] != expectedType) {
         ASSERT_NOT_REACHED();
         return missingValue;
     }
@@ -260,7 +264,6 @@
 void TimelineTraceEventProcessor::onPaintLayerEnd(const TraceEvent& event)
 {
     m_layerId = 0;
-    ASSERT(m_paintSetupStart);
 }
 
 void TimelineTraceEventProcessor::onPaintSetupBegin(const TraceEvent& event)
@@ -297,15 +300,6 @@
     leaveLayerTask(state);
 }
 
-void TimelineTraceEventProcessor::onImageDecodeTaskBegin(const TraceEvent& event)
-{
-    maybeEnterLayerTask(event, threadState(event.threadIdentifier()));
-}
-
-void TimelineTraceEventProcessor::onImageDecodeTaskEnd(const TraceEvent& event)
-{
-    leaveLayerTask(threadState(event.threadIdentifier()));
-}
 
 bool TimelineTraceEventProcessor::maybeEnterLayerTask(const TraceEvent& event, TimelineThreadState& threadState)
 {
@@ -322,18 +316,40 @@
     threadState.inKnownLayerTask = false;
 }
 
+void TimelineTraceEventProcessor::onImageDecodeTaskBegin(const TraceEvent& event)
+{
+    TimelineThreadState& state = threadState(event.threadIdentifier());
+    ASSERT(!state.decodedPixelRefId);
+    unsigned long long pixelRefId = event.asUInt(InstrumentationEventArguments::PixelRefId);
+    ASSERT(pixelRefId);
+    if (m_pixelRefToImageInfo.contains(pixelRefId))
+        state.decodedPixelRefId = pixelRefId;
+}
+
+void TimelineTraceEventProcessor::onImageDecodeTaskEnd(const TraceEvent& event)
+{
+    threadState(event.threadIdentifier()).decodedPixelRefId = 0;
+}
+
 void TimelineTraceEventProcessor::onImageDecodeBegin(const TraceEvent& event)
 {
     TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inKnownLayerTask)
+    if (!state.decodedPixelRefId)
         return;
-    state.recordStack.addScopedRecord(createRecord(event, TimelineRecordType::DecodeImage));
+    PixelRefToImageInfoMap::const_iterator it = m_pixelRefToImageInfo.find(state.decodedPixelRefId);
+    if (it == m_pixelRefToImageInfo.end()) {
+        ASSERT_NOT_REACHED();
+        return;
+    }
+    RefPtr<JSONObject> data = JSONObject::create();
+    TimelineRecordFactory::appendImageDetails(data.get(), it->value.backendNodeId, it->value.url);
+    state.recordStack.addScopedRecord(createRecord(event, TimelineRecordType::DecodeImage, data));
 }
 
 void TimelineTraceEventProcessor::onImageDecodeEnd(const TraceEvent& event)
 {
     TimelineThreadState& state = threadState(event.threadIdentifier());
-    if (!state.inKnownLayerTask)
+    if (!state.decodedPixelRefId)
         return;
     ASSERT(state.recordStack.isOpenRecordOfType(TimelineRecordType::DecodeImage));
     state.recordStack.closeScopedRecord(m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp()));
@@ -368,6 +384,31 @@
     }
 }
 
+void TimelineTraceEventProcessor::onDrawLazyPixelRef(const TraceEvent& event)
+{
+    // Only track LazyPixelRefs created while we paint known layers
+    if (!m_layerId || !m_layerToNodeMap.contains(m_layerId))
+        return;
+    unsigned long long pixelRefId = event.asUInt(PlatformInstrumentation::LazyPixelRef);
+    ASSERT(pixelRefId);
+    InspectorTimelineAgent* timelineAgent = m_timelineAgent.get();
+    if (!timelineAgent)
+        return;
+    const RenderImage* renderImage = timelineAgent->imageBeingPainted();
+    if (!renderImage)
+        return;
+    int nodeId = timelineAgent->idForNode(renderImage->generatingNode());
+    String url;
+    if (const ImageResource* resource = renderImage->cachedImage())
+        url = resource->url().string();
+    m_pixelRefToImageInfo.set(pixelRefId, ImageInfo(nodeId, url));
+}
+
+void TimelineTraceEventProcessor::onLazyPixelRefDeleted(const TraceEvent& event)
+{
+    m_pixelRefToImageInfo.remove(event.id());
+}
+
 PassRefPtr<JSONObject> TimelineTraceEventProcessor::createRecord(const TraceEvent& event, const String& recordType, PassRefPtr<JSONObject> data)
 {
     double startTime = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
diff --git a/Source/core/inspector/TimelineTraceEventProcessor.h b/Source/core/inspector/TimelineTraceEventProcessor.h
index d710b3a..485f0be 100644
--- a/Source/core/inspector/TimelineTraceEventProcessor.h
+++ b/Source/core/inspector/TimelineTraceEventProcessor.h
@@ -125,11 +125,13 @@
         TimelineThreadState(WeakPtr<InspectorTimelineAgent> timelineAgent)
             : recordStack(timelineAgent)
             , inKnownLayerTask(false)
+            , decodedPixelRefId(0)
         {
         }
 
         TimelineRecordStack recordStack;
         bool inKnownLayerTask;
+        unsigned long long decodedPixelRefId;
     };
 
     class TraceEvent {
@@ -175,7 +177,7 @@
         long long asInt(const char* name) const
         {
             size_t index = findParameter(name);
-            if (index == notFound || (m_argumentTypes[index] != TypeInt && m_argumentTypes[index] != TypeUInt)) {
+            if (index == kNotFound || (m_argumentTypes[index] != TypeInt && m_argumentTypes[index] != TypeUInt)) {
                 ASSERT_NOT_REACHED();
                 return 0;
             }
@@ -243,6 +245,8 @@
     void onImageDecodeBegin(const TraceEvent&);
     void onImageDecodeEnd(const TraceEvent&);
     void onLayerDeleted(const TraceEvent&);
+    void onDrawLazyPixelRef(const TraceEvent&);
+    void onLazyPixelRefDeleted(const TraceEvent&);
 
     WeakPtr<InspectorTimelineAgent> m_timelineAgent;
     TimelineTimeConverter m_timeConverter;
@@ -262,6 +266,16 @@
     unsigned long long m_layerId;
     double m_paintSetupStart;
     double m_paintSetupEnd;
+
+    struct ImageInfo {
+        int backendNodeId;
+        String url;
+
+        ImageInfo() { }
+        ImageInfo(int backendNodeId, String url) : backendNodeId(backendNodeId), url(url) { }
+    };
+    typedef HashMap<unsigned long long, ImageInfo> PixelRefToImageInfoMap;
+    PixelRefToImageInfoMap m_pixelRefToImageInfo;
 };
 
 } // namespace WebCore
diff --git a/Source/core/loader/CrossOriginPreflightResultCache.cpp b/Source/core/loader/CrossOriginPreflightResultCache.cpp
index 869076e..c3f82ab 100644
--- a/Source/core/loader/CrossOriginPreflightResultCache.cpp
+++ b/Source/core/loader/CrossOriginPreflightResultCache.cpp
@@ -76,7 +76,7 @@
 {
     unsigned start = 0;
     size_t end;
-    while ((end = string.find(',', start)) != notFound) {
+    while ((end = string.find(',', start)) != kNotFound) {
         if (start != end)
             addToAccessControlAllowList(string, start, end - 1, set);
         start = end + 1;
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index 11f05e2..fac3be3 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -35,7 +35,7 @@
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/Document.h"
 #include "core/dom/DocumentParser.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/fetch/FetchContext.h"
 #include "core/fetch/MemoryCache.h"
 #include "core/fetch/ResourceFetcher.h"
diff --git a/Source/core/loader/DocumentThreadableLoader.cpp b/Source/core/loader/DocumentThreadableLoader.cpp
index 77af89e..c12ac96 100644
--- a/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/Source/core/loader/DocumentThreadableLoader.cpp
@@ -45,6 +45,7 @@
 #include "core/loader/ThreadableLoaderClient.h"
 #include "core/page/ContentSecurityPolicy.h"
 #include "core/page/Frame.h"
+#include "core/platform/SharedBuffer.h"
 #include "core/platform/network/ResourceError.h"
 #include "core/platform/network/ResourceRequest.h"
 #include "weborigin/SchemeRegistry.h"
@@ -440,21 +441,19 @@
         return;
     }
 
-    // FIXME: ThreadableLoaderOptions.sniffContent is not supported for synchronous requests.
-    Vector<char> data;
-    ResourceError error;
-    ResourceResponse response;
-    unsigned long identifier = std::numeric_limits<unsigned long>::max();
-    if (Frame* frame = m_document->frame()) {
-        if (!m_document->fetcher()->checkInsecureContent(Resource::Raw, requestURL, options.mixedContentBlockingTreatment)) {
-            m_client->didFail(error);
-            return;
-        }
-        identifier = m_document->fetcher()->fetchSynchronously(request, m_options.allowCredentials, error, response, data);
-    }
+    FetchRequest fetchRequest(request, m_options.initiator, options);
+    ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(fetchRequest);
+    ResourceResponse response = resource ? resource->response() : ResourceResponse();
+    unsigned long identifier = resource ? resource->identifier() : std::numeric_limits<unsigned long>::max();
+    ResourceError error = resource ? resource->resourceError() : ResourceError();
 
     InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client);
 
+    if (!resource) {
+        m_client->didFail(error);
+        return;
+    }
+
     // No exception for file:/// resources, see <rdar://problem/4962298>.
     // Also, if we have an HTTP response, then it wasn't a network error in fact.
     if (!error.isNull() && !requestURL.isLocalFile() && response.httpStatusCode() <= 0) {
@@ -462,7 +461,7 @@
         return;
     }
 
-    // FIXME: FrameLoader::loadSynchronously() does not tell us whether a redirect happened or not, so we guess by comparing the
+    // FIXME: A synchronous request does not tell us whether a redirect happened or not, so we guess by comparing the
     // request and response URLs. This isn't a perfect test though, since a server can serve a redirect to the same URL that was
     // requested. Also comparing the request and response URLs as strings will fail if the requestURL still has its credentials.
     if (requestURL != response.url() && (!isAllowedByPolicy(response.url()) || !isAllowedRedirect(response.url()))) {
@@ -472,9 +471,9 @@
 
     didReceiveResponse(identifier, response);
 
-    const char* bytes = static_cast<const char*>(data.data());
-    int len = static_cast<int>(data.size());
-    didReceiveData(identifier, bytes, len);
+    SharedBuffer* data = resource->resourceBuffer();
+    if (data)
+        didReceiveData(identifier, data->data(), data->size());
 
     didFinishLoading(identifier, 0.0);
 }
diff --git a/Source/core/loader/EmptyClients.h b/Source/core/loader/EmptyClients.h
index 5e9e860..ed1cb5a 100644
--- a/Source/core/loader/EmptyClients.h
+++ b/Source/core/loader/EmptyClients.h
@@ -248,7 +248,7 @@
     virtual WebKit::WebCookieJar* cookieJar() const { return 0; }
 
     virtual void didRequestAutocomplete(PassRefPtr<FormState>) OVERRIDE;
-    virtual WebKit::WebNavigationControllerRegistry* navigationControllerRegistry() OVERRIDE { return 0; }
+    virtual WebKit::WebServiceWorkerRegistry* serviceWorkerRegistry() OVERRIDE { return 0; }
 };
 
 class EmptyTextCheckerClient : public TextCheckerClient {
diff --git a/Source/core/loader/FormSubmission.cpp b/Source/core/loader/FormSubmission.cpp
index 9b2b866..3ecd221 100644
--- a/Source/core/loader/FormSubmission.cpp
+++ b/Source/core/loader/FormSubmission.cpp
@@ -33,7 +33,7 @@
 
 #include "HTMLNames.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/DOMFormData.h"
 #include "core/html/HTMLFormControlElement.h"
 #include "core/html/HTMLFormElement.h"
diff --git a/Source/core/loader/FrameLoadRequest.h b/Source/core/loader/FrameLoadRequest.h
index 7d3e4da..4aab1e9 100644
--- a/Source/core/loader/FrameLoadRequest.h
+++ b/Source/core/loader/FrameLoadRequest.h
@@ -26,7 +26,7 @@
 #ifndef FrameLoadRequest_h
 #define FrameLoadRequest_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/loader/FrameLoaderTypes.h"
 #include "core/loader/SubstituteData.h"
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 2f6869d..c48629d 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -41,9 +41,9 @@
 #include "bindings/v8/SerializedScriptValue.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/PageTransitionEvent.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
+#include "core/events/PageTransitionEvent.h"
 #include "core/editing/Editor.h"
 #include "core/fetch/FetchContext.h"
 #include "core/fetch/ResourceFetcher.h"
@@ -350,8 +350,8 @@
         String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language");
         if (!headerContentLanguage.isEmpty()) {
             size_t commaIndex = headerContentLanguage.find(',');
-            headerContentLanguage.truncate(commaIndex); // notFound == -1 == don't truncate
-            headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace);
+            headerContentLanguage.truncate(commaIndex); // kNotFound == -1 == don't truncate
+            headerContentLanguage = headerContentLanguage.stripWhiteSpace(isHTMLSpace<UChar>);
             if (!headerContentLanguage.isEmpty())
                 m_frame->document()->setContentLanguage(headerContentLanguage);
         }
@@ -834,6 +834,8 @@
     m_checkTimer.stop();
 
     m_inStopAllLoaders = false;
+
+    m_client->didStopAllLoaders();
 }
 
 DocumentLoader* FrameLoader::activeDocumentLoader() const
diff --git a/Source/core/loader/FrameLoaderClient.h b/Source/core/loader/FrameLoaderClient.h
index 1031918..42aee86 100644
--- a/Source/core/loader/FrameLoaderClient.h
+++ b/Source/core/loader/FrameLoaderClient.h
@@ -47,7 +47,7 @@
 
 namespace WebKit {
 class WebCookieJar;
-class WebNavigationControllerRegistry;
+class WebServiceWorkerRegistry;
 }
 
 namespace WebCore {
@@ -216,7 +216,9 @@
 
         virtual void dispatchDidChangeResourcePriority(unsigned long /*identifier*/, ResourceLoadPriority) { }
 
-        virtual WebKit::WebNavigationControllerRegistry* navigationControllerRegistry() = 0;
+        virtual WebKit::WebServiceWorkerRegistry* serviceWorkerRegistry() = 0;
+
+        virtual void didStopAllLoaders() { }
     };
 
 } // namespace WebCore
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp
index 0648212..bf7b3a0 100644
--- a/Source/core/loader/ImageLoader.cpp
+++ b/Source/core/loader/ImageLoader.cpp
@@ -25,8 +25,8 @@
 #include "HTMLNames.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventSender.h"
+#include "core/events/Event.h"
+#include "core/events/EventSender.h"
 #include "core/fetch/CrossOriginAccessControl.h"
 #include "core/fetch/FetchRequest.h"
 #include "core/fetch/ImageResource.h"
diff --git a/Source/core/loader/NavigationAction.cpp b/Source/core/loader/NavigationAction.cpp
index ffabc57..7e89752 100644
--- a/Source/core/loader/NavigationAction.cpp
+++ b/Source/core/loader/NavigationAction.cpp
@@ -29,7 +29,7 @@
 #include "config.h"
 #include "core/loader/NavigationAction.h"
 
-#include "core/dom/MouseEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/loader/FrameLoader.h"
 
 namespace WebCore {
diff --git a/Source/core/loader/NavigationAction.h b/Source/core/loader/NavigationAction.h
index 5ba25f3..11a2dca 100644
--- a/Source/core/loader/NavigationAction.h
+++ b/Source/core/loader/NavigationAction.h
@@ -29,7 +29,7 @@
 #ifndef NavigationAction_h
 #define NavigationAction_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/loader/FrameLoaderTypes.h"
 #include "core/loader/NavigationPolicy.h"
 #include "core/platform/network/ResourceRequest.h"
diff --git a/Source/core/loader/NavigationScheduler.cpp b/Source/core/loader/NavigationScheduler.cpp
index 6b04c72..74bf43d 100644
--- a/Source/core/loader/NavigationScheduler.cpp
+++ b/Source/core/loader/NavigationScheduler.cpp
@@ -33,7 +33,7 @@
 #include "core/loader/NavigationScheduler.h"
 
 #include "bindings/v8/ScriptController.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/UserGestureIndicator.h"
 #include "core/history/BackForwardController.h"
 #include "core/html/HTMLFormElement.h"
diff --git a/Source/core/loader/ThreadableLoaderClient.h b/Source/core/loader/ThreadableLoaderClient.h
index 59123b9..152aa68 100644
--- a/Source/core/loader/ThreadableLoaderClient.h
+++ b/Source/core/loader/ThreadableLoaderClient.h
@@ -31,6 +31,8 @@
 #ifndef ThreadableLoaderClient_h
 #define ThreadableLoaderClient_h
 
+#include "wtf/FastAllocBase.h"
+#include "wtf/Noncopyable.h"
 
 namespace WebCore {
 
diff --git a/Source/core/loader/appcache/ApplicationCache.cpp b/Source/core/loader/appcache/ApplicationCache.cpp
index 786c8fd..b3dd1a6 100644
--- a/Source/core/loader/appcache/ApplicationCache.cpp
+++ b/Source/core/loader/appcache/ApplicationCache.cpp
@@ -29,8 +29,8 @@
 #include "bindings/v8/ExceptionMessages.h"
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
diff --git a/Source/core/loader/appcache/ApplicationCache.h b/Source/core/loader/appcache/ApplicationCache.h
index 680f9c4..39c4ac5 100644
--- a/Source/core/loader/appcache/ApplicationCache.h
+++ b/Source/core/loader/appcache/ApplicationCache.h
@@ -27,8 +27,8 @@
 #define ApplicationCache_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "core/loader/appcache/ApplicationCacheHost.h"
 #include "core/page/DOMWindowProperty.h"
 #include "wtf/Forward.h"
diff --git a/Source/core/loader/appcache/ApplicationCacheHost.h b/Source/core/loader/appcache/ApplicationCacheHost.h
index 48d7b23..8530fc1 100644
--- a/Source/core/loader/appcache/ApplicationCacheHost.h
+++ b/Source/core/loader/appcache/ApplicationCacheHost.h
@@ -118,7 +118,6 @@
         void failedLoadingMainResource();
 
         void willStartLoadingResource(ResourceRequest&);
-        void willStartLoadingSynchronously(ResourceRequest&);
 
         Status status() const;
         bool update();
diff --git a/Source/core/loader/archive/MHTMLParser.cpp b/Source/core/loader/archive/MHTMLParser.cpp
index 1134592..6bab361 100644
--- a/Source/core/loader/archive/MHTMLParser.cpp
+++ b/Source/core/loader/archive/MHTMLParser.cpp
@@ -139,10 +139,15 @@
 {
     ASSERT(endOfPartBoundary.isEmpty() == endOfDocumentBoundary.isEmpty());
 
+    // If no content transfer encoding is specified, default to binary encoding.
+    MIMEHeader::Encoding contentTransferEncoding = mimeHeader.contentTransferEncoding();
+    if (contentTransferEncoding == MIMEHeader::Unknown)
+        contentTransferEncoding = MIMEHeader::Binary;
+
     RefPtr<SharedBuffer> content = SharedBuffer::create();
     const bool checkBoundary = !endOfPartBoundary.isEmpty();
     bool endOfPartReached = false;
-    if (mimeHeader.contentTransferEncoding() == MIMEHeader::Binary) {
+    if (contentTransferEncoding == MIMEHeader::Binary) {
         if (!checkBoundary) {
             LOG_ERROR("Binary contents requires end of part");
             return 0;
@@ -180,7 +185,7 @@
             }
             // Note that we use line.utf8() and not line.ascii() as ascii turns special characters (such as tab, line-feed...) into '?'.
             content->append(line.utf8().data(), line.length());
-            if (mimeHeader.contentTransferEncoding() == MIMEHeader::QuotedPrintable) {
+            if (contentTransferEncoding == MIMEHeader::QuotedPrintable) {
                 // The line reader removes the \r\n, but we need them for the content in this case as the QuotedPrintable decoder expects CR-LF terminated lines.
                 content->append("\r\n", 2);
             }
@@ -192,7 +197,7 @@
     }
 
     Vector<char> data;
-    switch (mimeHeader.contentTransferEncoding()) {
+    switch (contentTransferEncoding) {
     case MIMEHeader::Base64:
         if (!base64Decode(content->data(), content->size(), data)) {
             LOG_ERROR("Invalid base64 content for MHTML part.");
diff --git a/Source/core/make_derived_sources.target.darwin-arm.mk b/Source/core/make_derived_sources.target.darwin-arm.mk
index d1a02c2..114713f 100644
--- a/Source/core/make_derived_sources.target.darwin-arm.mk
+++ b/Source/core/make_derived_sources.target.darwin-arm.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -442,7 +442,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -524,7 +523,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/make_derived_sources.target.darwin-mips.mk b/Source/core/make_derived_sources.target.darwin-mips.mk
index e0e4ff8..595d076 100644
--- a/Source/core/make_derived_sources.target.darwin-mips.mk
+++ b/Source/core/make_derived_sources.target.darwin-mips.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -442,7 +442,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -524,7 +523,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/make_derived_sources.target.darwin-x86.mk b/Source/core/make_derived_sources.target.darwin-x86.mk
index e382447..600c361 100644
--- a/Source/core/make_derived_sources.target.darwin-x86.mk
+++ b/Source/core/make_derived_sources.target.darwin-x86.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -444,7 +444,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -529,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/make_derived_sources.target.linux-arm.mk b/Source/core/make_derived_sources.target.linux-arm.mk
index d1a02c2..114713f 100644
--- a/Source/core/make_derived_sources.target.linux-arm.mk
+++ b/Source/core/make_derived_sources.target.linux-arm.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -442,7 +442,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -524,7 +523,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/make_derived_sources.target.linux-mips.mk b/Source/core/make_derived_sources.target.linux-mips.mk
index e0e4ff8..595d076 100644
--- a/Source/core/make_derived_sources.target.linux-mips.mk
+++ b/Source/core/make_derived_sources.target.linux-mips.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -442,7 +442,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -524,7 +523,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/make_derived_sources.target.linux-x86.mk b/Source/core/make_derived_sources.target.linux-x86.mk
index e382447..600c361 100644
--- a/Source/core/make_derived_sources.target.linux-x86.mk
+++ b/Source/core/make_derived_sources.target.linux-x86.mk
@@ -72,7 +72,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_property_names.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSPropertyNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSPropertyNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSPropertyNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_css_property_names.py css/CSSPropertyNames.in css/SVGCSSPropertyNames.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.h: $(gyp_shared_intermediate_dir)/blink/CSSPropertyNames.cpp ;
 
@@ -106,7 +106,7 @@
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_css_value_keywords.py $(LOCAL_PATH)/third_party/WebKit/Source/core/css/CSSValueKeywords.in $(LOCAL_PATH)/third_party/WebKit/Source/core/css/SVGCSSValueKeywords.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_CSSValueKeywords ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; scripts/make_css_value_keywords.py css/CSSValueKeywords.in css/SVGCSSValueKeywords.in --output_dir "$(gyp_shared_intermediate_dir)/blink" --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.h: $(gyp_shared_intermediate_dir)/blink/CSSValueKeywords.cpp ;
 
@@ -117,7 +117,7 @@
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/HTMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_HTMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/HTMLNames.h" "$(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8HTMLElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/HTMLNames.h: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/HTMLElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/HTMLNames.cpp ;
@@ -140,9 +140,9 @@
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/svgattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/SVGAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_SVGNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/svgtags.in svg/svgattrs.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/SVGNames.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGNames.h" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/SVGElementFactory.h" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.cpp" "$(gyp_shared_intermediate_dir)/blink/V8SVGElementWrapperFactory.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/SVGTagNames.in svg/SVGAttributeNames.in -- --factory --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/SVGNames.h: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
 $(gyp_shared_intermediate_dir)/blink/SVGElementFactory.cpp: $(gyp_shared_intermediate_dir)/blink/SVGNames.cpp ;
@@ -155,9 +155,9 @@
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/Event.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/Event.cpp: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(gyp_shared_intermediate_dir)/blink/EventInterfaces.in $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventAliases.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" dom/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py "$(gyp_shared_intermediate_dir)/blink/EventInterfaces.in" events/EventAliases.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventHeaders.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
 $(gyp_shared_intermediate_dir)/blink/EventInterfaces.h: $(gyp_shared_intermediate_dir)/blink/Event.cpp ;
@@ -167,9 +167,9 @@
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/dom/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h: $(LOCAL_PATH)/third_party/jinja2/__init__.py $(LOCAL_PATH)/third_party/markupsafe/__init__.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_file.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/in_generator.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/license.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_macros.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/template_expander.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/templates/macros.tmpl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_event_factory.py $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/name_utilities.py $(LOCAL_PATH)/third_party/WebKit/Source/core/events/EventTargetFactory.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_EventTargetFactory ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py dom/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/make_event_factory.py events/EventTargetFactory.in --output_dir "$(gyp_shared_intermediate_dir)/blink"
 
 $(gyp_shared_intermediate_dir)/blink/EventTargetInterfaces.h: $(gyp_shared_intermediate_dir)/blink/EventTargetHeaders.h ;
 
@@ -178,9 +178,9 @@
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_intermediate_dir := $(abspath $(gyp_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: gyp_shared_intermediate_dir := $(abspath $(gyp_shared_intermediate_dir))
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
-$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathtags.in $(LOCAL_PATH)/third_party/WebKit/Source/core/mathml/mathattrs.in $(GYP_TARGET_DEPENDENCIES)
+$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLTagNames.in $(LOCAL_PATH)/third_party/WebKit/Source/core/html/parser/MathMLAttributeNames.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_MathMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl mathml/mathtags.in mathml/mathattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/MathMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl html/parser/MathMLTagNames.in html/parser/MathMLAttributeNames.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/MathMLNames.h: $(gyp_shared_intermediate_dir)/blink/MathMLNames.cpp ;
 
@@ -191,7 +191,7 @@
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h: $(LOCAL_PATH)/third_party/WebKit/Source/core/css/make-css-file-arrays.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/preprocessor.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/css/html.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/quirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/view-source.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromium.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumLinux.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeChromiumSkia.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWin.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/themeWinQuirks.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/svg.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControls.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/mediaControlsAndroid.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/fullscreen.css $(LOCAL_PATH)/third_party/WebKit/Source/core/css/xhtmlmp.css $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_UserAgentStyleSheets ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_useragentstylesheets.py "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h" "$(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp" css/html.css css/quirks.css css/view-source.css css/themeChromium.css css/themeChromiumAndroid.css css/themeChromiumLinux.css css/themeChromiumSkia.css css/themeWin.css css/themeWinQuirks.css css/svg.css css/mediaControls.css css/mediaControlsAndroid.css css/fullscreen.css css/xhtmlmp.css -- css/make-css-file-arrays.pl scripts/preprocessor.pm -- --defines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheetsData.cpp: $(gyp_shared_intermediate_dir)/blink/UserAgentStyleSheets.h ;
 
@@ -246,7 +246,7 @@
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/svg/xlinkattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XLinkNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XLinkNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl svg/xlinkattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XLinkNames.h: $(gyp_shared_intermediate_dir)/blink/XLinkNames.cpp ;
 
@@ -257,7 +257,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlnsattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNSNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNSNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlnsattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNSNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNSNames.cpp ;
 
@@ -268,7 +268,7 @@
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: export PATH := $(subst $(ANDROID_BUILD_PATHS),,$(PATH))
 $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp: $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/Hasher.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/StaticString.pm $(LOCAL_PATH)/third_party/WebKit/Source/core/scripts/make_names.pl $(LOCAL_PATH)/third_party/WebKit/Source/core/xml/xmlattrs.in $(GYP_TARGET_DEPENDENCIES)
 	@echo "Gyp action: third_party_WebKit_Source_core_core_derived_sources_gyp_make_derived_sources_target_XMLNames ($@)"
-	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"WTF_USE_NATIVE_FULLSCREEN_VIDEO=1\" \"ENABLE_OPENTYPE_VERTICAL=1\""
+	$(hide)cd $(gyp_local_path)/third_party/WebKit/Source/core; mkdir -p $(gyp_shared_intermediate_dir)/blink; python scripts/action_makenames.py "$(gyp_shared_intermediate_dir)/blink/XMLNames.cpp" "$(gyp_shared_intermediate_dir)/blink/XMLNames.h" -- scripts/Hasher.pm scripts/StaticString.pm scripts/make_names.pl xml/xmlattrs.in -- --extraDefines "\"ENABLE_CSS3_TEXT=0\" \"ENABLE_CSS_EXCLUSIONS=1\" \"ENABLE_CSS_REGIONS=1\" \"ENABLE_CUSTOM_SCHEME_HANDLER=0\" \"ENABLE_ENCRYPTED_MEDIA_V2=1\" \"ENABLE_SVG_FONTS=1\" \"ENABLE_TOUCH_ICON_LOADING=1\" \"ENABLE_GDI_FONTS_ON_WINDOWS=1\" \"WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1\" \"ENABLE_CALENDAR_PICKER=0\" \"ENABLE_FAST_MOBILE_SCROLLING=1\" \"ENABLE_INPUT_SPEECH=0\" \"ENABLE_LEGACY_NOTIFICATIONS=0\" \"ENABLE_MEDIA_CAPTURE=1\" \"ENABLE_ORIENTATION_EVENTS=1\" \"ENABLE_NAVIGATOR_CONTENT_UTILS=0\" \"ENABLE_OPENTYPE_VERTICAL=1\""
 
 $(gyp_shared_intermediate_dir)/blink/XMLNames.h: $(gyp_shared_intermediate_dir)/blink/XMLNames.cpp ;
 
@@ -444,7 +444,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -529,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
diff --git a/Source/core/page/Chrome.cpp b/Source/core/page/Chrome.cpp
index 71a576f..57c5838 100644
--- a/Source/core/page/Chrome.cpp
+++ b/Source/core/page/Chrome.cpp
@@ -408,7 +408,7 @@
 void Chrome::unregisterPopupOpeningObserver(PopupOpeningObserver* observer)
 {
     size_t index = m_popupOpeningObservers.find(observer);
-    ASSERT(index != notFound);
+    ASSERT(index != kNotFound);
     m_popupOpeningObservers.remove(index);
 }
 
diff --git a/Source/core/page/ContentSecurityPolicy.cpp b/Source/core/page/ContentSecurityPolicy.cpp
index 7f5d434..d6489e8 100644
--- a/Source/core/page/ContentSecurityPolicy.cpp
+++ b/Source/core/page/ContentSecurityPolicy.cpp
@@ -32,7 +32,7 @@
 #include "bindings/v8/ScriptState.h"
 #include "core/dom/DOMStringList.h"
 #include "core/dom/Document.h"
-#include "core/dom/SecurityPolicyViolationEvent.h"
+#include "core/events/SecurityPolicyViolationEvent.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/loader/DocumentLoader.h"
@@ -41,6 +41,7 @@
 #include "core/page/Frame.h"
 #include "core/page/UseCounter.h"
 #include "core/platform/JSONValues.h"
+#include "core/platform/ParsingUtilities.h"
 #include "core/platform/network/FormData.h"
 #include "core/platform/network/ResourceResponse.h"
 #include "weborigin/KURL.h"
@@ -165,48 +166,16 @@
 
 } // namespace
 
-static bool skipExactly(const UChar*& position, const UChar* end, UChar delimiter)
-{
-    if (position < end && *position == delimiter) {
-        ++position;
-        return true;
-    }
-    return false;
-}
-
-template<bool characterPredicate(UChar)>
-static bool skipExactly(const UChar*& position, const UChar* end)
-{
-    if (position < end && characterPredicate(*position)) {
-        ++position;
-        return true;
-    }
-    return false;
-}
-
-static void skipUntil(const UChar*& position, const UChar* end, UChar delimiter)
-{
-    while (position < end && *position != delimiter)
-        ++position;
-}
-
-template<bool characterPredicate(UChar)>
-static void skipWhile(const UChar*& position, const UChar* end)
-{
-    while (position < end && characterPredicate(*position))
-        ++position;
-}
-
 static bool isSourceListNone(const UChar* begin, const UChar* end)
 {
-    skipWhile<isASCIISpace>(begin, end);
+    skipWhile<UChar, isASCIISpace>(begin, end);
 
     const UChar* position = begin;
-    skipWhile<isSourceCharacter>(position, end);
+    skipWhile<UChar, isSourceCharacter>(position, end);
     if (!equalIgnoringCase("'none'", begin, position - begin))
         return false;
 
-    skipWhile<isASCIISpace>(position, end);
+    skipWhile<UChar, isASCIISpace>(position, end);
     if (position != end)
         return false;
 
@@ -369,12 +338,12 @@
 
     const UChar* position = begin;
     while (position < end) {
-        skipWhile<isASCIISpace>(position, end);
+        skipWhile<UChar, isASCIISpace>(position, end);
         if (position == end)
             return;
 
         const UChar* beginSource = position;
-        skipWhile<isSourceCharacter>(position, end);
+        skipWhile<UChar, isSourceCharacter>(position, end);
 
         String scheme, host, path;
         int port = 0;
@@ -447,7 +416,7 @@
     const UChar* beginPath = end;
     const UChar* beginPort = 0;
 
-    skipWhile<isNotColonOrSlash>(position, end);
+    skipWhile<UChar, isNotColonOrSlash>(position, end);
 
     if (position == end) {
         // host
@@ -472,21 +441,21 @@
             // scheme://host || scheme://
             //       ^                ^
             if (!parseScheme(begin, position, scheme)
-                || !skipExactly(position, end, ':')
-                || !skipExactly(position, end, '/')
-                || !skipExactly(position, end, '/'))
+                || !skipExactly<UChar>(position, end, ':')
+                || !skipExactly<UChar>(position, end, '/')
+                || !skipExactly<UChar>(position, end, '/'))
                 return false;
             if (position == end)
                 return true;
             beginHost = position;
-            skipWhile<isNotColonOrSlash>(position, end);
+            skipWhile<UChar, isNotColonOrSlash>(position, end);
         }
 
         if (position < end && *position == ':') {
             // host:port || scheme://host:port
             //     ^                     ^
             beginPort = position;
-            skipUntil(position, end, '/');
+            skipUntil<UChar>(position, end, '/');
         }
     }
 
@@ -529,7 +498,7 @@
     const UChar* position = begin + noncePrefix.length();
     const UChar* nonceBegin = position;
 
-    skipWhile<isNonceCharacter>(position, end);
+    skipWhile<UChar, isNonceCharacter>(position, end);
     ASSERT(nonceBegin <= position);
 
     if (((position + 1) != end  && *position != '\'') || !(position - nonceBegin))
@@ -552,10 +521,10 @@
 
     const UChar* position = begin;
 
-    if (!skipExactly<isASCIIAlpha>(position, end))
+    if (!skipExactly<UChar, isASCIIAlpha>(position, end))
         return false;
 
-    skipWhile<isSchemeContinuationCharacter>(position, end);
+    skipWhile<UChar, isSchemeContinuationCharacter>(position, end);
 
     if (position != end)
         return false;
@@ -579,25 +548,25 @@
 
     const UChar* position = begin;
 
-    if (skipExactly(position, end, '*')) {
+    if (skipExactly<UChar>(position, end, '*')) {
         hostHasWildcard = true;
 
         if (position == end)
             return true;
 
-        if (!skipExactly(position, end, '.'))
+        if (!skipExactly<UChar>(position, end, '.'))
             return false;
     }
 
     const UChar* hostBegin = position;
 
     while (position < end) {
-        if (!skipExactly<isHostCharacter>(position, end))
+        if (!skipExactly<UChar, isHostCharacter>(position, end))
             return false;
 
-        skipWhile<isHostCharacter>(position, end);
+        skipWhile<UChar, isHostCharacter>(position, end);
 
-        if (position < end && !skipExactly(position, end, '.'))
+        if (position < end && !skipExactly<UChar>(position, end, '.'))
             return false;
     }
 
@@ -612,7 +581,7 @@
     ASSERT(path.isEmpty());
 
     const UChar* position = begin;
-    skipWhile<isPathComponentCharacter>(position, end);
+    skipWhile<UChar, isPathComponentCharacter>(position, end);
     // path/to/file.js?query=string || path/to/file.js#anchor
     //                ^                               ^
     if (position < end)
@@ -633,7 +602,7 @@
     ASSERT(!port);
     ASSERT(!portHasWildcard);
 
-    if (!skipExactly(begin, end, ':'))
+    if (!skipExactly<UChar>(begin, end, ':'))
         ASSERT_NOT_REACHED();
 
     if (begin == end)
@@ -646,7 +615,7 @@
     }
 
     const UChar* position = begin;
-    skipWhile<isASCIIDigit>(position, end);
+    skipWhile<UChar, isASCIIDigit>(position, end);
 
     if (position != end)
         return false;
@@ -730,41 +699,41 @@
         while (position < end) {
             // _____ OR _____mime1/mime1
             // ^        ^
-            skipWhile<isASCIISpace>(position, end);
+            skipWhile<UChar, isASCIISpace>(position, end);
             if (position == end)
                 return;
 
             // mime1/mime1 mime2/mime2
             // ^
             begin = position;
-            if (!skipExactly<isMediaTypeCharacter>(position, end)) {
-                skipWhile<isNotASCIISpace>(position, end);
+            if (!skipExactly<UChar, isMediaTypeCharacter>(position, end)) {
+                skipWhile<UChar, isNotASCIISpace>(position, end);
                 policy()->reportInvalidPluginTypes(String(begin, position - begin));
                 continue;
             }
-            skipWhile<isMediaTypeCharacter>(position, end);
+            skipWhile<UChar, isMediaTypeCharacter>(position, end);
 
             // mime1/mime1 mime2/mime2
             //      ^
-            if (!skipExactly(position, end, '/')) {
-                skipWhile<isNotASCIISpace>(position, end);
+            if (!skipExactly<UChar>(position, end, '/')) {
+                skipWhile<UChar, isNotASCIISpace>(position, end);
                 policy()->reportInvalidPluginTypes(String(begin, position - begin));
                 continue;
             }
 
             // mime1/mime1 mime2/mime2
             //       ^
-            if (!skipExactly<isMediaTypeCharacter>(position, end)) {
-                skipWhile<isNotASCIISpace>(position, end);
+            if (!skipExactly<UChar, isMediaTypeCharacter>(position, end)) {
+                skipWhile<UChar, isNotASCIISpace>(position, end);
                 policy()->reportInvalidPluginTypes(String(begin, position - begin));
                 continue;
             }
-            skipWhile<isMediaTypeCharacter>(position, end);
+            skipWhile<UChar, isMediaTypeCharacter>(position, end);
 
             // mime1/mime1 mime2/mime2 OR mime1/mime1  OR mime1/mime1/error
             //            ^                          ^               ^
             if (position < end && isNotASCIISpace(*position)) {
-                skipWhile<isNotASCIISpace>(position, end);
+                skipWhile<UChar, isNotASCIISpace>(position, end);
                 policy()->reportInvalidPluginTypes(String(begin, position - begin));
                 continue;
             }
@@ -1213,7 +1182,7 @@
     const UChar* position = begin;
     while (position < end) {
         const UChar* directiveBegin = position;
-        skipUntil(position, end, ';');
+        skipUntil<UChar>(position, end, ';');
 
         String name, value;
         if (parseDirective(directiveBegin, position, name, value)) {
@@ -1222,7 +1191,7 @@
         }
 
         ASSERT(position == end || *position == ';');
-        skipExactly(position, end, ';');
+        skipExactly<UChar>(position, end, ';');
     }
 }
 
@@ -1236,18 +1205,18 @@
     ASSERT(value.isEmpty());
 
     const UChar* position = begin;
-    skipWhile<isASCIISpace>(position, end);
+    skipWhile<UChar, isASCIISpace>(position, end);
 
     // Empty directive (e.g. ";;;"). Exit early.
     if (position == end)
         return false;
 
     const UChar* nameBegin = position;
-    skipWhile<isDirectiveNameCharacter>(position, end);
+    skipWhile<UChar, isDirectiveNameCharacter>(position, end);
 
     // The directive-name must be non-empty.
     if (nameBegin == position) {
-        skipWhile<isNotASCIISpace>(position, end);
+        skipWhile<UChar, isNotASCIISpace>(position, end);
         m_policy->reportUnsupportedDirective(String(nameBegin, position - nameBegin));
         return false;
     }
@@ -1257,16 +1226,16 @@
     if (position == end)
         return true;
 
-    if (!skipExactly<isASCIISpace>(position, end)) {
-        skipWhile<isNotASCIISpace>(position, end);
+    if (!skipExactly<UChar, isASCIISpace>(position, end)) {
+        skipWhile<UChar, isNotASCIISpace>(position, end);
         m_policy->reportUnsupportedDirective(String(nameBegin, position - nameBegin));
         return false;
     }
 
-    skipWhile<isASCIISpace>(position, end);
+    skipWhile<UChar, isASCIISpace>(position, end);
 
     const UChar* valueBegin = position;
-    skipWhile<isDirectiveValueCharacter>(position, end);
+    skipWhile<UChar, isDirectiveValueCharacter>(position, end);
 
     if (position != end) {
         m_policy->reportInvalidDirectiveValueCharacter(name, String(valueBegin, end - valueBegin));
@@ -1295,10 +1264,10 @@
     const UChar* end = position + characters.size();
 
     while (position < end) {
-        skipWhile<isASCIISpace>(position, end);
+        skipWhile<UChar, isASCIISpace>(position, end);
 
         const UChar* urlBegin = position;
-        skipWhile<isNotASCIISpace>(position, end);
+        skipWhile<UChar, isNotASCIISpace>(position, end);
 
         if (urlBegin < position) {
             String url = String(urlBegin, position - urlBegin);
@@ -1351,9 +1320,9 @@
     const UChar* position = characters.data();
     const UChar* end = position + characters.size();
 
-    skipWhile<isASCIISpace>(position, end);
+    skipWhile<UChar, isASCIISpace>(position, end);
     const UChar* begin = position;
-    skipWhile<isNotASCIISpace>(position, end);
+    skipWhile<UChar, isNotASCIISpace>(position, end);
 
     // value1
     //       ^
@@ -1369,7 +1338,7 @@
         return;
     }
 
-    skipWhile<isASCIISpace>(position, end);
+    skipWhile<UChar, isASCIISpace>(position, end);
     if (position == end && m_reflectedXSSDisposition != ContentSecurityPolicy::ReflectedXSSUnset)
         return;
 
@@ -1476,7 +1445,7 @@
     // separated chunk as a separate header.
     const UChar* position = begin;
     while (position < end) {
-        skipUntil(position, end, ',');
+        skipUntil<UChar>(position, end, ',');
 
         // header1,header2 OR header1
         //        ^                  ^
@@ -1490,7 +1459,7 @@
 
         // Skip the comma, and begin the next header from the current position.
         ASSERT(position == end || *position == ',');
-        skipExactly(position, end, ',');
+        skipExactly<UChar>(position, end, ',');
         begin = position;
     }
 }
diff --git a/Source/core/page/ContextMenuController.cpp b/Source/core/page/ContextMenuController.cpp
index 226e210..c7ac96e 100644
--- a/Source/core/page/ContextMenuController.cpp
+++ b/Source/core/page/ContextMenuController.cpp
@@ -28,8 +28,8 @@
 #include "core/page/ContextMenuController.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/Event.h"
+#include "core/events/MouseEvent.h"
 #include "core/dom/Node.h"
 #include "core/page/ContextMenuClient.h"
 #include "core/page/ContextMenuProvider.h"
diff --git a/Source/core/page/CreateWindow.cpp b/Source/core/page/CreateWindow.cpp
index 7549750..d2b4fbe 100644
--- a/Source/core/page/CreateWindow.cpp
+++ b/Source/core/page/CreateWindow.cpp
@@ -66,7 +66,7 @@
 
     if (openerFrame->settings() && !openerFrame->settings()->supportsMultipleWindows()) {
         created = false;
-        return openerFrame;
+        return openerFrame->tree()->top();
     }
 
     Page* oldPage = openerFrame->page();
diff --git a/Source/core/page/DOMWindow.cpp b/Source/core/page/DOMWindow.cpp
index d77702d..ed404f2 100644
--- a/Source/core/page/DOMWindow.cpp
+++ b/Source/core/page/DOMWindow.cpp
@@ -47,11 +47,11 @@
 #include "core/dom/DeviceOrientationController.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/MessageEvent.h"
-#include "core/dom/PageTransitionEvent.h"
+#include "core/events/MessageEvent.h"
+#include "core/events/PageTransitionEvent.h"
 #include "core/dom/RequestAnimationFrameCallback.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/dom/TouchController.h"
@@ -120,7 +120,7 @@
     PassRefPtr<MessageEvent> event(ScriptExecutionContext* context)
     {
         OwnPtr<MessagePortArray> messagePorts = MessagePort::entanglePorts(*context, m_channels.release());
-        return MessageEvent::create(messagePorts.release(), m_message, m_origin, "", m_source);
+        return MessageEvent::create(messagePorts.release(), m_message, m_origin, String(), m_source);
     }
     SecurityOrigin* targetOrigin() const { return m_targetOrigin.get(); }
     ScriptCallStack* stackTrace() const { return m_stackTrace.get(); }
diff --git a/Source/core/page/DOMWindow.h b/Source/core/page/DOMWindow.h
index cdda703..21ecdc5 100644
--- a/Source/core/page/DOMWindow.h
+++ b/Source/core/page/DOMWindow.h
@@ -28,7 +28,7 @@
 #define DOMWindow_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/page/FrameDestructionObserver.h"
 #include "core/platform/LifecycleContext.h"
 #include "core/platform/Supplementable.h"
diff --git a/Source/core/page/DOMWindowTimers.cpp b/Source/core/page/DOMWindowTimers.cpp
index 499a798..d8bbe6c 100644
--- a/Source/core/page/DOMWindowTimers.cpp
+++ b/Source/core/page/DOMWindowTimers.cpp
@@ -33,7 +33,7 @@
 #include "config.h"
 #include "core/page/DOMWindowTimers.h"
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/page/DOMTimer.h"
 
 namespace WebCore {
diff --git a/Source/core/page/DeviceController.h b/Source/core/page/DeviceController.h
index b9fcbc1..bcdf1f1 100644
--- a/Source/core/page/DeviceController.h
+++ b/Source/core/page/DeviceController.h
@@ -27,7 +27,7 @@
 #ifndef DeviceController_h
 #define DeviceController_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/page/DOMWindow.h"
 #include "core/platform/Supplementable.h"
 #include "core/platform/Timer.h"
diff --git a/Source/core/page/DragController.cpp b/Source/core/page/DragController.cpp
index 166fc1c..19dc678 100644
--- a/Source/core/page/DragController.cpp
+++ b/Source/core/page/DragController.cpp
@@ -36,7 +36,7 @@
 #include "core/dom/Element.h"
 #include "core/dom/Node.h"
 #include "core/dom/Text.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/TextEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 152e7d6..eb00a9c 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -33,19 +33,19 @@
 #include "SVGNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 #include "core/dom/DocumentMarkerController.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventPathWalker.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventPathWalker.h"
 #include "core/dom/FullscreenElementStack.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
-#include "core/dom/TextEvent.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
+#include "core/events/TextEvent.h"
 #include "core/dom/TouchController.h"
-#include "core/dom/TouchEvent.h"
+#include "core/events/TouchEvent.h"
 #include "core/dom/TouchList.h"
 #include "core/dom/UserTypingGestureIndicator.h"
-#include "core/dom/WheelEvent.h"
+#include "core/events/WheelEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
@@ -444,8 +444,7 @@
         Position start = pos.deepEquivalent();
         Position end = pos.deepEquivalent();
         if (pos.isNotNull()) {
-            Vector<DocumentMarker*> markers = innerNode->document().markers()->markersInRange(
-                makeRange(pos, pos).get(), DocumentMarker::Spelling | DocumentMarker::Grammar);
+            Vector<DocumentMarker*> markers = innerNode->document().markers()->markersInRange(makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers());
             if (markers.size() == 1) {
                 start.moveToOffset(markers[0]->startOffset());
                 end.moveToOffset(markers[0]->endOffset());
diff --git a/Source/core/page/EventHandler.h b/Source/core/page/EventHandler.h
index 5c5c4b9..32ee8b3 100644
--- a/Source/core/page/EventHandler.h
+++ b/Source/core/page/EventHandler.h
@@ -26,7 +26,7 @@
 #ifndef EventHandler_h
 #define EventHandler_h
 
-#include "core/dom/TextEventInputType.h"
+#include "core/events/TextEventInputType.h"
 #include "core/dom/UserGestureIndicator.h"
 #include "core/editing/TextGranularity.h"
 #include "core/page/DragActions.h"
diff --git a/Source/core/page/EventSource.cpp b/Source/core/page/EventSource.cpp
index d9cedc5..6d069cc 100644
--- a/Source/core/page/EventSource.cpp
+++ b/Source/core/page/EventSource.cpp
@@ -38,9 +38,9 @@
 #include "bindings/v8/ScriptController.h"
 #include "bindings/v8/SerializedScriptValue.h"
 #include "core/dom/Document.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/MessageEvent.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/fetch/TextResourceDecoder.h"
 #include "core/loader/ThreadableLoader.h"
diff --git a/Source/core/page/EventSource.h b/Source/core/page/EventSource.h
index c407e09..8a77c79 100644
--- a/Source/core/page/EventSource.h
+++ b/Source/core/page/EventSource.h
@@ -34,7 +34,7 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/loader/ThreadableLoaderClient.h"
 #include "core/platform/Timer.h"
 #include "weborigin/KURL.h"
diff --git a/Source/core/page/FocusController.cpp b/Source/core/page/FocusController.cpp
index 81c4129..69a776b 100644
--- a/Source/core/page/FocusController.cpp
+++ b/Source/core/page/FocusController.cpp
@@ -33,8 +33,8 @@
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/Range.h"
 #include "core/dom/shadow/ElementShadow.h"
diff --git a/Source/core/page/Frame.cpp b/Source/core/page/Frame.cpp
index c9ed2a3..7e1e409 100644
--- a/Source/core/page/Frame.cpp
+++ b/Source/core/page/Frame.cpp
@@ -33,7 +33,7 @@
 #include "RuntimeEnabledFeatures.h"
 #include "bindings/v8/ScriptController.h"
 #include "core/dom/DocumentType.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/WheelController.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
diff --git a/Source/core/page/FrameActionScheduler.cpp b/Source/core/page/FrameActionScheduler.cpp
index d1638fd..ff47c51 100644
--- a/Source/core/page/FrameActionScheduler.cpp
+++ b/Source/core/page/FrameActionScheduler.cpp
@@ -27,7 +27,7 @@
 #include "core/page/FrameActionScheduler.h"
 
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/Node.h"
 #include "wtf/Vector.h"
 
diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp
index b8541cd..26a418a 100644
--- a/Source/core/page/FrameView.cpp
+++ b/Source/core/page/FrameView.cpp
@@ -34,7 +34,7 @@
 #include "core/css/FontFaceSet.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/DocumentMarkerController.h"
-#include "core/dom/OverflowEvent.h"
+#include "core/events/OverflowEvent.h"
 #include "core/editing/FrameSelection.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/fetch/TextResourceDecoder.h"
@@ -573,9 +573,14 @@
         overflowY = OHIDDEN;
     }
 
+    bool ignoreOverflowHidden = false;
+    if (m_frame->page()->settings().ignoreMainFrameOverflowHiddenQuirk() && m_frame->page()->mainFrame() == m_frame)
+        ignoreOverflowHidden = true;
+
     switch (overflowX) {
         case OHIDDEN:
-            hMode = ScrollbarAlwaysOff;
+            if (!ignoreOverflowHidden)
+                hMode = ScrollbarAlwaysOff;
             break;
         case OSCROLL:
             hMode = ScrollbarAlwaysOn;
@@ -590,7 +595,8 @@
 
      switch (overflowY) {
         case OHIDDEN:
-            vMode = ScrollbarAlwaysOff;
+            if (!ignoreOverflowHidden)
+                vMode = ScrollbarAlwaysOff;
             break;
         case OSCROLL:
             vMode = ScrollbarAlwaysOn;
@@ -756,7 +762,7 @@
     return renderView->compositor()->layerForScrollCorner();
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 GraphicsLayer* FrameView::layerForOverhangAreas() const
 {
     RenderView* renderView = this->renderView();
@@ -764,7 +770,7 @@
         return 0;
     return renderView->compositor()->layerForOverhangAreas();
 }
-#endif // ENABLE(RUBBER_BANDING)
+#endif // USE(RUBBER_BANDING)
 
 bool FrameView::hasCompositedContent() const
 {
@@ -2935,7 +2941,8 @@
     RenderObject::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(rootLayer->renderer());
 #endif
 
-    rootLayer->paint(p, rect, m_paintBehavior, eltRenderer);
+    RenderObject* enclosingLayerRenderer = eltRenderer->enclosingLayer() ? eltRenderer->enclosingLayer()->renderer() : eltRenderer;
+    rootLayer->paint(p, rect, m_paintBehavior, enclosingLayerRenderer);
 
     if (rootLayer->containsDirtyOverlayScrollbars())
         rootLayer->paintOverlayScrollbars(p, rect, m_paintBehavior, eltRenderer);
@@ -3368,7 +3375,7 @@
 {
     // Note that to allow for rubber-band over-scroll behavior, even non-scrollable views
     // should handle wheel events.
-#if !ENABLE(RUBBER_BANDING)
+#if !USE(RUBBER_BANDING)
     if (!isScrollable())
         return false;
 #endif
diff --git a/Source/core/page/FrameView.h b/Source/core/page/FrameView.h
index 853d4e7..81c9895 100644
--- a/Source/core/page/FrameView.h
+++ b/Source/core/page/FrameView.h
@@ -396,7 +396,7 @@
     virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
     virtual GraphicsLayer* layerForVerticalScrollbar() const OVERRIDE;
     virtual GraphicsLayer* layerForScrollCorner() const OVERRIDE;
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     virtual GraphicsLayer* layerForOverhangAreas() const OVERRIDE;
 #endif
 
diff --git a/Source/core/page/Page.cpp b/Source/core/page/Page.cpp
index d1b954d..5635bb3 100644
--- a/Source/core/page/Page.cpp
+++ b/Source/core/page/Page.cpp
@@ -22,8 +22,8 @@
 
 #include "core/dom/ClientRectList.h"
 #include "core/dom/DocumentMarkerController.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/dom/StyleEngine.h"
 #include "core/dom/VisitedLinkState.h"
 #include "core/editing/Caret.h"
diff --git a/Source/core/page/Performance.h b/Source/core/page/Performance.h
index b695b5d..b222b49 100644
--- a/Source/core/page/Performance.h
+++ b/Source/core/page/Performance.h
@@ -33,7 +33,7 @@
 #define Performance_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/page/DOMWindowProperty.h"
 #include "core/page/MemoryInfo.h"
 #include "core/page/PerformanceEntry.h"
diff --git a/Source/core/page/PointerLockController.cpp b/Source/core/page/PointerLockController.cpp
index 015c7ff..3145cff 100644
--- a/Source/core/page/PointerLockController.cpp
+++ b/Source/core/page/PointerLockController.cpp
@@ -26,7 +26,7 @@
 #include "core/page/PointerLockController.h"
 
 #include "core/dom/Element.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/page/Chrome.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
diff --git a/Source/core/page/RuntimeCSSEnabled.cpp b/Source/core/page/RuntimeCSSEnabled.cpp
index 3727cec..42934b3 100644
--- a/Source/core/page/RuntimeCSSEnabled.cpp
+++ b/Source/core/page/RuntimeCSSEnabled.cpp
@@ -92,6 +92,11 @@
         CSSPropertyGridTemplate
     };
     setCSSPropertiesEnabled(cssGridLayoutProperties, WTF_ARRAY_LENGTH(cssGridLayoutProperties), RuntimeEnabledFeatures::cssGridLayoutEnabled());
+    CSSPropertyID cssObjectFitPositionProperties[] = {
+        CSSPropertyObjectFit,
+        CSSPropertyObjectPosition
+    };
+    setCSSPropertiesEnabled(cssObjectFitPositionProperties, WTF_ARRAY_LENGTH(cssObjectFitPositionProperties), RuntimeEnabledFeatures::objectFitPositionEnabled());
 
     CSSPropertyID animationProperties[] = {
         CSSPropertyAnimation,
@@ -108,10 +113,10 @@
 
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyBackgroundBlendMode, RuntimeEnabledFeatures::cssCompositingEnabled());
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyMixBlendMode, RuntimeEnabledFeatures::cssCompositingEnabled());
+    RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyIsolation, RuntimeEnabledFeatures::cssCompositingEnabled());
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyTouchAction, RuntimeEnabledFeatures::cssTouchActionEnabled());
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyPaintOrder, RuntimeEnabledFeatures::svgPaintOrderEnabled());
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyVariable, RuntimeEnabledFeatures::cssVariablesEnabled());
-    RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyObjectFit, RuntimeEnabledFeatures::objectFitPositionEnabled());
     RuntimeCSSEnabled::setCSSPropertyEnabled(CSSPropertyMaskSourceType, RuntimeEnabledFeatures::cssMaskSourceTypeEnabled());
 }
 
diff --git a/Source/core/page/RuntimeEnabledFeatures.in b/Source/core/page/RuntimeEnabledFeatures.in
index bd62381..a6b6686 100644
--- a/Source/core/page/RuntimeEnabledFeatures.in
+++ b/Source/core/page/RuntimeEnabledFeatures.in
@@ -34,7 +34,7 @@
 CustomElements status=experimental
 Database status=stable
 DataListElement status=stable
-DeviceMotion status=test
+DeviceMotion status=stable
 DeviceOrientation status=stable
 DevicePixelRatioIncludesZoom status=stable
 DialogElement status=experimental
@@ -59,14 +59,15 @@
 InputTypeColor status=stable
 InputTypeWeek status=stable
 LangAttributeAwareFormControlUI
-LegacyEncryptedMedia status=stable
+PrefixedEncryptedMedia status=stable
 LocalStorage status=stable
 Media status=stable
 MediaSource status=stable
 MediaStream status=stable
-NavigationController status=experimental
 Notifications status=stable
 ObjectFitPosition status=experimental
+// Only enabled on Android, and for certain layout tests on Linux.
+OverlayFullscreenVideo
 PagePopup status=stable
 PartialLayout status=experimental
 PathOpsSVGClipping
@@ -79,11 +80,13 @@
 RowSpanLogicalHeightSpreading status=test
 ScriptedSpeech status=stable
 SeamlessIFrames status=experimental
+ServiceWorker status=experimental
 SessionStorage status=stable
 ShadowDOM status=experimental
 SharedWorker custom
 SpeechInput status=stable
 SpeechSynthesis status=experimental
+Srcset status=experimental
 Stream status=experimental
 StyleScoped status=experimental
 SubpixelFontScaling
diff --git a/Source/core/page/Settings.in b/Source/core/page/Settings.in
index 9478713..5383a4a 100644
--- a/Source/core/page/Settings.in
+++ b/Source/core/page/Settings.in
@@ -137,6 +137,8 @@
 # the Android SDK prior to and including version 18. Presumably, this
 # can be removed any time after 2015. See http://crbug.com/282130.
 viewportMetaZeroValuesQuirk initial=false
+# Another Android SDK <= 18 quirk, removable 2015.  http://crbug.com/295287
+ignoreMainFrameOverflowHiddenQuirk initial=false
 # This quirk is to maintain compatibility with Android apps.
 # It will be possible to remove it once WebSettings.{get|set}UseWideViewPort
 # API function will be removed. See http://crbug.com/288037.
diff --git a/Source/core/page/SpeechInputEvent.cpp b/Source/core/page/SpeechInputEvent.cpp
index fec8d27..5a9a15e 100644
--- a/Source/core/page/SpeechInputEvent.cpp
+++ b/Source/core/page/SpeechInputEvent.cpp
@@ -34,7 +34,7 @@
 
 #include "core/page/SpeechInputEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 
 namespace WebCore {
 
diff --git a/Source/core/page/SpeechInputEvent.h b/Source/core/page/SpeechInputEvent.h
index 8166c0c..0fe594c 100644
--- a/Source/core/page/SpeechInputEvent.h
+++ b/Source/core/page/SpeechInputEvent.h
@@ -28,7 +28,7 @@
 
 #if ENABLE(INPUT_SPEECH)
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/page/SpeechInputResultList.h"
 
 #include "wtf/PassRefPtr.h"
diff --git a/Source/core/page/UseCounter.cpp b/Source/core/page/UseCounter.cpp
index 5db2ae9..c7788ce 100644
--- a/Source/core/page/UseCounter.cpp
+++ b/Source/core/page/UseCounter.cpp
@@ -325,10 +325,10 @@
     case CSSPropertyWebkitMarginStart: return 273;
     // CSSPropertyWebkitMarquee was 274.
     case CSSPropertyInternalMarqueeDirection: return 275;
-    case CSSPropertyWebkitMarqueeIncrement: return 276;
-    case CSSPropertyWebkitMarqueeRepetition: return 277;
-    case CSSPropertyWebkitMarqueeSpeed: return 278;
-    case CSSPropertyWebkitMarqueeStyle: return 279;
+    case CSSPropertyInternalMarqueeIncrement: return 276;
+    case CSSPropertyInternalMarqueeRepetition: return 277;
+    case CSSPropertyInternalMarqueeSpeed: return 278;
+    case CSSPropertyInternalMarqueeStyle: return 279;
     case CSSPropertyWebkitMask: return 280;
     case CSSPropertyWebkitMaskBoxImage: return 281;
     case CSSPropertyWebkitMaskBoxImageOutset: return 282;
@@ -495,6 +495,8 @@
     case CSSPropertyObjectFit: return 433;
     case CSSPropertyPaintOrder: return 434;
     case CSSPropertyMaskSourceType: return 435;
+    case CSSPropertyIsolation: return 436;
+    case CSSPropertyObjectPosition: return 437;
 
     // Add new features above this line (don't change the assigned numbers of the existing
     // items) and update maximumCSSSampleId() with the new maximum value.
@@ -509,7 +511,7 @@
     return 0;
 }
 
-static int maximumCSSSampleId() { return 434; }
+static int maximumCSSSampleId() { return 437; }
 
 UseCounter::UseCounter()
 {
@@ -676,10 +678,16 @@
     }
 }
 
-void UseCounter::count(CSSPropertyID feature)
+void UseCounter::count(CSSParserContext context, CSSPropertyID feature)
 {
     ASSERT(feature >= firstCSSProperty);
     ASSERT(feature <= lastCSSProperty);
+    ASSERT(!isInternalProperty(feature));
+
+    // We don't count the UA style sheet in our statistics.
+    if (context.mode == UASheetMode)
+        return;
+
     m_CSSFeatureBits.quickSet(feature);
 }
 
diff --git a/Source/core/page/UseCounter.h b/Source/core/page/UseCounter.h
index 33fa001..b5bba84 100644
--- a/Source/core/page/UseCounter.h
+++ b/Source/core/page/UseCounter.h
@@ -209,6 +209,10 @@
         DOMNodeInsertedIntoDocumentEvent,
         DOMCharacterDataModifiedEvent,
         DocumentAllTags,
+        DocumentAllLegacyCall,
+        HTMLAppletElementLegacyCall,
+        HTMLEmbedElementLegacyCall,
+        HTMLObjectElementLegacyCall,
         // Add new features immediately above this line. Don't change assigned
         // numbers of each items, and don't reuse unused slots.
         NumberOfFeatures, // This enum value must be last.
@@ -217,7 +221,7 @@
     // "count" sets the bit for this feature to 1. Repeated calls are ignored.
     static void count(Document*, Feature);
     static void count(DOMWindow*, Feature);
-    void count(CSSPropertyID);
+    void count(CSSParserContext, CSSPropertyID);
     void count(Feature);
 
     // "countDeprecation" sets the bit for this feature to 1, and sends a deprecation
diff --git a/Source/core/page/UserContentURLPattern.cpp b/Source/core/page/UserContentURLPattern.cpp
index 18fb2a7..4f18ab8 100644
--- a/Source/core/page/UserContentURLPattern.cpp
+++ b/Source/core/page/UserContentURLPattern.cpp
@@ -67,7 +67,7 @@
     DEFINE_STATIC_LOCAL(const String, schemeSeparator, ("://"));
 
     size_t schemeEndPos = pattern.find(schemeSeparator);
-    if (schemeEndPos == notFound)
+    if (schemeEndPos == kNotFound)
         return false;
 
     m_scheme = pattern.left(schemeEndPos);
@@ -82,7 +82,7 @@
         pathStartPos = hostStartPos;
     else {
         size_t hostEndPos = pattern.find("/", hostStartPos);
-        if (hostEndPos == notFound)
+        if (hostEndPos == kNotFound)
             return false;
 
         m_host = pattern.substring(hostStartPos, hostEndPos - hostStartPos);
@@ -99,7 +99,7 @@
         }
 
         // No other '*' can occur in the host.
-        if (m_host.find("*") != notFound)
+        if (m_host.find("*") != kNotFound)
             return false;
 
         pathStartPos = hostEndPos;
diff --git a/Source/core/page/WindowFeatures.cpp b/Source/core/page/WindowFeatures.cpp
index 1d944e6..8614ea0 100644
--- a/Source/core/page/WindowFeatures.cpp
+++ b/Source/core/page/WindowFeatures.cpp
@@ -244,16 +244,16 @@
 
         size_t separatorPosition = featureString.find('=');
         size_t colonPosition = featureString.find(':');
-        if (separatorPosition != notFound && colonPosition != notFound)
+        if (separatorPosition != kNotFound && colonPosition != kNotFound)
             continue; // ignore strings that have both = and :
-        if (separatorPosition == notFound)
+        if (separatorPosition == kNotFound)
             separatorPosition = colonPosition;
 
         String key = featureString.left(separatorPosition).stripWhiteSpace().lower();
 
         // Null string for value indicates key without value.
         String value;
-        if (separatorPosition != notFound) {
+        if (separatorPosition != kNotFound) {
             value = featureString.substring(separatorPosition + 1).stripWhiteSpace().lower();
             value = value.left(value.find(' '));
         }
diff --git a/Source/core/page/animation/AnimationController.cpp b/Source/core/page/animation/AnimationController.cpp
index 087325e..b313e7c 100644
--- a/Source/core/page/animation/AnimationController.cpp
+++ b/Source/core/page/animation/AnimationController.cpp
@@ -29,10 +29,10 @@
 #include "config.h"
 #include "core/page/animation/AnimationController.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/PseudoElement.h"
-#include "core/dom/TransitionEvent.h"
-#include "core/dom/WebKitAnimationEvent.h"
+#include "core/events/TransitionEvent.h"
+#include "core/events/WebKitAnimationEvent.h"
 #include "core/page/Frame.h"
 #include "core/page/FrameView.h"
 #include "core/page/Page.h"
diff --git a/Source/core/page/animation/CSSPropertyAnimation.cpp b/Source/core/page/animation/CSSPropertyAnimation.cpp
index 5b31b8c..4f5ab98 100644
--- a/Source/core/page/animation/CSSPropertyAnimation.cpp
+++ b/Source/core/page/animation/CSSPropertyAnimation.cpp
@@ -85,6 +85,11 @@
                       blendFunc(anim, from.height(), to.height(), progress));
 }
 
+static inline LengthPoint blendFunc(const AnimationBase* anim, const LengthPoint& from, const LengthPoint& to, double progress)
+{
+    return LengthPoint(blendFunc(anim, from.x(), to.x(), progress), blendFunc(anim, from.y(), to.y(), progress));
+}
+
 static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from, const IntSize& to, double progress)
 {
     return IntSize(blendFunc(anim, from.width(), to.width(), progress),
@@ -1110,6 +1115,8 @@
     gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMaskPositionY, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers));
     gPropertyWrappers->append(new FillLayersPropertyWrapper(CSSPropertyWebkitMaskSize, &RenderStyle::maskLayers, &RenderStyle::accessMaskLayers));
 
+    gPropertyWrappers->append(new PropertyWrapper<LengthPoint>(CSSPropertyObjectPosition, &RenderStyle::objectPosition, &RenderStyle::setObjectPosition));
+
     gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyFontSize,
         // Must pass a specified size to setFontSize if Text Autosizing is enabled, but a computed size
         // if text zoom is enabled (if neither is enabled it's irrelevant as they're probably the same).
diff --git a/Source/core/page/animation/ImplicitAnimation.cpp b/Source/core/page/animation/ImplicitAnimation.cpp
index 4ceeff6..9120c90 100644
--- a/Source/core/page/animation/ImplicitAnimation.cpp
+++ b/Source/core/page/animation/ImplicitAnimation.cpp
@@ -28,7 +28,7 @@
 
 #include "config.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/page/UseCounter.h"
 #include "core/page/animation/AnimationControllerPrivate.h"
 #include "core/page/animation/CSSPropertyAnimation.h"
diff --git a/Source/core/page/animation/KeyframeAnimation.cpp b/Source/core/page/animation/KeyframeAnimation.cpp
index 8017ca1..bba9862 100644
--- a/Source/core/page/animation/KeyframeAnimation.cpp
+++ b/Source/core/page/animation/KeyframeAnimation.cpp
@@ -31,7 +31,7 @@
 
 #include "CSSPropertyNames.h"
 #include "core/css/resolver/StyleResolver.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/page/UseCounter.h"
 #include "core/page/animation/AnimationControllerPrivate.h"
 #include "core/page/animation/CSSPropertyAnimation.h"
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index dfa54b6..3fc3145 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -391,6 +391,10 @@
             if (compositedLayer != curLayer) {
                 FloatQuad compositorQuad = geometryMap.mapToContainer(rect, compositedLayer->renderer());
                 rect = LayoutRect(compositorQuad.boundingBox());
+                // If the enclosing composited layer itself is scrolled, we have to undo the subtraction
+                // of its scroll offset since we want the offset relative to the scrolling content, not
+                // the element itself.
+                rect.move(compositedLayer->scrolledContentOffset());
             }
             compIter->value.append(rect);
         }
@@ -512,30 +516,22 @@
     setTouchEventTargetRects(touchEventTargetRects);
 }
 
-void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, RenderLayer* parent)
+void ScrollingCoordinator::updateScrollParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
 {
-    WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->layerForScrollChild());
-    if (!childWebLayer)
-        return;
-
     WebLayer* scrollParentWebLayer = 0;
     if (parent && parent->backing())
         scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing()->parentForSublayers());
 
-    childWebLayer->setScrollParent(scrollParentWebLayer);
+    child->setScrollParent(scrollParentWebLayer);
 }
 
-void ScrollingCoordinator::updateClipParentForLayer(RenderLayer* child, RenderLayer* parent)
+void ScrollingCoordinator::updateClipParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent)
 {
-    WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->backing()->graphicsLayer());
-    if (!childWebLayer)
-        return;
-
     WebLayer* clipParentWebLayer = 0;
     if (parent && parent->backing())
         clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing()->parentForSublayers());
 
-    childWebLayer->setClipParent(clipParentWebLayer);
+    child->setClipParent(clipParentWebLayer);
 }
 
 void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer)
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.h b/Source/core/page/scrolling/ScrollingCoordinator.h
index 0f08aab..b0fe76a 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.h
+++ b/Source/core/page/scrolling/ScrollingCoordinator.h
@@ -101,8 +101,8 @@
     void touchEventTargetRectsDidChange(const Document*);
     void willDestroyRenderLayer(RenderLayer*);
 
-    void updateScrollParentForLayer(RenderLayer* child, RenderLayer* parent);
-    void updateClipParentForLayer(RenderLayer* child, RenderLayer* parent);
+    void updateScrollParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent);
+    void updateClipParentForGraphicsLayer(GraphicsLayer* child, RenderLayer* parent);
 
     static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons);
     String mainThreadScrollingReasonsAsText() const;
diff --git a/Source/core/platform/Clock.cpp b/Source/core/platform/Clock.cpp
deleted file mode 100644
index 4d2da23..0000000
--- a/Source/core/platform/Clock.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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
- * 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.
- */
-
-#include "config.h"
-#include "core/platform/Clock.h"
-
-#include "wtf/CurrentTime.h"
-
-using namespace WebCore;
-
-Clock::Clock()
-    : m_running(false)
-    , m_rate(1)
-    , m_offset(0)
-{
-    m_startTime = m_lastTime = now();
-}
-
-void Clock::setCurrentTime(double time)
-{
-    m_startTime = m_lastTime = now();
-    m_offset = time;
-}
-
-double Clock::currentTime() const
-{
-    if (m_running)
-        m_lastTime = now();
-    return ((m_lastTime - m_startTime) * m_rate) + m_offset;
-}
-
-void Clock::setPlayRate(double rate)
-{
-    m_offset = now();
-    m_lastTime = m_startTime = now();
-    m_rate = rate;
-}
-
-void Clock::start()
-{
-    if (m_running)
-        return;
-
-    m_lastTime = m_startTime = now();
-    m_running = true;
-}
-
-void Clock::stop()
-{
-    if (!m_running)
-        return;
-
-    m_offset = now();
-    m_lastTime = m_startTime = now();
-    m_running = false;
-}
-
-double Clock::now() const
-{
-    return WTF::currentTime();
-}
-
-PassRefPtr<Clock> Clock::create()
-{
-    return adoptRef(new Clock());
-}
diff --git a/Source/core/platform/Clock.h b/Source/core/platform/Clock.h
deleted file mode 100644
index b298bf0..0000000
--- a/Source/core/platform/Clock.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2011 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, 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
- * 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.
- */
-
-#ifndef Clock_h
-#define Clock_h
-
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
-
-namespace WebCore {
-
-class Clock : public RefCounted<Clock> {
-public:
-    static PassRefPtr<Clock> create();
-
-    void setCurrentTime(double);
-    double currentTime() const;
-
-    void setPlayRate(double);
-    virtual double playRate() const { return m_rate; }
-
-    void start();
-    void stop();
-    bool isRunning() const { return m_running; }
-
-private:
-    Clock();
-    double now() const;
-
-    bool m_running;
-    double m_rate;
-    double m_offset;
-    double m_startTime;
-    mutable double m_lastTime;
-};
-
-}
-
-#endif
diff --git a/Source/core/platform/ContentType.cpp b/Source/core/platform/ContentType.cpp
index c1b0ebd..7136ea5 100644
--- a/Source/core/platform/ContentType.cpp
+++ b/Source/core/platform/ContentType.cpp
@@ -42,18 +42,18 @@
 
     // a MIME type can have one or more "param=value" after a semi-colon, and separated from each other by semi-colons
     size_t semi = strippedType.find(';');
-    if (semi != notFound) {
+    if (semi != kNotFound) {
         size_t start = strippedType.find(parameterName, semi + 1, false);
-        if (start != notFound) {
+        if (start != kNotFound) {
             start = strippedType.find('=', start + parameterName.length());
-            if (start != notFound) {
+            if (start != kNotFound) {
                 size_t quote = strippedType.find('\"', start + 1);
                 size_t end = strippedType.find('\"', start + 2);
-                if (quote != notFound && end != notFound)
+                if (quote != kNotFound && end != kNotFound)
                     start = quote;
                 else {
                     end = strippedType.find(';', start + 1);
-                    if (end == notFound)
+                    if (end == kNotFound)
                         end = strippedType.length();
                 }
                 parameterValue = strippedType.substring(start + 1, end - (start + 1)).stripWhiteSpace();
@@ -70,7 +70,7 @@
 
     // "type" can have parameters after a semi-colon, strip them
     size_t semi = strippedType.find(';');
-    if (semi != notFound)
+    if (semi != kNotFound)
         strippedType = strippedType.left(semi).stripWhiteSpace();
 
     return strippedType;
diff --git a/Source/core/platform/Language.cpp b/Source/core/platform/Language.cpp
index 3376fab..1b50dd2 100644
--- a/Source/core/platform/Language.cpp
+++ b/Source/core/platform/Language.cpp
@@ -26,10 +26,21 @@
 #include "config.h"
 #include "core/platform/Language.h"
 
+#include "public/platform/Platform.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
 
+static String platformLanguage()
+{
+    DEFINE_STATIC_LOCAL(String, computedDefaultLanguage, ());
+    if (computedDefaultLanguage.isEmpty()) {
+        computedDefaultLanguage.append(WebKit::Platform::current()->defaultLocale());
+        ASSERT(!computedDefaultLanguage.isEmpty());
+    }
+    return computedDefaultLanguage;
+}
+
 String defaultLanguage()
 {
     Vector<String> languages = userPreferredLanguages();
@@ -61,7 +72,10 @@
     if (!override.isEmpty())
         return override;
 
-    return platformUserPreferredLanguages();
+    Vector<String> languages;
+    languages.reserveInitialCapacity(1);
+    languages.append(platformLanguage());
+    return languages;
 }
 
 static String canonicalLanguageIdentifier(const String& languageCode)
diff --git a/Source/core/platform/Language.h b/Source/core/platform/Language.h
index 2626085..44dc0a2 100644
--- a/Source/core/platform/Language.h
+++ b/Source/core/platform/Language.h
@@ -37,8 +37,6 @@
 void overrideUserPreferredLanguages(const Vector<String>&);
 size_t indexOfBestMatchingLanguageInList(const String& language, const Vector<String>& languageList);
 
-Vector<String> platformUserPreferredLanguages();
-
 }
 
 #endif
diff --git a/Source/core/platform/Length.cpp b/Source/core/platform/Length.cpp
index bb67fc4..95a3733 100644
--- a/Source/core/platform/Length.cpp
+++ b/Source/core/platform/Length.cpp
@@ -99,7 +99,7 @@
     unsigned pos = 0;
     size_t pos2;
 
-    while ((pos2 = str->find(' ', pos)) != notFound) {
+    while ((pos2 = str->find(' ', pos)) != kNotFound) {
         r[i++] = parseHTMLAreaCoordinate(str->characters8() + pos, pos2 - pos);
         pos = pos2 + 1;
     }
@@ -144,16 +144,6 @@
         return m_map.get(index);
     }
 
-    void decrementRef(int index)
-    {
-        ASSERT(m_map.contains(index));
-        CalculationValue* value = m_map.get(index);
-        if (value->hasOneRef())
-            m_map.remove(index);
-        else
-            value->deref();
-    }
-
 private:
     int m_index;
     HashMap<int, RefPtr<CalculationValue> > m_map;
@@ -200,7 +190,10 @@
 void Length::decrementCalculatedRef() const
 {
     ASSERT(isCalculated());
-    calcHandles().decrementRef(calculationHandle());
+    RefPtr<CalculationValue> calcLength = calculationValue();
+    if (calcLength->hasOneRef())
+        calcHandles().remove(calculationHandle());
+    calcLength->deref();
 }
 
 float Length::nonNanCalculatedValue(int maxValue) const
diff --git a/Source/core/platform/LengthPoint.h b/Source/core/platform/LengthPoint.h
new file mode 100644
index 0000000..151a852
--- /dev/null
+++ b/Source/core/platform/LengthPoint.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2013, Opera Software ASA. 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 Opera Software ASA 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 HOLDER 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.
+ */
+
+#ifndef LengthPoint_h
+#define LengthPoint_h
+
+#include "core/platform/Length.h"
+
+namespace WebCore {
+
+struct LengthPoint {
+public:
+    LengthPoint()
+    {
+    }
+
+    LengthPoint(Length x, Length y)
+        : m_x(x)
+        , m_y(y)
+    {
+    }
+
+    bool operator==(const LengthPoint& o) const { return m_x == o.m_x && m_y == o.m_y; }
+    bool operator!=(const LengthPoint& o) const { return m_x != o.m_x || m_y != o.m_y; }
+
+    void setX(Length x) { m_x = x; }
+    Length x() const { return m_x; }
+
+    void setY(Length y) { m_y = y; }
+    Length y() const { return m_y; }
+
+private:
+    Length m_x;
+    Length m_y;
+};
+
+} // namespace WebCore
+
+#endif // LengthPoint_h
diff --git a/Source/core/platform/LocalizedStrings.cpp b/Source/core/platform/LocalizedStrings.cpp
index c195272..17c63bb 100644
--- a/Source/core/platform/LocalizedStrings.cpp
+++ b/Source/core/platform/LocalizedStrings.cpp
@@ -417,76 +417,4 @@
     return String();
 }
 
-String validationMessageValueMissingText()
-{
-    return query(WebLocalizedString::ValidationValueMissing);
-}
-
-String validationMessageValueMissingForCheckboxText()
-{
-    return query(WebLocalizedString::ValidationValueMissingForCheckbox);
-}
-
-String validationMessageValueMissingForFileText()
-{
-    return query(WebLocalizedString::ValidationValueMissingForFile);
-}
-
-String validationMessageValueMissingForMultipleFileText()
-{
-    return query(WebLocalizedString::ValidationValueMissingForMultipleFile);
-}
-
-String validationMessageValueMissingForRadioText()
-{
-    return query(WebLocalizedString::ValidationValueMissingForRadio);
-}
-
-String validationMessageValueMissingForSelectText()
-{
-    return query(WebLocalizedString::ValidationValueMissingForSelect);
-}
-
-String validationMessageTypeMismatchText()
-{
-    return query(WebLocalizedString::ValidationTypeMismatch);
-}
-
-String validationMessageTypeMismatchForURLText()
-{
-    return query(WebLocalizedString::ValidationTypeMismatchForURL);
-}
-
-String validationMessagePatternMismatchText()
-{
-    return query(WebLocalizedString::ValidationPatternMismatch);
-}
-
-String validationMessageTooLongText(int valueLength, int maxLength)
-{
-    return query(WebLocalizedString::ValidationTooLong, String::number(valueLength), String::number(maxLength));
-}
-
-String validationMessageRangeUnderflowText(const String& minimum)
-{
-    return query(WebLocalizedString::ValidationRangeUnderflow, minimum);
-}
-
-String validationMessageRangeOverflowText(const String& maximum)
-{
-    return query(WebLocalizedString::ValidationRangeOverflow, maximum);
-}
-
-String validationMessageBadInputForNumberText()
-{
-    return query(WebLocalizedString::ValidationBadInputForNumber);
-}
-
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-String validationMessageBadInputForDateTimeText()
-{
-    return query(WebLocalizedString::ValidationBadInputForDateTime);
-}
-#endif
-
 } // namespace WebCore
diff --git a/Source/core/platform/LocalizedStrings.h b/Source/core/platform/LocalizedStrings.h
index dce4df3..d94765b 100644
--- a/Source/core/platform/LocalizedStrings.h
+++ b/Source/core/platform/LocalizedStrings.h
@@ -107,23 +107,6 @@
     String localizedMediaControlElementHelpText(const String&);
     String localizedMediaTimeDescription(float);
 
-    String validationMessageValueMissingText();
-    String validationMessageValueMissingForCheckboxText();
-    String validationMessageValueMissingForFileText();
-    String validationMessageValueMissingForMultipleFileText();
-    String validationMessageValueMissingForRadioText();
-    String validationMessageValueMissingForSelectText();
-    String validationMessageTypeMismatchText();
-    String validationMessageTypeMismatchForURLText();
-    String validationMessagePatternMismatchText();
-    String validationMessageTooLongText(int valueLength, int maxLength);
-    String validationMessageRangeUnderflowText(const String& minimum);
-    String validationMessageRangeOverflowText(const String& maximum);
-    String validationMessageBadInputForNumberText();
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
-    String validationMessageBadInputForDateTimeText();
-#endif
-
     String clickToExitFullScreenText();
 
     String textTrackSubtitlesText();
diff --git a/Source/core/platform/MIMETypeFromURL.cpp b/Source/core/platform/MIMETypeFromURL.cpp
index 3af401c..74dba93 100644
--- a/Source/core/platform/MIMETypeFromURL.cpp
+++ b/Source/core/platform/MIMETypeFromURL.cpp
@@ -37,9 +37,9 @@
 {
     ASSERT(protocolIs(url, "data"));
     size_t index = url.find(';');
-    if (index == notFound)
+    if (index == kNotFound)
         index = url.find(',');
-    if (index != notFound) {
+    if (index != kNotFound) {
         if (index > 5)
             return url.substring(5, index - 5).lower();
         return "text/plain"; // Data URLs with no MIME type are considered text/plain.
diff --git a/Source/core/platform/ParsingUtilities.h b/Source/core/platform/ParsingUtilities.h
new file mode 100644
index 0000000..ba8fa9e
--- /dev/null
+++ b/Source/core/platform/ParsingUtilities.h
@@ -0,0 +1,76 @@
+/*
+ * 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.
+ */
+
+#ifndef ParsingUtilities_h
+#define ParsingUtilities_h
+
+template<typename CharType>
+bool skipExactly(const CharType*& position, const CharType* end, CharType delimiter)
+{
+    if (position < end && *position == delimiter) {
+        ++position;
+        return true;
+    }
+    return false;
+}
+
+template<typename CharType, bool characterPredicate(CharType)>
+bool skipExactly(const CharType*& position, const CharType* end)
+{
+    if (position < end && characterPredicate(*position)) {
+        ++position;
+        return true;
+    }
+    return false;
+}
+
+template<typename CharType>
+void skipUntil(const CharType*& position, const CharType* end, CharType delimiter)
+{
+    while (position < end && *position != delimiter)
+        ++position;
+}
+
+template<typename CharType, bool characterPredicate(CharType)>
+void skipUntil(const CharType*& position, const CharType* end)
+{
+    while (position < end && !characterPredicate(*position))
+        ++position;
+}
+
+template<typename CharType, bool characterPredicate(CharType)>
+void skipWhile(const CharType*& position, const CharType* end)
+{
+    while (position < end && characterPredicate(*position))
+        ++position;
+}
+
+#endif
+
diff --git a/Source/core/platform/PlatformInstrumentation.cpp b/Source/core/platform/PlatformInstrumentation.cpp
index ce1202b..053d47a 100644
--- a/Source/core/platform/PlatformInstrumentation.cpp
+++ b/Source/core/platform/PlatformInstrumentation.cpp
@@ -38,6 +38,9 @@
 
 const char PlatformInstrumentation::ImageDecodeEvent[] = "Decode Image";
 const char PlatformInstrumentation::ImageResizeEvent[] = "Resize Image";
+const char PlatformInstrumentation::DrawLazyPixelRefEvent[] = "Draw LazyPixelRef";
+
+const char PlatformInstrumentation::LazyPixelRef[] = "LazyPixelRef";
 
 const char PlatformInstrumentation::ImageTypeArgument[] = "imageType";
 const char PlatformInstrumentation::CachedArgument[] = "cached";
diff --git a/Source/core/platform/PlatformInstrumentation.h b/Source/core/platform/PlatformInstrumentation.h
index 33414fd..c4e50af 100644
--- a/Source/core/platform/PlatformInstrumentation.h
+++ b/Source/core/platform/PlatformInstrumentation.h
@@ -50,12 +50,23 @@
 
 class PlatformInstrumentation {
 public:
+    class LazyPixelRefTracker: TraceEvent::TraceScopedTrackableObject<void*> {
+    public:
+        LazyPixelRefTracker(void* instance)
+            : TraceScopedTrackableObject(CategoryName, LazyPixelRef, instance)
+        {
+        }
+    };
+
     static const char ImageDecodeEvent[];
     static const char ImageResizeEvent[];
+    static const char DrawLazyPixelRefEvent[];
 
     static const char ImageTypeArgument[];
     static const char CachedArgument[];
 
+    static const char LazyPixelRef[];
+
     static void setClient(PlatformInstrumentationClient*);
     static bool hasClient() { return m_client; }
 
@@ -63,6 +74,7 @@
     static void didDecodeImage();
     static void willResizeImage(bool shouldCache);
     static void didResizeImage();
+    static void didDrawLazyPixelRef(unsigned long long lazyPixelRefId);
 
 private:
     static const char CategoryName[];
@@ -100,6 +112,11 @@
     m_client->didResizeImage();
 }
 
+inline void PlatformInstrumentation::didDrawLazyPixelRef(unsigned long long lazyPixelRefId)
+{
+    TRACE_EVENT_INSTANT1(CategoryName, DrawLazyPixelRefEvent, LazyPixelRef, lazyPixelRefId);
+}
+
 } // namespace WebCore
 
 #endif // PlatformInstrumentation_h
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
index bbb2b2d..616dee2 100644
--- a/Source/core/platform/ScrollView.cpp
+++ b/Source/core/platform/ScrollView.cpp
@@ -934,7 +934,7 @@
         paintContents(context, documentDirtyRect);
     }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     if (!layerForOverhangAreas())
         calculateAndPaintOverhangAreas(context, rect);
 #else
@@ -1008,7 +1008,7 @@
     IntRect horizontalOverhangRect;
     IntRect verticalOverhangRect;
     calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     if (GraphicsLayer* overhangLayer = layerForOverhangAreas()) {
         bool hasOverhangArea = !horizontalOverhangRect.isEmpty() || !verticalOverhangRect.isEmpty();
         overhangLayer->setDrawsContent(hasOverhangArea);
diff --git a/Source/core/platform/ScrollableArea.h b/Source/core/platform/ScrollableArea.h
index 4494722..4669668 100644
--- a/Source/core/platform/ScrollableArea.h
+++ b/Source/core/platform/ScrollableArea.h
@@ -202,7 +202,7 @@
     virtual GraphicsLayer* layerForHorizontalScrollbar() const { return 0; }
     virtual GraphicsLayer* layerForVerticalScrollbar() const { return 0; }
     virtual GraphicsLayer* layerForScrollCorner() const { return 0; }
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     virtual GraphicsLayer* layerForOverhangAreas() const { return 0; }
 #endif
     bool hasLayerForHorizontalScrollbar() const;
diff --git a/Source/core/platform/ScrollbarTheme.h b/Source/core/platform/ScrollbarTheme.h
index d1f3c24..12b4829 100644
--- a/Source/core/platform/ScrollbarTheme.h
+++ b/Source/core/platform/ScrollbarTheme.h
@@ -36,7 +36,7 @@
 class ScrollbarThemeClient;
 class ScrollView;
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 class GraphicsLayer;
 #endif
 
@@ -87,7 +87,7 @@
     virtual void paintOverhangBackground(ScrollView*, GraphicsContext*, const IntRect&, const IntRect&, const IntRect&);
     virtual void paintOverhangShadows(ScrollView*, GraphicsContext*, const IntRect&, const IntRect&, const IntRect&) { }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     virtual void setUpOverhangShadowLayer(GraphicsLayer*) { }
     virtual void updateOverhangShadowLayer(GraphicsLayer* shadowLayer, GraphicsLayer* rootContentLayer) { }
 #endif
diff --git a/Source/core/platform/ThreadGlobalData.cpp b/Source/core/platform/ThreadGlobalData.cpp
index a6f0aac..feeee03 100644
--- a/Source/core/platform/ThreadGlobalData.cpp
+++ b/Source/core/platform/ThreadGlobalData.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "core/platform/ThreadGlobalData.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/inspector/InspectorCounters.h"
 #include "core/platform/ThreadTimers.h"
 #include "wtf/MainThread.h"
diff --git a/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp b/Source/core/platform/animation/AnimationTranslationUtil.cpp
similarity index 99%
rename from Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp
rename to Source/core/platform/animation/AnimationTranslationUtil.cpp
index d798888..57e103c 100644
--- a/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp
+++ b/Source/core/platform/animation/AnimationTranslationUtil.cpp
@@ -24,7 +24,7 @@
 
 #include "config.h"
 
-#include "core/platform/graphics/chromium/AnimationTranslationUtil.h"
+#include "core/platform/animation/AnimationTranslationUtil.h"
 
 #include "core/css/LengthFunctions.h"
 #include "core/platform/animation/CSSAnimationData.h"
diff --git a/Source/core/platform/graphics/chromium/AnimationTranslationUtil.h b/Source/core/platform/animation/AnimationTranslationUtil.h
similarity index 100%
rename from Source/core/platform/graphics/chromium/AnimationTranslationUtil.h
rename to Source/core/platform/animation/AnimationTranslationUtil.h
diff --git a/Source/core/platform/graphics/chromium/AnimationTranslationUtilTest.cpp b/Source/core/platform/animation/AnimationTranslationUtilTest.cpp
similarity index 99%
rename from Source/core/platform/graphics/chromium/AnimationTranslationUtilTest.cpp
rename to Source/core/platform/animation/AnimationTranslationUtilTest.cpp
index 666204e..f81f305 100644
--- a/Source/core/platform/graphics/chromium/AnimationTranslationUtilTest.cpp
+++ b/Source/core/platform/animation/AnimationTranslationUtilTest.cpp
@@ -24,7 +24,7 @@
 
 #include "config.h"
 
-#include "core/platform/graphics/chromium/AnimationTranslationUtil.h"
+#include "core/platform/animation/AnimationTranslationUtil.h"
 
 #include "core/platform/animation/CSSAnimationData.h"
 #include "core/platform/animation/KeyframeValueList.h"
@@ -34,9 +34,9 @@
 #include "core/platform/graphics/transforms/ScaleTransformOperation.h"
 #include "core/platform/graphics/transforms/TransformOperations.h"
 #include "core/platform/graphics/transforms/TranslateTransformOperation.h"
+#include "public/platform/WebAnimation.h"
 #include "wtf/RefPtr.h"
 #include <gtest/gtest.h>
-#include "public/platform/WebAnimation.h"
 
 using namespace WebCore;
 using namespace WebKit;
diff --git a/Source/core/platform/chromium/ChromiumDataObject.cpp b/Source/core/platform/chromium/ChromiumDataObject.cpp
index a9a536d..196fb38 100644
--- a/Source/core/platform/chromium/ChromiumDataObject.cpp
+++ b/Source/core/platform/chromium/ChromiumDataObject.cpp
@@ -42,7 +42,7 @@
 
 namespace WebCore {
 
-PassRefPtr<ChromiumDataObject> ChromiumDataObject::createFromPasteboard()
+PassRefPtr<ChromiumDataObject> ChromiumDataObject::createFromPasteboard(PasteMode pasteMode)
 {
     RefPtr<ChromiumDataObject> dataObject = create();
     uint64_t sequenceNumber = WebKit::Platform::current()->clipboard()->sequenceNumber(currentPasteboardBuffer());
@@ -51,8 +51,11 @@
     ListHashSet<String> types;
     for (size_t i = 0; i < webTypes.size(); ++i)
         types.add(webTypes[i]);
-    for (ListHashSet<String>::const_iterator it = types.begin(); it != types.end(); ++it)
+    for (ListHashSet<String>::const_iterator it = types.begin(); it != types.end(); ++it) {
+        if (pasteMode == PlainTextOnly && *it != mimeTypeTextPlain)
+            continue;
         dataObject->m_itemList.append(ChromiumDataObjectItem::createFromPasteboard(*it, sequenceNumber));
+    }
     return dataObject.release();
 }
 
@@ -94,7 +97,7 @@
 {
     RefPtr<ChromiumDataObjectItem> item = ChromiumDataObjectItem::createFromString(type, data);
     if (!internalAddStringItem(item)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
     return item;
diff --git a/Source/core/platform/chromium/ChromiumDataObject.h b/Source/core/platform/chromium/ChromiumDataObject.h
index dfb9a75..7d47e00 100644
--- a/Source/core/platform/chromium/ChromiumDataObject.h
+++ b/Source/core/platform/chromium/ChromiumDataObject.h
@@ -33,6 +33,7 @@
 
 #include "core/platform/Supplementable.h"
 #include "core/platform/chromium/ChromiumDataObjectItem.h"
+#include "core/platform/chromium/PasteMode.h"
 #include "wtf/ListHashSet.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
@@ -51,7 +52,7 @@
 // of and is not specific to a platform.
 class ChromiumDataObject : public RefCounted<ChromiumDataObject>, public Supplementable<ChromiumDataObject> {
 public:
-    static PassRefPtr<ChromiumDataObject> createFromPasteboard();
+    static PassRefPtr<ChromiumDataObject> createFromPasteboard(PasteMode);
     static PassRefPtr<ChromiumDataObject> create();
 
     PassRefPtr<ChromiumDataObject> copy() const;
diff --git a/Source/core/platform/chromium/ClipboardChromium.cpp b/Source/core/platform/chromium/ClipboardChromium.cpp
index 54afa4d..211e7cd 100644
--- a/Source/core/platform/chromium/ClipboardChromium.cpp
+++ b/Source/core/platform/chromium/ClipboardChromium.cpp
@@ -106,7 +106,7 @@
 void DataTransferItemListPolicyWrapper::deleteItem(unsigned long index, ExceptionState& es)
 {
     if (!m_clipboard->canWriteData()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return;
     }
     m_dataObject->deleteItem(index);
diff --git a/Source/core/platform/chromium/LanguageChromium.cpp b/Source/core/platform/chromium/LanguageChromium.cpp
deleted file mode 100644
index d937bbb..0000000
--- a/Source/core/platform/chromium/LanguageChromium.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2008, 2009, 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.
- */
-
-#include "config.h"
-#include "core/platform/Language.h"
-
-#include "public/platform/Platform.h"
-#include "wtf/text/WTFString.h"
-#include "wtf/Vector.h"
-
-namespace WebCore {
-
-static String platformLanguage()
-{
-    DEFINE_STATIC_LOCAL(String, computedDefaultLanguage, ());
-    if (computedDefaultLanguage.isEmpty()) {
-        computedDefaultLanguage.append(WebKit::Platform::current()->defaultLocale());
-        ASSERT(!computedDefaultLanguage.isEmpty());
-    }
-    return computedDefaultLanguage;
-}
-
-Vector<String> platformUserPreferredLanguages()
-{
-    Vector<String> userPreferredLanguages;
-    userPreferredLanguages.append(platformLanguage());
-    return userPreferredLanguages;
-}
-
-} // namespace WebCore
diff --git a/Source/core/dom/PromiseResolver.idl b/Source/core/platform/chromium/PasteMode.h
similarity index 85%
rename from Source/core/dom/PromiseResolver.idl
rename to Source/core/platform/chromium/PasteMode.h
index ab417fa..351e5d4 100644
--- a/Source/core/dom/PromiseResolver.idl
+++ b/Source/core/platform/chromium/PasteMode.h
@@ -28,11 +28,16 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-   GlobalContext=Window&WorkerGlobalScope,
-   EnabledAtRuntime=Promise
-] interface PromiseResolver {
-   [Custom] void fulfill(optional any value);
-   [Custom] void resolve(optional any value);
-   [Custom] void reject(optional any value);
+#ifndef PasteMode_h
+#define PasteMode_h
+
+namespace WebCore {
+
+enum PasteMode {
+    AllMimeTypes,
+    PlainTextOnly,
 };
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/core/platform/chromium/TraceEvent.h b/Source/core/platform/chromium/TraceEvent.h
index 62f01c4..d56a1da 100644
--- a/Source/core/platform/chromium/TraceEvent.h
+++ b/Source/core/platform/chromium/TraceEvent.h
@@ -166,6 +166,7 @@
 #include "core/platform/EventTracer.h"
 
 #include "wtf/DynamicAnnotations.h"
+#include "wtf/UnusedParam.h"
 #include "wtf/text/CString.h"
 
 // By default, const char* argument values are assumed to have long-lived scope
@@ -173,6 +174,16 @@
 #define TRACE_STR_COPY(str) \
     WebCore::TraceEvent::TraceStringWithCopy(str)
 
+// By default, uint64 ID argument values are not mangled with the Process ID in
+// TRACE_EVENT_ASYNC macros. Use this macro to force Process ID mangling.
+#define TRACE_ID_MANGLE(id) \
+    TraceID::ForceMangle(id)
+
+// By default, pointers are mangled with the Process ID in TRACE_EVENT_ASYNC
+// macros. Use this macro to prevent Process ID mangling.
+#define TRACE_ID_DONT_MANGLE(id) \
+    TraceID::DontMangle(id)
+
 // Records a pair of begin and end events called "name" for the current
 // scope, with 0, 1 or 2 associated arguments. If the category is not
 // enabled, then this does nothing.
@@ -467,6 +478,16 @@
 #define TRACE_EVENT_SET_NONCONST_SAMPLING_STATE(categoryAndName) \
     TRACE_EVENT_SET_NONCONST_SAMPLING_STATE_FOR_BUCKET(0, categoryAndName)
 
+// Macros to track the life time and value of arbitrary client objects.
+// See also TraceTrackableObject.
+#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(categoryGroup, name, id) \
+    INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT, \
+        categoryGroup, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE)
+
+#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(categoryGroup, name, id) \
+    INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \
+        categoryGroup, name, TRACE_ID_DONT_MANGLE(id), TRACE_EVENT_FLAG_NONE)
+
 ////////////////////////////////////////////////////////////////////////////////
 // Implementation specific tracing API definitions.
 
@@ -580,6 +601,8 @@
 #define TRACE_EVENT_PHASE_METADATA ('M')
 #define TRACE_EVENT_PHASE_COUNTER  ('C')
 #define TRACE_EVENT_PHASE_SAMPLE  ('P')
+#define TRACE_EVENT_PHASE_CREATE_OBJECT ('N')
+#define TRACE_EVENT_PHASE_DELETE_OBJECT ('D')
 
 // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT.
 #define TRACE_EVENT_FLAG_NONE        (static_cast<unsigned char>(0))
@@ -611,26 +634,41 @@
 // same pointer is used on different processes.
 class TraceID {
 public:
-    explicit TraceID(const void* id, unsigned char* flags) :
+    template<bool dummyMangle> class MangleBehavior {
+    public:
+        template<typename T> explicit MangleBehavior(T id) : m_data(reinterpret_cast<unsigned long long>(id)) { }
+        unsigned long long data() const { return m_data; }
+    private:
+        unsigned long long m_data;
+    };
+    typedef MangleBehavior<false> DontMangle;
+    typedef MangleBehavior<true> ForceMangle;
+
+    TraceID(const void* id, unsigned char* flags) :
         m_data(static_cast<unsigned long long>(reinterpret_cast<unsigned long>(id)))
     {
         *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
     }
-    explicit TraceID(unsigned long long id, unsigned char* flags) : m_data(id) { (void)flags; }
-    explicit TraceID(unsigned long id, unsigned char* flags) : m_data(id) { (void)flags; }
-    explicit TraceID(unsigned int id, unsigned char* flags) : m_data(id) { (void)flags; }
-    explicit TraceID(unsigned short id, unsigned char* flags) : m_data(id) { (void)flags; }
-    explicit TraceID(unsigned char id, unsigned char* flags) : m_data(id) { (void)flags; }
-    explicit TraceID(long long id, unsigned char* flags) :
-        m_data(static_cast<unsigned long long>(id)) { (void)flags; }
-    explicit TraceID(long id, unsigned char* flags) :
-        m_data(static_cast<unsigned long long>(id)) { (void)flags; }
-    explicit TraceID(int id, unsigned char* flags) :
-        m_data(static_cast<unsigned long long>(id)) { (void)flags; }
-    explicit TraceID(short id, unsigned char* flags) :
-        m_data(static_cast<unsigned long long>(id)) { (void)flags; }
-    explicit TraceID(signed char id, unsigned char* flags) :
-        m_data(static_cast<unsigned long long>(id)) { (void)flags; }
+    TraceID(ForceMangle id, unsigned char* flags) : m_data(id.data())
+    {
+        *flags |= TRACE_EVENT_FLAG_MANGLE_ID;
+    }
+    TraceID(DontMangle id, unsigned char* flags) : m_data(id.data()) { UNUSED_PARAM(flags); }
+    TraceID(unsigned long long id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags); }
+    TraceID(unsigned long id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags); }
+    TraceID(unsigned id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags); }
+    TraceID(unsigned short id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags); }
+    TraceID(unsigned char id, unsigned char* flags) : m_data(id) { UNUSED_PARAM(flags); }
+    TraceID(long long id, unsigned char* flags) :
+        m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); }
+    TraceID(long id, unsigned char* flags) :
+        m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); }
+    TraceID(int id, unsigned char* flags) :
+        m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); }
+    TraceID(short id, unsigned char* flags) :
+        m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); }
+    TraceID(signed char id, unsigned char* flags) :
+        m_data(static_cast<unsigned long long>(id)) { UNUSED_PARAM(flags); }
 
     unsigned long long data() const { return m_data; }
 
@@ -846,6 +884,26 @@
     const char* m_previousState;
 };
 
+template<typename IDType> class TraceScopedTrackableObject {
+    WTF_MAKE_NONCOPYABLE(TraceScopedTrackableObject);
+public:
+    TraceScopedTrackableObject(const char* categoryGroup, const char* name, IDType id)
+        : m_categoryGroup(categoryGroup), m_name(name), m_id(id)
+    {
+        TRACE_EVENT_OBJECT_CREATED_WITH_ID(m_categoryGroup, m_name, m_id);
+    }
+
+    ~TraceScopedTrackableObject()
+    {
+        TRACE_EVENT_OBJECT_DELETED_WITH_ID(m_categoryGroup, m_name, m_id);
+    }
+
+private:
+    const char* m_categoryGroup;
+    const char* m_name;
+    IDType m_id;
+};
+
 } // namespace TraceEvent
 
 } // namespace WebCore
diff --git a/Source/core/platform/graphics/BitmapImage.cpp b/Source/core/platform/graphics/BitmapImage.cpp
index 178f33d..00320fb 100644
--- a/Source/core/platform/graphics/BitmapImage.cpp
+++ b/Source/core/platform/graphics/BitmapImage.cpp
@@ -114,7 +114,7 @@
         m_frames[i].clear(false);
     }
 
-    destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? notFound : m_currentFrame));
+    destroyMetadataAndNotify(m_source.clearCacheExceptFrame(destroyAll ? kNotFound : m_currentFrame));
 }
 
 void BitmapImage::destroyDecodedDataIfNecessary()
diff --git a/Source/core/platform/graphics/FontCache.cpp b/Source/core/platform/graphics/FontCache.cpp
index 2d7403c..52afec6 100644
--- a/Source/core/platform/graphics/FontCache.cpp
+++ b/Source/core/platform/graphics/FontCache.cpp
@@ -134,6 +134,40 @@
 
 static FontPlatformDataCache* gFontPlatformDataCache = 0;
 
+// We currently do not support bitmap fonts on windows (with GDI_FONTS_ON_WINDOWS enabled).
+// Instead of trying to construct a bitmap font and then going down the fallback path map
+// certain common bitmap fonts to their truetype equivalent up front. This also allows the
+// GDI_FONTS_ON_WINDOWS disabled code path to match our current behavior.
+static const AtomicString& alternateFamilyNameAvoidingBitmapFonts(const AtomicString& familyName)
+{
+#if OS(WIN)
+    // On Windows, 'Courier New' (truetype font) is always present and
+    // 'Courier' is a bitmap font. On Mac on the other hand 'Courier' is
+    // a truetype font. Thus pages asking for Courier are better of
+    // using 'Courier New' on windows.
+    DEFINE_STATIC_LOCAL(AtomicString, courier, ("Courier", AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(AtomicString, courierNew, ("Courier New", AtomicString::ConstructFromLiteral));
+    if (equalIgnoringCase(familyName, courier))
+        return courierNew;
+
+    // Alias 'MS Sans Serif' (bitmap font) -> 'Microsoft Sans Serif'
+    // (truetype font).
+    DEFINE_STATIC_LOCAL(AtomicString, msSans, ("MS Sans Serif", AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(AtomicString, microsoftSans, ("Microsoft Sans Serif", AtomicString::ConstructFromLiteral));
+    if (equalIgnoringCase(familyName, msSans))
+        return microsoftSans;
+
+    // Alias 'MS Serif' (bitmap) -> 'Times New Roman' (truetype font).
+    // There's no 'Microsoft Sans Serif-equivalent' for Serif.
+    DEFINE_STATIC_LOCAL(AtomicString, msSerif, ("MS Serif", AtomicString::ConstructFromLiteral));
+    DEFINE_STATIC_LOCAL(AtomicString, timesNewRoman, ("Times New Roman", AtomicString::ConstructFromLiteral));
+    if (equalIgnoringCase(familyName, msSerif))
+        return timesNewRoman;
+#endif
+
+    return emptyAtom;
+}
+
 static const AtomicString& alternateFamilyName(const AtomicString& familyName)
 {
     // Alias Courier <-> Courier New
@@ -165,21 +199,6 @@
     if (equalIgnoringCase(familyName, helvetica))
         return arial;
 
-#if OS(WIN)
-    // On Windows, bitmap fonts are blocked altogether so that we have to
-    // alias MS Sans Serif (bitmap font) -> Microsoft Sans Serif (truetype font)
-    DEFINE_STATIC_LOCAL(AtomicString, msSans, ("MS Sans Serif", AtomicString::ConstructFromLiteral));
-    DEFINE_STATIC_LOCAL(AtomicString, microsoftSans, ("Microsoft Sans Serif", AtomicString::ConstructFromLiteral));
-    if (equalIgnoringCase(familyName, msSans))
-        return microsoftSans;
-
-    // Alias MS Serif (bitmap) -> Times New Roman (truetype font). There's no
-    // 'Microsoft Sans Serif-equivalent' for Serif.
-    DEFINE_STATIC_LOCAL(AtomicString, msSerif, ("MS Serif", AtomicString::ConstructFromLiteral));
-    if (equalIgnoringCase(familyName, msSerif))
-        return timesNewRoman;
-#endif
-
     return emptyAtom;
 }
 
@@ -306,7 +325,14 @@
 
 PassRefPtr<SimpleFontData> FontCache::getFontResourceData(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName, ShouldRetain shouldRetain)
 {
-    FontPlatformData* platformData = getFontResourcePlatformData(fontDescription, family, checkingAlternateName);
+    FontPlatformData* platformData;
+
+    const AtomicString& preferedAlternateName = alternateFamilyNameAvoidingBitmapFonts(family);
+    if (!preferedAlternateName.isEmpty())
+        platformData = getFontResourcePlatformData(fontDescription, preferedAlternateName, checkingAlternateName);
+    else
+        platformData = getFontResourcePlatformData(fontDescription, family, checkingAlternateName);
+
     if (!platformData)
         return 0;
 
diff --git a/Source/core/platform/graphics/GraphicsContext.cpp b/Source/core/platform/graphics/GraphicsContext.cpp
index 7454a1f..e845bbd 100644
--- a/Source/core/platform/graphics/GraphicsContext.cpp
+++ b/Source/core/platform/graphics/GraphicsContext.cpp
@@ -322,6 +322,18 @@
     return m_canvas->getClipBounds(bounds);
 }
 
+bool GraphicsContext::getTransformedClipBounds(FloatRect* bounds) const
+{
+    if (paintingDisabled())
+        return false;
+    SkIRect skIBounds;
+    if (!m_canvas->getClipDeviceBounds(&skIBounds))
+        return false;
+    SkRect skBounds = SkRect::MakeFromIRect(skIBounds);
+    *bounds = FloatRect(skBounds);
+    return true;
+}
+
 const SkMatrix& GraphicsContext::getTotalMatrix() const
 {
     if (paintingDisabled())
@@ -1713,6 +1725,8 @@
 
     if (!SkXfermode::IsMode(m_state->m_xferMode.get(), SkXfermode::kSrcOver_Mode))
         paint->setXfermode(m_state->m_xferMode.get());
+    if (this->drawLuminanceMask())
+        paint->setXfermode(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode));
 
     if (m_state->m_looper)
         paint->setLooper(m_state->m_looper.get());
diff --git a/Source/core/platform/graphics/GraphicsContext.h b/Source/core/platform/graphics/GraphicsContext.h
index b541fa0..28b7088 100644
--- a/Source/core/platform/graphics/GraphicsContext.h
+++ b/Source/core/platform/graphics/GraphicsContext.h
@@ -135,6 +135,7 @@
     int getNormalizedAlpha() const;
 
     bool getClipBounds(SkRect* bounds) const;
+    bool getTransformedClipBounds(FloatRect* bounds) const;
     const SkMatrix& getTotalMatrix() const;
     bool isPrintingDevice() const;
 
@@ -163,6 +164,9 @@
     CompositeOperator compositeOperation() const { return m_state->m_compositeOperator; }
     BlendMode blendModeOperation() const { return m_state->m_blendMode; }
 
+    void setDrawLuminanceMask(bool drawLuminanceMask) { m_state->m_drawLuminanceMask = drawLuminanceMask; }
+    bool drawLuminanceMask() const { return m_state->m_drawLuminanceMask; }
+
     // Change the way document markers are rendered.
     // Any deviceScaleFactor higher than 1.5 is enough to justify setting this flag.
     void setUseHighResMarkers(bool isHighRes) { m_useHighResMarker = isHighRes; }
diff --git a/Source/core/platform/graphics/GraphicsContext3D.cpp b/Source/core/platform/graphics/GraphicsContext3D.cpp
index e01c27e..3d64928 100644
--- a/Source/core/platform/graphics/GraphicsContext3D.cpp
+++ b/Source/core/platform/graphics/GraphicsContext3D.cpp
@@ -669,7 +669,7 @@
 
 DELEGATE_TO_WEBCONTEXT_1(synthesizeGLError, GC3Denum)
 
-Extensions3D* GraphicsContext3D::getExtensions()
+Extensions3D* GraphicsContext3D::extensions()
 {
     if (!m_extensions)
         m_extensions = adoptPtr(new Extensions3D(this));
diff --git a/Source/core/platform/graphics/GraphicsContext3D.h b/Source/core/platform/graphics/GraphicsContext3D.h
index c7a18b0..7e7fe4d 100644
--- a/Source/core/platform/graphics/GraphicsContext3D.h
+++ b/Source/core/platform/graphics/GraphicsContext3D.h
@@ -703,7 +703,7 @@
     // all methods it contains may necessarily be supported on the
     // current hardware. Must call Extensions3D::supports() to
     // determine this.
-    Extensions3D* getExtensions();
+    Extensions3D* extensions();
 
     static unsigned getClearBitsByFormat(GC3Denum);
 
diff --git a/Source/core/platform/graphics/GraphicsContextAnnotation.cpp b/Source/core/platform/graphics/GraphicsContextAnnotation.cpp
index 1ca9824..f64714f 100644
--- a/Source/core/platform/graphics/GraphicsContextAnnotation.cpp
+++ b/Source/core/platform/graphics/GraphicsContextAnnotation.cpp
@@ -72,6 +72,8 @@
         return "TextClip";
     case WebCore::PaintPhaseMask:
         return "Mask";
+    case WebCore::PaintPhaseClippingMask:
+        return "ClippingMask";
     default:
         ASSERT_NOT_REACHED();
         return "<unknown>";
diff --git a/Source/core/platform/graphics/GraphicsContextState.h b/Source/core/platform/graphics/GraphicsContextState.h
index eed9fd5..ea27cb7 100644
--- a/Source/core/platform/graphics/GraphicsContextState.h
+++ b/Source/core/platform/graphics/GraphicsContextState.h
@@ -65,6 +65,7 @@
         , m_shouldAntialias(true)
         , m_shouldSmoothFonts(true)
         , m_shouldClampToSourceRect(true)
+        , m_drawLuminanceMask(false)
     {
     }
 
@@ -85,6 +86,7 @@
         , m_shouldAntialias(other.m_shouldAntialias)
         , m_shouldSmoothFonts(other.m_shouldSmoothFonts)
         , m_shouldClampToSourceRect(other.m_shouldClampToSourceRect)
+        , m_drawLuminanceMask(other.m_drawLuminanceMask)
     {
     }
 
@@ -138,6 +140,7 @@
     bool m_shouldAntialias : 1;
     bool m_shouldSmoothFonts : 1;
     bool m_shouldClampToSourceRect : 1;
+    bool m_drawLuminanceMask : 1;
 };
 
 } // namespace WebCore
diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
index 6bae3b2..464a217 100644
--- a/Source/core/platform/graphics/GraphicsLayer.cpp
+++ b/Source/core/platform/graphics/GraphicsLayer.cpp
@@ -35,7 +35,6 @@
 #include "core/platform/graphics/GraphicsContext.h"
 #include "core/platform/graphics/GraphicsLayerFactory.h"
 #include "core/platform/graphics/LayoutRect.h"
-#include "core/platform/graphics/chromium/AnimationTranslationUtil.h"
 #include "core/platform/graphics/chromium/TransformSkMatrix44Conversions.h"
 #include "core/platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include "core/platform/graphics/skia/NativeImageSkia.h"
@@ -44,9 +43,6 @@
 #include "wtf/CurrentTime.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
-#include "wtf/text/CString.h"
-#include "wtf/text/StringBuilder.h"
-#include "wtf/text/StringHash.h"
 #include "wtf/text/WTFString.h"
 
 #include "public/platform/Platform.h"
@@ -94,10 +90,13 @@
     , m_masksToBounds(false)
     , m_drawsContent(false)
     , m_contentsVisible(true)
+    , m_hasScrollParent(false)
+    , m_hasClipParent(false)
     , m_paintingPhase(GraphicsLayerPaintAllWithOverflowClip)
     , m_contentsOrientation(CompositingCoordinatesTopDown)
     , m_parent(0)
     , m_maskLayer(0)
+    , m_contentsClippingMaskLayer(0)
     , m_replicaLayer(0)
     , m_replicatedLayer(0)
     , m_paintCount(0)
@@ -341,16 +340,6 @@
     m_client->paintContents(this, context, m_paintingPhase, clip);
 }
 
-String GraphicsLayer::animationNameForTransition(AnimatedPropertyID property)
-{
-    // | is not a valid identifier character in CSS, so this can never conflict with a keyframe identifier.
-    StringBuilder id;
-    id.appendLiteral("-|transition");
-    id.appendNumber(static_cast<int>(property));
-    id.append('-');
-    return id.toString();
-}
-
 void GraphicsLayer::setZPosition(float position)
 {
     m_zPosition = position;
@@ -431,6 +420,15 @@
 
     contentsLayer->setPosition(FloatPoint(m_contentsRect.x(), m_contentsRect.y()));
     contentsLayer->setBounds(IntSize(m_contentsRect.width(), m_contentsRect.height()));
+
+    if (m_contentsClippingMaskLayer) {
+        if (m_contentsClippingMaskLayer->size() != m_contentsRect.size()) {
+            m_contentsClippingMaskLayer->setSize(m_contentsRect.size());
+            m_contentsClippingMaskLayer->setNeedsDisplay();
+        }
+        m_contentsClippingMaskLayer->setPosition(FloatPoint());
+        m_contentsClippingMaskLayer->setOffsetFromRenderer(offsetFromRenderer() + IntSize(m_contentsRect.location().x(), m_contentsRect.location().y()));
+    }
 }
 
 static HashSet<int>* s_registeredLayerSet;
@@ -496,6 +494,8 @@
         // Insert the content layer first. Video elements require this, because they have
         // shadow content that must display in front of the video.
         m_layer->layer()->insertChild(m_contentsLayer, 0);
+        WebLayer* borderWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
+        m_contentsLayer->setMaskLayer(borderWebLayer);
     }
 }
 
@@ -704,6 +704,10 @@
             writeIndent(ts, indent + 2);
             ts << "GraphicsLayerPaintMask\n";
         }
+        if (paintingPhase() & GraphicsLayerPaintChildClippingMask) {
+            writeIndent(ts, indent + 2);
+            ts << "GraphicsLayerPaintChildClippingMask\n";
+        }
         if (paintingPhase() & GraphicsLayerPaintOverflowContents) {
             writeIndent(ts, indent + 2);
             ts << "GraphicsLayerPaintOverflowContents\n";
@@ -716,6 +720,17 @@
         ts << ")\n";
     }
 
+    if (flags & LayerTreeIncludesClipAndScrollParents) {
+        if (m_hasScrollParent) {
+            writeIndent(ts, indent + 1);
+            ts << "(hasScrollParent 1)\n";
+        }
+        if (m_hasClipParent) {
+            writeIndent(ts, indent + 1);
+            ts << "(hasClipParent 1)\n";
+        }
+    }
+
     dumpAdditionalProperties(ts, indent, flags);
 
     if (m_children.size()) {
@@ -850,6 +865,18 @@
     updateLayerIsDrawable();
 }
 
+void GraphicsLayer::setClipParent(WebKit::WebLayer* parent)
+{
+    m_hasClipParent = !!parent;
+    m_layer->layer()->setClipParent(parent);
+}
+
+void GraphicsLayer::setScrollParent(WebKit::WebLayer* parent)
+{
+    m_hasScrollParent = !!parent;
+    m_layer->layer()->setScrollParent(parent);
+}
+
 void GraphicsLayer::setBackgroundColor(const Color& color)
 {
     if (color == m_backgroundColor)
@@ -876,6 +903,18 @@
     m_layer->layer()->setMaskLayer(maskWebLayer);
 }
 
+void GraphicsLayer::setContentsClippingMaskLayer(GraphicsLayer* contentsClippingMaskLayer)
+{
+    if (contentsClippingMaskLayer == m_contentsClippingMaskLayer)
+        return;
+
+    m_contentsClippingMaskLayer = contentsClippingMaskLayer;
+    WebLayer* contentsClippingMaskWebLayer = m_contentsClippingMaskLayer ? m_contentsClippingMaskLayer->platformLayer() : 0;
+    if (hasContentsLayer())
+        contentsLayer()->setMaskLayer(contentsClippingMaskWebLayer);
+    updateContentsRect();
+}
+
 void GraphicsLayer::setBackfaceVisibility(bool visible)
 {
     m_backfaceVisibility = visible;
@@ -983,39 +1022,24 @@
     setContentsTo(ContentsLayerForVideo, layer);
 }
 
-bool GraphicsLayer::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const CSSAnimationData* animation, const String& animationName, double timeOffset)
+bool GraphicsLayer::addAnimation(WebAnimation* animation)
 {
+    ASSERT(animation);
     platformLayer()->setAnimationDelegate(this);
 
-    int animationId = 0;
-
-    if (m_animationIdMap.contains(animationName))
-        animationId = m_animationIdMap.get(animationName);
-
-    OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId, timeOffset, boxSize));
-
-    if (toAdd) {
-        animationId = toAdd->id();
-        m_animationIdMap.set(animationName, animationId);
-
-        // Remove any existing animations with the same animation id and target property.
-        platformLayer()->removeAnimation(animationId, toAdd->targetProperty());
-        return platformLayer()->addAnimation(toAdd.get());
-    }
-
-    return false;
+    // Remove any existing animations with the same animation id and target property.
+    platformLayer()->removeAnimation(animation->id(), animation->targetProperty());
+    return platformLayer()->addAnimation(animation);
 }
 
-void GraphicsLayer::pauseAnimation(const String& animationName, double timeOffset)
+void GraphicsLayer::pauseAnimation(int animationId, double timeOffset)
 {
-    if (m_animationIdMap.contains(animationName))
-        platformLayer()->pauseAnimation(m_animationIdMap.get(animationName), timeOffset);
+    platformLayer()->pauseAnimation(animationId, timeOffset);
 }
 
-void GraphicsLayer::removeAnimation(const String& animationName)
+void GraphicsLayer::removeAnimation(int animationId)
 {
-    if (m_animationIdMap.contains(animationName))
-        platformLayer()->removeAnimation(m_animationIdMap.get(animationName));
+    platformLayer()->removeAnimation(animationId);
 }
 
 void GraphicsLayer::suspendAnimations(double wallClockTime)
diff --git a/Source/core/platform/graphics/GraphicsLayer.h b/Source/core/platform/graphics/GraphicsLayer.h
index ddd2609..a2b6629 100644
--- a/Source/core/platform/graphics/GraphicsLayer.h
+++ b/Source/core/platform/graphics/GraphicsLayer.h
@@ -27,8 +27,6 @@
 #ifndef GraphicsLayer_h
 #define GraphicsLayer_h
 
-#include "core/platform/animation/CSSAnimationData.h"
-#include "core/platform/animation/KeyframeValueList.h"
 #include "core/platform/graphics/Color.h"
 #include "core/platform/graphics/FloatPoint.h"
 #include "core/platform/graphics/FloatPoint3D.h"
@@ -39,7 +37,6 @@
 #include "core/platform/graphics/filters/FilterOperations.h"
 #include "core/platform/graphics/transforms/TransformationMatrix.h"
 
-#include "wtf/HashMap.h"
 #include "wtf/OwnPtr.h"
 #include "wtf/PassOwnPtr.h"
 #include "wtf/Vector.h"
@@ -55,6 +52,7 @@
 
 namespace WebKit {
 class GraphicsLayerFactoryChromium;
+class WebAnimation;
 class WebLayer;
 }
 
@@ -127,6 +125,9 @@
     GraphicsLayer* maskLayer() const { return m_maskLayer; }
     void setMaskLayer(GraphicsLayer*);
 
+    GraphicsLayer* contentsClippingMaskLayer() const { return m_contentsClippingMaskLayer; }
+    void setContentsClippingMaskLayer(GraphicsLayer*);
+
     // The given layer will replicate this layer and its children; the replica renders behind this layer.
     void setReplicatedByLayer(GraphicsLayer*);
     // Whether this layer is being replicated by another layer.
@@ -183,6 +184,9 @@
     bool contentsAreVisible() const { return m_contentsVisible; }
     void setContentsVisible(bool);
 
+    void setScrollParent(WebKit::WebLayer*);
+    void setClipParent(WebKit::WebLayer*);
+
     // For special cases, e.g. drawing missing tiles on Android.
     // The compositor should never paint this color in normal cases because the RenderLayer
     // will paint background by itself.
@@ -219,15 +223,12 @@
     IntRect contentsRect() const { return m_contentsRect; }
     void setContentsRect(const IntRect&);
 
-    // Transitions are identified by a special animation name that cannot clash with a keyframe identifier.
-    static String animationNameForTransition(AnimatedPropertyID);
-
     // Return true if the animation is handled by the compositing system. If this returns
     // false, the animation will be run by AnimationController.
     // These methods handle both transitions and keyframe animations.
-    bool addAnimation(const KeyframeValueList&, const IntSize& /*boxSize*/, const CSSAnimationData*, const String& /*animationName*/, double /*timeOffset*/);
-    void pauseAnimation(const String& /*animationName*/, double /*timeOffset*/);
-    void removeAnimation(const String& /*animationName*/);
+    bool addAnimation(WebKit::WebAnimation*);
+    void pauseAnimation(int animationId, double /*timeOffset*/);
+    void removeAnimation(int animationId);
 
     void suspendAnimations(double time);
     void resumeAnimations();
@@ -377,6 +378,9 @@
     bool m_drawsContent : 1;
     bool m_contentsVisible : 1;
 
+    bool m_hasScrollParent : 1;
+    bool m_hasClipParent : 1;
+
     GraphicsLayerPaintingPhase m_paintingPhase;
     CompositingCoordinatesOrientation m_contentsOrientation; // affects orientation of layer contents
 
@@ -384,6 +388,7 @@
     GraphicsLayer* m_parent;
 
     GraphicsLayer* m_maskLayer; // Reference to mask layer. We don't own this.
+    GraphicsLayer* m_contentsClippingMaskLayer; // Reference to clipping mask layer. We don't own this.
 
     GraphicsLayer* m_replicaLayer; // A layer that replicates this layer. We only allow one, for now.
                                    // The replica is not parented; this is the primary reference to it.
@@ -410,9 +415,6 @@
 
     ContentsLayerPurpose m_contentsLayerPurpose;
 
-    typedef HashMap<String, int> AnimationIdMap;
-    AnimationIdMap m_animationIdMap;
-
     ScrollableArea* m_scrollableArea;
     WebKit::WebCompositingReasons m_compositingReasons;
 };
diff --git a/Source/core/platform/graphics/GraphicsLayerClient.h b/Source/core/platform/graphics/GraphicsLayerClient.h
index 88915eb..282cf0c 100644
--- a/Source/core/platform/graphics/GraphicsLayerClient.h
+++ b/Source/core/platform/graphics/GraphicsLayerClient.h
@@ -43,6 +43,7 @@
     GraphicsLayerPaintMask = (1 << 2),
     GraphicsLayerPaintOverflowContents = (1 << 3),
     GraphicsLayerPaintCompositedScroll = (1 << 4),
+    GraphicsLayerPaintChildClippingMask = (1 << 5),
     GraphicsLayerPaintAllWithOverflowClip = (GraphicsLayerPaintBackground | GraphicsLayerPaintForeground | GraphicsLayerPaintMask)
 };
 typedef unsigned GraphicsLayerPaintingPhase;
@@ -52,7 +53,8 @@
     LayerTreeIncludesDebugInfo = 1 << 0, // Dump extra debugging info like layer addresses.
     LayerTreeIncludesRepaintRects = 1 << 1,
     LayerTreeIncludesPaintingPhases = 1 << 2,
-    LayerTreeIncludesRootLayer = 1 << 3
+    LayerTreeIncludesRootLayer = 1 << 3,
+    LayerTreeIncludesClipAndScrollParents = 1 << 4
 };
 typedef unsigned LayerTreeFlags;
 
diff --git a/Source/core/platform/graphics/ImageBuffer.cpp b/Source/core/platform/graphics/ImageBuffer.cpp
index c13ba04..8d40ea9 100644
--- a/Source/core/platform/graphics/ImageBuffer.cpp
+++ b/Source/core/platform/graphics/ImageBuffer.cpp
@@ -221,7 +221,7 @@
     if (!context.makeContextCurrent())
         return false;
 
-    Extensions3D* extensions = context.getExtensions();
+    Extensions3D* extensions = context.extensions();
     if (!extensions->supports("GL_CHROMIUM_copy_texture") || !extensions->supports("GL_CHROMIUM_flipy")
         || !extensions->canUseCopyTextureCHROMIUM(internalFormat, destType, level))
         return false;
diff --git a/Source/core/platform/graphics/ImageSource.h b/Source/core/platform/graphics/ImageSource.h
index 8ff82d1..2a78d71 100644
--- a/Source/core/platform/graphics/ImageSource.h
+++ b/Source/core/platform/graphics/ImageSource.h
@@ -76,7 +76,7 @@
     ~ImageSource();
 
     // Tells the ImageSource that the Image no longer cares about decoded frame
-    // data except for the specified frame. Callers may pass WTF::notFound to
+    // data except for the specified frame. Callers may pass WTF::kNotFound to
     // clear all frames.
     //
     // In response, the ImageSource should delete cached decoded data for other
diff --git a/Source/core/platform/graphics/MediaPlayer.h b/Source/core/platform/graphics/MediaPlayer.h
index 9d36d1a..e84467e 100644
--- a/Source/core/platform/graphics/MediaPlayer.h
+++ b/Source/core/platform/graphics/MediaPlayer.h
@@ -159,11 +159,9 @@
     enum Preload { None, MetaData, Auto };
     virtual void setPreload(Preload) = 0;
 
-#if USE(NATIVE_FULLSCREEN_VIDEO)
-    virtual void enterFullscreen() = 0;
-    virtual void exitFullscreen() = 0;
-    virtual bool canEnterFullscreen() const = 0;
-#endif
+    virtual void showFullscreenOverlay() = 0;
+    virtual void hideFullscreenOverlay() = 0;
+    virtual bool canShowFullscreenOverlay() const = 0;
 
     // whether accelerated rendering is supported by the media engine for the current media.
     virtual bool supportsAcceleratedRendering() const = 0;
diff --git a/Source/core/platform/graphics/SVGGlyph.cpp b/Source/core/platform/graphics/SVGGlyph.cpp
index 9956c21..1acfbb1 100644
--- a/Source/core/platform/graphics/SVGGlyph.cpp
+++ b/Source/core/platform/graphics/SVGGlyph.cpp
@@ -163,7 +163,7 @@
         String languagePrefix;
 
         size_t subCodeSeparator = language.find('-');
-        if (subCodeSeparator != notFound)
+        if (subCodeSeparator != kNotFound)
             languagePrefix = language.left(subCodeSeparator);
 
         Vector<String>::const_iterator it = identifier.languages.begin();
diff --git a/Source/core/platform/graphics/TextRunIterator.h b/Source/core/platform/graphics/TextRunIterator.h
index 123885c..fa044ce 100644
--- a/Source/core/platform/graphics/TextRunIterator.h
+++ b/Source/core/platform/graphics/TextRunIterator.h
@@ -58,6 +58,7 @@
     bool atEnd() const { return !m_textRun || m_offset >= m_textRun->length(); }
     UChar current() const { return (*m_textRun)[m_offset]; }
     WTF::Unicode::Direction direction() const { return atEnd() ? WTF::Unicode::OtherNeutral : WTF::Unicode::direction(current()); }
+    bool atParagraphSeparator() const { return current() == '\n'; }
 
     bool operator==(const TextRunIterator& other)
     {
diff --git a/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp b/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp
index 26873f1..3ef11a0 100644
--- a/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp
+++ b/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp
@@ -70,7 +70,7 @@
     info.fWidth = size.width();
     info.fHeight = size.height();
     info.fColorType = SkImage::kPMColor_ColorType;
-    info.fAlphaType = SkImage::kPremul_AlphaType;
+    info.fAlphaType = kPremul_SkAlphaType;
     return SkSurface::NewRenderTarget(gr, info);
 }
 
diff --git a/Source/core/platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp b/Source/core/platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp
index 48cbd7d..6517b53 100644
--- a/Source/core/platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp
+++ b/Source/core/platform/graphics/chromium/Canvas2DLayerBridgeTest.cpp
@@ -77,13 +77,7 @@
 
         MockCanvasContext& mainMock = *static_cast<MockCanvasContext*>(mainContext->webContext());
 
-        SkImage::Info info = {
-            300,
-            150,
-            SkImage::kPMColor_ColorType,
-            SkImage::kPremul_AlphaType,
-        };
-        SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(SkSurface::NewRaster(info)));
+        SkAutoTUnref<SkDeferredCanvas> canvas(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(300, 150)));
 
         ::testing::Mock::VerifyAndClearExpectations(&mainMock);
 
diff --git a/Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp b/Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp
index 7f45ae9..9eb2670 100644
--- a/Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp
+++ b/Source/core/platform/graphics/chromium/Canvas2DLayerManagerTest.cpp
@@ -91,13 +91,7 @@
 
 static PassOwnPtr<SkDeferredCanvas> createCanvas(GraphicsContext3D* context)
 {
-    SkImage::Info info = {
-        1,
-        1,
-        SkImage::kPMColor_ColorType,
-        SkImage::kPremul_AlphaType,
-    };
-    return adoptPtr(SkDeferredCanvas::Create(SkSurface::NewRaster(info)));
+    return adoptPtr(SkDeferredCanvas::Create(SkSurface::NewRasterPMColor(1, 1)));
 }
 
 FakeCanvas2DLayerBridge* fake(const Canvas2DLayerBridgePtr& layer)
diff --git a/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp b/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp
index eb3c197..1d45560 100644
--- a/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp
+++ b/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp
@@ -212,7 +212,7 @@
     m_orientation = m_actualDecoder->orientation();
     m_filenameExtension = m_actualDecoder->filenameExtension();
     const bool isSingleFrame = m_actualDecoder->repetitionCount() == cAnimationNone || (m_allDataReceived && m_actualDecoder->frameCount() == 1u);
-    m_frameGenerator = ImageFrameGenerator::create(SkISize::Make(m_size.width(), m_size.height()), m_data, m_allDataReceived, !isSingleFrame);
+    m_frameGenerator = ImageFrameGenerator::create(SkISize::Make(m_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height()), m_data, m_allDataReceived, !isSingleFrame);
 }
 
 void DeferredImageDecoder::prepareLazyDecodedFrames()
@@ -249,7 +249,7 @@
 
 SkBitmap DeferredImageDecoder::createLazyDecodingBitmap(size_t index)
 {
-    SkISize fullSize = SkISize::Make(m_actualDecoder->size().width(), m_actualDecoder->size().height());
+    SkISize fullSize = SkISize::Make(m_actualDecoder->decodedSize().width(), m_actualDecoder->decodedSize().height());
     ASSERT(!fullSize.isEmpty());
 
     SkIRect fullRect = SkIRect::MakeSize(fullSize);
diff --git a/Source/core/platform/graphics/chromium/DeferredImageDecoder.h b/Source/core/platform/graphics/chromium/DeferredImageDecoder.h
index 390a364..9f3d40e 100644
--- a/Source/core/platform/graphics/chromium/DeferredImageDecoder.h
+++ b/Source/core/platform/graphics/chromium/DeferredImageDecoder.h
@@ -71,6 +71,9 @@
     ImageOrientation orientation() const;
     bool hotSpot(IntPoint&) const;
 
+    // For testing.
+    ImageFrameGenerator* frameGenerator() { return m_frameGenerator.get(); }
+
 private:
     explicit DeferredImageDecoder(PassOwnPtr<ImageDecoder> actualDecoder);
     void prepareLazyDecodedFrames();
diff --git a/Source/core/platform/graphics/chromium/DeferredImageDecoderTest.cpp b/Source/core/platform/graphics/chromium/DeferredImageDecoderTest.cpp
index b981b79..8dd3939 100644
--- a/Source/core/platform/graphics/chromium/DeferredImageDecoderTest.cpp
+++ b/Source/core/platform/graphics/chromium/DeferredImageDecoderTest.cpp
@@ -70,7 +70,7 @@
 
 class DeferredImageDecoderTest : public ::testing::Test, public MockImageDecoderClient {
 public:
-    virtual void SetUp()
+    virtual void SetUp() OVERRIDE
     {
         ImageDecodingStore::initializeOnce();
         DeferredImageDecoder::setEnabled(true);
@@ -85,44 +85,51 @@
         m_repetitionCount = cAnimationNone;
         m_status = ImageFrame::FrameComplete;
         m_frameDuration = 0;
+        m_decodedSize = m_actualDecoder->size();
     }
 
-    virtual void TearDown()
+    virtual void TearDown() OVERRIDE
     {
         ImageDecodingStore::shutdown();
     }
 
-    virtual void decoderBeingDestroyed()
+    virtual void decoderBeingDestroyed() OVERRIDE
     {
         m_actualDecoder = 0;
     }
 
-    virtual void frameBufferRequested()
+    virtual void frameBufferRequested() OVERRIDE
     {
         ++m_frameBufferRequestCount;
     }
 
-    virtual size_t frameCount()
+    virtual size_t frameCount() OVERRIDE
     {
         return m_frameCount;
     }
 
-    virtual int repetitionCount() const
+    virtual int repetitionCount() const OVERRIDE
     {
         return m_repetitionCount;
     }
 
-    virtual ImageFrame::Status status()
+    virtual ImageFrame::Status status() OVERRIDE
     {
         return m_status;
     }
 
-    virtual float frameDuration() const
+    virtual float frameDuration() const OVERRIDE
     {
         return m_frameDuration;
     }
 
+    virtual IntSize decodedSize() const OVERRIDE
+    {
+        return m_decodedSize;
+    }
+
 protected:
+
     // Don't own this but saves the pointer to query states.
     MockImageDecoder* m_actualDecoder;
     OwnPtr<DeferredImageDecoder> m_lazyDecoder;
@@ -134,6 +141,7 @@
     int m_repetitionCount;
     ImageFrame::Status m_status;
     float m_frameDuration;
+    IntSize m_decodedSize;
 };
 
 TEST_F(DeferredImageDecoderTest, drawIntoSkPicture)
@@ -285,4 +293,25 @@
     EXPECT_EQ(10, m_lazyDecoder->repetitionCount());
 }
 
+TEST_F(DeferredImageDecoderTest, decodedSize)
+{
+    m_decodedSize = IntSize(22, 33);
+    m_lazyDecoder->setData(m_data.get(), true);
+    RefPtr<NativeImageSkia> image = m_lazyDecoder->frameBufferAtIndex(0)->asNewNativeImage();
+    EXPECT_EQ(m_decodedSize.width(), image->bitmap().width());
+    EXPECT_EQ(m_decodedSize.height(), image->bitmap().height());
+    EXPECT_FALSE(image->bitmap().isNull());
+    EXPECT_TRUE(image->bitmap().isImmutable());
+
+    m_lazyDecoder->frameGenerator()->setImageDecoderFactoryForTesting(MockImageDecoderFactory::create(this, m_decodedSize));
+
+    // The following code should not fail any assert.
+    SkCanvas* tempCanvas = m_picture.beginRecording(100, 100);
+    tempCanvas->drawBitmap(image->bitmap(), 0, 0);
+    m_picture.endRecording();
+    EXPECT_EQ(0, m_frameBufferRequestCount);
+    m_canvas->drawPicture(m_picture);
+    EXPECT_EQ(1, m_frameBufferRequestCount);
+}
+
 } // namespace
diff --git a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
index 79d8283..2cf212a 100644
--- a/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
+++ b/Source/core/platform/graphics/chromium/FontCacheAndroid.cpp
@@ -31,72 +31,14 @@
 #include "config.h"
 #include "core/platform/graphics/FontCache.h"
 
-#include "core/platform/NotImplemented.h"
 #include "core/platform/graphics/Font.h"
 #include "core/platform/graphics/FontDescription.h"
-#include "core/platform/graphics/FontPlatformData.h"
 #include "core/platform/graphics/SimpleFontData.h"
 
-#include "SkPaint.h"
 #include "SkTypeface_android.h"
-#include "SkUtils.h"
-
-#include <unicode/locid.h>
-#include "wtf/Assertions.h"
-#include "wtf/text/AtomicString.h"
-#include "wtf/text/CString.h"
 
 namespace WebCore {
 
-static const char* getFallbackFontName(const FontDescription& fontDescription)
-{
-    switch (fontDescription.genericFamily()) {
-    case FontDescription::StandardFamily:
-    case FontDescription::SerifFamily:
-        return "serif";
-    case FontDescription::SansSerifFamily:
-        return "sans-serif";
-    case FontDescription::MonospaceFamily:
-        return "monospace";
-    case FontDescription::CursiveFamily:
-        return "cursive";
-    case FontDescription::FantasyFamily:
-        return "fantasy";
-    case FontDescription::NoFamily:
-    default:
-        return "";
-    }
-}
-
-static bool isFallbackFamily(String family)
-{
-    return family.startsWith("-webkit-")
-        || equalIgnoringCase(family, "serif")
-        || equalIgnoringCase(family, "sans-serif")
-        || equalIgnoringCase(family, "sans")
-        || equalIgnoringCase(family, "monospace")
-        || equalIgnoringCase(family, "cursive")
-        || equalIgnoringCase(family, "fantasy")
-        || equalIgnoringCase(family, "times") // Skia aliases for serif
-        || equalIgnoringCase(family, "times new roman")
-        || equalIgnoringCase(family, "palatino")
-        || equalIgnoringCase(family, "georgia")
-        || equalIgnoringCase(family, "baskerville")
-        || equalIgnoringCase(family, "goudy")
-        || equalIgnoringCase(family, "ITC Stone Serif")
-        || equalIgnoringCase(family, "arial") // Skia aliases for sans-serif
-        || equalIgnoringCase(family, "helvetica")
-        || equalIgnoringCase(family, "tahoma")
-        || equalIgnoringCase(family, "verdana")
-        || equalIgnoringCase(family, "courier") // Skia aliases for monospace
-        || equalIgnoringCase(family, "courier new")
-        || equalIgnoringCase(family, "monaco");
-}
-
-void FontCache::platformInit()
-{
-}
-
 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c)
 {
     SkString skiaFamilyName;
@@ -105,72 +47,4 @@
     return getFontResourceData(getFontResourcePlatformData(font.fontDescription(), AtomicString(skiaFamilyName.c_str()), DoNotRetain), DoNotRetain);
 }
 
-PassRefPtr<SimpleFontData> FontCache::getSimilarFontPlatformData(const Font& font)
-{
-    return 0;
-}
-
-PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain shouldRetain)
-{
-    const FontPlatformData* fontPlatformData = getFallbackFontData(description);
-    ASSERT(fontPlatformData);
-    return getFontResourceData(fontPlatformData, shouldRetain);
-}
-
-void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
-{
-    notImplemented();
-}
-
-FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
-{
-    const char* name = 0;
-    CString nameString; // Keeps name valid within scope of this function in case that name is from a family.
-
-    // If a fallback font is being created (e.g. "-webkit-monospace"), convert
-    // it in to the fallback name (e.g. "monospace").
-    if (!family.length() || family.startsWith("-webkit-"))
-        name = getFallbackFontName(fontDescription);
-    else {
-        nameString = family.string().utf8();
-        name = nameString.data();
-    }
-
-    int style = SkTypeface::kNormal;
-    if (fontDescription.weight() >= FontWeightBold)
-        style |= SkTypeface::kBold;
-    if (fontDescription.italic())
-        style |= SkTypeface::kItalic;
-
-    SkTypeface* typeface = 0;
-    FontPlatformData* result = 0;
-    typeface = SkTypeface::CreateFromName(name, SkTypeface::kNormal);
-
-    // CreateFromName always returns a typeface, falling back to a default font
-    // if the one requested could not be found. Calling Equal() with a null
-    // pointer will compare the returned font against the default, with the
-    // caveat that the default is always of normal style. When that happens,
-    // ignore the default font and allow WebCore to provide the next font on the
-    // CSS fallback list. The only exception to this occurs when the family name
-    // is a commonly used generic family, which is the case when called by
-    // getSimilarFontPlatformData() or getLastResortFallbackFont(). In that case
-    // the default font is an acceptable result.
-
-    if (!SkTypeface::Equal(typeface, 0) || isFallbackFamily(family.string())) {
-        // We had to use normal styling to see if this was a default font. If
-        // we need bold or italic, replace with the corrected typeface.
-        if (style != SkTypeface::kNormal) {
-            typeface->unref();
-            typeface = SkTypeface::CreateFromName(name, static_cast<SkTypeface::Style>(style));
-        }
-        result = new FontPlatformData(typeface, name, fontDescription.computedSize(),
-                                      (style & SkTypeface::kBold) && !typeface->isBold(),
-                                      (style & SkTypeface::kItalic) && !typeface->isItalic(),
-                                      fontDescription.orientation());
-    }
-
-    SkSafeUnref(typeface);
-    return result;
-}
-
 } // namespace WebCore
diff --git a/Source/core/platform/graphics/chromium/ImageDecodingStore.h b/Source/core/platform/graphics/chromium/ImageDecodingStore.h
index 45d1fb0..9e0d25e 100644
--- a/Source/core/platform/graphics/chromium/ImageDecodingStore.h
+++ b/Source/core/platform/graphics/chromium/ImageDecodingStore.h
@@ -219,7 +219,7 @@
         DecoderCacheEntry(const ImageFrameGenerator* generator, int count, PassOwnPtr<ImageDecoder> decoder, bool isDiscardable)
             : CacheEntry(generator, count, isDiscardable)
             , m_cachedDecoder(decoder)
-            , m_size(SkISize::Make(m_cachedDecoder->size().width(), m_cachedDecoder->size().height()))
+            , m_size(SkISize::Make(m_cachedDecoder->decodedSize().width(), m_cachedDecoder->decodedSize().height()))
         {
         }
 
@@ -232,7 +232,7 @@
         }
         static DecoderCacheKey makeCacheKey(const ImageFrameGenerator* generator, const ImageDecoder* decoder)
         {
-            return std::make_pair(generator, SkISize::Make(decoder->size().width(), decoder->size().height()));
+            return std::make_pair(generator, SkISize::Make(decoder->decodedSize().width(), decoder->decodedSize().height()));
         }
         DecoderCacheKey cacheKey() const { return makeCacheKey(m_generator, m_size); }
         ImageDecoder* cachedDecoder() const { return m_cachedDecoder.get(); }
diff --git a/Source/core/platform/graphics/chromium/ImageFrameGenerator.cpp b/Source/core/platform/graphics/chromium/ImageFrameGenerator.cpp
index c1265af..802cf37 100644
--- a/Source/core/platform/graphics/chromium/ImageFrameGenerator.cpp
+++ b/Source/core/platform/graphics/chromium/ImageFrameGenerator.cpp
@@ -201,12 +201,13 @@
 
     // Try to create an ImageDecoder if we are not given one.
     if (!*decoder) {
-        *decoder = ImageDecoder::create(*data, ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied).leakPtr();
-
-        if (!*decoder && m_imageDecoderFactory)
+        if (m_imageDecoderFactory)
             *decoder = m_imageDecoderFactory->create().leakPtr();
 
         if (!*decoder)
+            *decoder = ImageDecoder::create(*data, ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied).leakPtr();
+
+        if (!*decoder)
             return nullptr;
     }
 
diff --git a/Source/core/platform/graphics/chromium/ImageFrameGenerator.h b/Source/core/platform/graphics/chromium/ImageFrameGenerator.h
index b3252e0..47b5c86 100644
--- a/Source/core/platform/graphics/chromium/ImageFrameGenerator.h
+++ b/Source/core/platform/graphics/chromium/ImageFrameGenerator.h
@@ -72,6 +72,7 @@
 
     bool isMultiFrame() const { return m_isMultiFrame; }
 
+    // |factory| will overwrite the default ImageDecoder creation logic if |factory->create()| returns non-zero.
     void setImageDecoderFactoryForTesting(PassOwnPtr<ImageDecoderFactory> factory) { m_imageDecoderFactory = factory; }
 
     // FIXME: Return alpha state for each frame.
diff --git a/Source/core/platform/graphics/chromium/ImageFrameGeneratorTest.cpp b/Source/core/platform/graphics/chromium/ImageFrameGeneratorTest.cpp
index b4c8ff4..66ad11a 100644
--- a/Source/core/platform/graphics/chromium/ImageFrameGeneratorTest.cpp
+++ b/Source/core/platform/graphics/chromium/ImageFrameGeneratorTest.cpp
@@ -44,62 +44,44 @@
 
 class ImageFrameGeneratorTest;
 
-class MockImageDecoderFactory : public ImageDecoderFactory {
-public:
-    static PassOwnPtr<MockImageDecoderFactory> create(ImageFrameGeneratorTest* test)
-    {
-        return adoptPtr(new MockImageDecoderFactory(test));
-    }
-
-    virtual PassOwnPtr<ImageDecoder> create();
-
-private:
-    MockImageDecoderFactory(ImageFrameGeneratorTest* test)
-        : m_test(test)
-    {
-    }
-
-    ImageFrameGeneratorTest* m_test;
-};
-
 class ImageFrameGeneratorTest : public ::testing::Test, public MockImageDecoderClient {
 public:
-    virtual void SetUp()
+    virtual void SetUp() OVERRIDE
     {
         ImageDecodingStore::initializeOnce();
         m_data = SharedBuffer::create();
         m_generator = ImageFrameGenerator::create(fullSize(), m_data, true);
-        m_generator->setImageDecoderFactoryForTesting(MockImageDecoderFactory::create(this));
+        m_generator->setImageDecoderFactoryForTesting(MockImageDecoderFactory::create(this, fullSize()));
         m_decodersDestroyed = 0;
         m_frameBufferRequestCount = 0;
         m_status = ImageFrame::FrameEmpty;
     }
 
-    virtual void TearDown()
+    virtual void TearDown() OVERRIDE
     {
         ImageDecodingStore::shutdown();
     }
 
-    virtual void decoderBeingDestroyed()
+    virtual void decoderBeingDestroyed() OVERRIDE
     {
         ++m_decodersDestroyed;
     }
 
-    virtual void frameBufferRequested()
+    virtual void frameBufferRequested() OVERRIDE
     {
         ++m_frameBufferRequestCount;
     }
 
-    virtual ImageFrame::Status status()
+    virtual ImageFrame::Status status() OVERRIDE
     {
         ImageFrame::Status currentStatus = m_status;
         m_status = m_nextFrameStatus;
         return currentStatus;
     }
 
-    virtual size_t frameCount() { return 1; }
-    virtual int repetitionCount() const { return cAnimationNone; }
-    virtual float frameDuration() const { return 0; }
+    virtual size_t frameCount() OVERRIDE { return 1; }
+    virtual int repetitionCount() const OVERRIDE { return cAnimationNone; }
+    virtual float frameDuration() const OVERRIDE { return 0; }
 
 protected:
     PassOwnPtr<ScaledImageFragment> createCompleteImage(const SkISize& size)
@@ -127,14 +109,6 @@
     ImageFrame::Status m_nextFrameStatus;
 };
 
-PassOwnPtr<ImageDecoder> MockImageDecoderFactory::create()
-{
-    OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(m_test);
-    decoder->setSize(fullSize().width(), fullSize().height());
-    decoder->setFrameHasAlpha(false);
-    return decoder.release();
-}
-
 TEST_F(ImageFrameGeneratorTest, cacheHit)
 {
     const ScaledImageFragment* fullImage = ImageDecodingStore::instance()->insertAndLockCache(
@@ -399,7 +373,7 @@
 TEST_F(ImageFrameGeneratorTest, resumeDecodeEmptyFrameTurnsComplete)
 {
     m_generator = ImageFrameGenerator::create(fullSize(), m_data, false, true);
-    m_generator->setImageDecoderFactoryForTesting(MockImageDecoderFactory::create(this));
+    m_generator->setImageDecoderFactoryForTesting(MockImageDecoderFactory::create(this, fullSize()));
     setFrameStatus(ImageFrame::FrameComplete);
 
     const ScaledImageFragment* tempImage = m_generator->decodeAndScale(fullSize(), 0);
diff --git a/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp b/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp
index 88fc7a5..5bcf14e 100644
--- a/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp
+++ b/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.cpp
@@ -39,6 +39,7 @@
     , m_scaledSize(scaledSize)
     , m_scaledSubset(scaledSubset)
     , m_lockedImageResource(0)
+    , m_objectTracker(this)
 {
 }
 
diff --git a/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.h b/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.h
index 0ceb7da..48d8015 100644
--- a/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.h
+++ b/Source/core/platform/graphics/chromium/LazyDecodingPixelRef.h
@@ -31,6 +31,7 @@
 #include "SkRect.h"
 #include "SkSize.h"
 #include "SkTypes.h"
+#include "core/platform/PlatformInstrumentation.h"
 #include "skia/ext/lazy_pixel_ref.h"
 
 #include "wtf/RefPtr.h"
@@ -77,6 +78,7 @@
     SkIRect m_scaledSubset;
 
     const ScaledImageFragment* m_lockedImageResource;
+    PlatformInstrumentation::LazyPixelRefTracker m_objectTracker;
 };
 
 } // namespace WebCore
diff --git a/Source/core/platform/graphics/chromium/test/MockImageDecoder.h b/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
index 7089f5f..8efdd29 100644
--- a/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
+++ b/Source/core/platform/graphics/chromium/test/MockImageDecoder.h
@@ -25,6 +25,7 @@
 
 #ifndef MockImageDecoder_h
 
+#include "core/platform/graphics/chromium/ImageFrameGenerator.h"
 #include "core/platform/image-decoders/ImageDecoder.h"
 #include "wtf/PassOwnPtr.h"
 
@@ -38,6 +39,13 @@
     virtual size_t frameCount() = 0;
     virtual int repetitionCount() const = 0;
     virtual float frameDuration() const = 0;
+
+    // Clients can control the behavior of MockImageDecoder::decodedSize() by
+    // overriding this method. The default implementation causes
+    // MockImageDecoder::decodedSize() to return the same thing as
+    // MockImageDecoder::size(). See the precise implementation of
+    // MockImageDecoder::decodedSize() below.
+    virtual IntSize decodedSize() const { return IntSize(); }
 };
 
 class MockImageDecoder : public ImageDecoder {
@@ -45,7 +53,7 @@
     static PassOwnPtr<MockImageDecoder> create(MockImageDecoderClient* client) { return adoptPtr(new MockImageDecoder(client)); }
 
     MockImageDecoder(MockImageDecoderClient* client)
-        : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied, IntSize())
+        : ImageDecoder(ImageSource::AlphaPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
         , m_client(client)
     { }
 
@@ -54,7 +62,12 @@
         m_client->decoderBeingDestroyed();
     }
 
-    virtual bool setSize(unsigned width, unsigned height)
+    virtual IntSize decodedSize() const OVERRIDE
+    {
+        return m_client->decodedSize().isEmpty() ? size() : m_client->decodedSize();
+    }
+
+    virtual bool setSize(unsigned width, unsigned height) OVERRIDE
     {
         ImageDecoder::setSize(width, height);
         m_frameBufferCache.resize(1);
@@ -62,24 +75,22 @@
         return true;
     }
 
-    virtual void setFrameHasAlpha(bool hasAlpha) { m_frameBufferCache[0].setHasAlpha(hasAlpha); }
-
-    virtual String filenameExtension() const
+    virtual String filenameExtension() const OVERRIDE
     {
         return "mock";
     }
 
-    virtual size_t frameCount()
+    virtual size_t frameCount() OVERRIDE
     {
         return m_client->frameCount();
     }
 
-    virtual int repetitionCount() const
+    virtual int repetitionCount() const OVERRIDE
     {
         return m_client->repetitionCount();
     }
 
-    virtual ImageFrame* frameBufferAtIndex(size_t)
+    virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE
     {
         m_client->frameBufferRequested();
 
@@ -87,20 +98,53 @@
         return &m_frameBufferCache[0];
     }
 
-    virtual bool frameIsCompleteAtIndex(size_t) const
+    virtual bool frameIsCompleteAtIndex(size_t) const OVERRIDE
     {
         return m_client->status() == ImageFrame::FrameComplete;
     }
 
-    virtual float frameDurationAtIndex(size_t) const
+    virtual float frameDurationAtIndex(size_t) const OVERRIDE
     {
         return m_client->frameDuration();
     }
 
+    void setFrameHasAlpha(bool hasAlpha) { m_frameBufferCache[0].setHasAlpha(hasAlpha); }
+
 private:
     MockImageDecoderClient* m_client;
 };
 
+class MockImageDecoderFactory : public ImageDecoderFactory {
+public:
+    static PassOwnPtr<MockImageDecoderFactory> create(MockImageDecoderClient* client, const SkISize& decodedSize)
+    {
+        return adoptPtr(new MockImageDecoderFactory(client, IntSize(decodedSize.width(), decodedSize.height())));
+    }
+
+    static PassOwnPtr<MockImageDecoderFactory> create(MockImageDecoderClient* client, const IntSize& decodedSize)
+    {
+        return adoptPtr(new MockImageDecoderFactory(client, decodedSize));
+    }
+
+    virtual PassOwnPtr<ImageDecoder> create() OVERRIDE
+    {
+        OwnPtr<MockImageDecoder> decoder = MockImageDecoder::create(m_client);
+        decoder->setSize(m_decodedSize.width(), m_decodedSize.height());
+        decoder->setFrameHasAlpha(false);
+        return decoder.release();
+    }
+
+private:
+    MockImageDecoderFactory(MockImageDecoderClient* client, const IntSize& decodedSize)
+        : m_client(client)
+        , m_decodedSize(decodedSize)
+    {
+    }
+
+    MockImageDecoderClient* m_client;
+    IntSize m_decodedSize;
+};
+
 } // namespace WebCore
 
 #endif // MockImageDecoder_h
diff --git a/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp b/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp
index 8cd3610..23f68e1 100644
--- a/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp
+++ b/Source/core/platform/graphics/filters/custom/FECustomFilter.cpp
@@ -227,7 +227,7 @@
     ASSERT(!m_triedMultisampleBuffer);
     m_triedMultisampleBuffer = true;
 
-    Extensions3D* extensions = m_context->getExtensions();
+    Extensions3D* extensions = m_context->extensions();
     if (!extensions
         || !extensions->supports("GL_ANGLE_framebuffer_multisample")
         || !extensions->supports("GL_ANGLE_framebuffer_blit")
@@ -254,8 +254,8 @@
     m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, m_multisampleFrameBuffer);
     m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, m_frameBuffer);
 
-    ASSERT(m_context->getExtensions());
-    m_context->getExtensions()->blitFramebuffer(0, 0, m_contextSize.width(), m_contextSize.height(), 0, 0, m_contextSize.width(), m_contextSize.height(), GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
+    ASSERT(m_context->extensions());
+    m_context->extensions()->blitFramebuffer(0, 0, m_contextSize.width(), m_contextSize.height(), 0, 0, m_contextSize.width(), m_contextSize.height(), GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
 
     m_context->bindFramebuffer(Extensions3D::READ_FRAMEBUFFER, 0);
     m_context->bindFramebuffer(Extensions3D::DRAW_FRAMEBUFFER, 0);
@@ -285,7 +285,7 @@
         return false;
     }
 
-    Extensions3D* extensions = m_context->getExtensions();
+    Extensions3D* extensions = m_context->extensions();
     ASSERT(extensions);
 
     m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFrameBuffer);
diff --git a/Source/core/platform/graphics/gpu/DrawingBuffer.cpp b/Source/core/platform/graphics/gpu/DrawingBuffer.cpp
index feb0fea..8155797 100644
--- a/Source/core/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/core/platform/graphics/gpu/DrawingBuffer.cpp
@@ -80,7 +80,7 @@
 
 PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, const IntSize& size, PreserveDrawingBuffer preserve, PassRefPtr<ContextEvictionManager> contextEvictionManager)
 {
-    Extensions3D* extensions = context->getExtensions();
+    Extensions3D* extensions = context->extensions();
     bool multisampleSupported = extensions->supports("GL_ANGLE_framebuffer_blit")
         && extensions->supports("GL_ANGLE_framebuffer_multisample")
         && extensions->supports("GL_OES_rgb8_rgba8");
@@ -170,7 +170,7 @@
     ScopedTextureUnit0BindingRestorer restorer(m_context.get(), m_activeTextureUnit, m_texture2DBinding);
 
     // First try to recycle an old buffer.
-    RefPtr<MailboxInfo> nextFrontColorBuffer = getRecycledMailbox();
+    RefPtr<MailboxInfo> nextFrontColorBuffer = recycledMailbox();
 
     // No buffer available to recycle, create a new one.
     if (!nextFrontColorBuffer) {
@@ -192,7 +192,7 @@
         m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_fbo);
         m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0);
     } else {
-        Extensions3D* extensions = m_context->getExtensions();
+        Extensions3D* extensions = m_context->extensions();
         extensions->copyTextureCHROMIUM(GraphicsContext3D::TEXTURE_2D, m_colorBuffer, nextFrontColorBuffer->textureId, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE);
     }
 
@@ -226,7 +226,7 @@
      ASSERT_NOT_REACHED();
 }
 
-PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::getRecycledMailbox()
+PassRefPtr<DrawingBuffer::MailboxInfo> DrawingBuffer::recycledMailbox()
 {
     if (!m_context || m_recycledMailboxes.isEmpty())
         return PassRefPtr<MailboxInfo>();
@@ -316,10 +316,10 @@
 
 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer)
 {
-    if (!m_context || !m_context->makeContextCurrent() || m_context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
+    if (!m_context || !m_context->makeContextCurrent() || m_context->extensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
         return;
 
-    Extensions3D* extensions = m_context->getExtensions();
+    Extensions3D* extensions = m_context->extensions();
     // Since the m_frontColorBuffer was produced and sent to the compositor, it cannot be bound to an fbo.
     // We have to make a copy of it here and bind that copy instead.
     // FIXME: That's not true any more, provided we don't change texture
@@ -469,7 +469,7 @@
         m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO);
 
         m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer);
-        m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, m_internalRenderbufferFormat, size.width(), size.height());
+        m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, m_internalRenderbufferFormat, size.width(), size.height());
 
         if (m_context->getError() == GraphicsContext3D::OUT_OF_MEMORY)
             return false;
@@ -490,7 +490,7 @@
             m_depthStencilBuffer = m_context->createRenderbuffer();
         m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
         if (multisample())
-            m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, Extensions3D::DEPTH24_STENCIL8, size.width(), size.height());
+            m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, Extensions3D::DEPTH24_STENCIL8, size.width(), size.height());
         else
             m_context->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, Extensions3D::DEPTH24_STENCIL8, size.width(), size.height());
         m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer);
@@ -501,7 +501,7 @@
                 m_depthBuffer = m_context->createRenderbuffer();
             m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
             if (multisample())
-                m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::DEPTH_COMPONENT16, size.width(), size.height());
+                m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::DEPTH_COMPONENT16, size.width(), size.height());
             else
                 m_context->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::DEPTH_COMPONENT16, size.width(), size.height());
             m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthBuffer);
@@ -511,7 +511,7 @@
                 m_stencilBuffer = m_context->createRenderbuffer();
             m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
             if (multisample())
-                m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::STENCIL_INDEX8, size.width(), size.height());
+                m_context->extensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, GraphicsContext3D::STENCIL_INDEX8, size.width(), size.height());
             else
                 m_context->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::STENCIL_INDEX8, size.width(), size.height());
             m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);
@@ -670,7 +670,7 @@
             m_context->disable(GraphicsContext3D::SCISSOR_TEST);
 
         // Use NEAREST, because there is no scale performed during the blit.
-        m_context->getExtensions()->blitFramebuffer(x, y, width, height, x, y, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
+        m_context->extensions()->blitFramebuffer(x, y, width, height, x, y, width, height, GraphicsContext3D::COLOR_BUFFER_BIT, GraphicsContext3D::NEAREST);
 
         if (m_scissorEnabled)
             m_context->enable(GraphicsContext3D::SCISSOR_TEST);
diff --git a/Source/core/platform/graphics/gpu/DrawingBuffer.h b/Source/core/platform/graphics/gpu/DrawingBuffer.h
index 1ec9c6a..a6f11d8 100644
--- a/Source/core/platform/graphics/gpu/DrawingBuffer.h
+++ b/Source/core/platform/graphics/gpu/DrawingBuffer.h
@@ -149,7 +149,7 @@
 
     void clearPlatformLayer();
 
-    PassRefPtr<MailboxInfo> getRecycledMailbox();
+    PassRefPtr<MailboxInfo> recycledMailbox();
     PassRefPtr<MailboxInfo> createNewMailbox(unsigned);
 
     // Updates the current size of the buffer, ensuring that s_currentResourceUsePixels is updated.
diff --git a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp b/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp
index f8fe903..11af84b 100644
--- a/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp
+++ b/Source/core/platform/graphics/gpu/SharedGraphicsContext3D.cpp
@@ -68,7 +68,7 @@
         }
 
         if (m_context && wasCreated)
-            m_context->getExtensions()->pushGroupMarkerEXT("SharedGraphicsContext");
+            m_context->extensions()->pushGroupMarkerEXT("SharedGraphicsContext");
         return m_context;
     }
 
diff --git a/Source/core/platform/graphics/skia/FontCacheSkia.cpp b/Source/core/platform/graphics/skia/FontCacheSkia.cpp
index da1cc8e..958b60d 100644
--- a/Source/core/platform/graphics/skia/FontCacheSkia.cpp
+++ b/Source/core/platform/graphics/skia/FontCacheSkia.cpp
@@ -48,7 +48,7 @@
 {
 }
 
-#if !OS(WIN)
+#if !OS(WIN) && !OS(ANDROID)
 PassRefPtr<SimpleFontData> FontCache::getFontDataForCharacter(const Font& font, UChar32 c)
 {
     icu::Locale locale = icu::Locale::getDefault();
@@ -86,7 +86,7 @@
     return getFontResourceData(&platformData, DoNotRetain);
 }
 
-#endif // !OS(WINDOWNS)
+#endif // !OS(WINDOWNS) && !OS(ANDROID)
 
 PassRefPtr<SimpleFontData> FontCache::getSimilarFontPlatformData(const Font& font)
 {
diff --git a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
index 4462607..35cb920 100644
--- a/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
+++ b/Source/core/platform/graphics/skia/FontCacheSkiaWin.cpp
@@ -157,6 +157,11 @@
     return 0;
 }
 
+static inline bool equalIgnoringCase(const AtomicString& a, const SkString& b)
+{
+    return equalIgnoringCase(a, AtomicString::fromUTF8(b.c_str()));
+}
+
 static bool typefacesMatchesFamily(const SkTypeface* tf, const AtomicString& family)
 {
     SkTypeface::LocalizedStrings* actualFamilies = tf->createFamilyNameIterator();
@@ -164,13 +169,23 @@
     SkTypeface::LocalizedString actualFamily;
 
     while (actualFamilies->next(&actualFamily)) {
-        if (equalIgnoringCase(family, AtomicString::fromUTF8(actualFamily.fString.c_str()))) {
+        if (equalIgnoringCase(family, actualFamily.fString)) {
             matchesRequestedFamily = true;
             break;
         }
     }
     actualFamilies->unref();
 
+    // getFamilyName may return a name not returned by the createFamilyNameIterator.
+    // Specifically in cases where Windows substitutes the font based on the
+    // HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes registry entries.
+    if (!matchesRequestedFamily) {
+        SkString familyName;
+        tf->getFamilyName(&familyName);
+        if (equalIgnoringCase(family, familyName))
+            matchesRequestedFamily = true;
+    }
+
     return matchesRequestedFamily;
 }
 
diff --git a/Source/core/platform/graphics/skia/NativeImageSkia.cpp b/Source/core/platform/graphics/skia/NativeImageSkia.cpp
index f43c483..279fbed 100644
--- a/Source/core/platform/graphics/skia/NativeImageSkia.cpp
+++ b/Source/core/platform/graphics/skia/NativeImageSkia.cpp
@@ -45,6 +45,7 @@
 #include "third_party/skia/include/core/SkPaint.h"
 #include "third_party/skia/include/core/SkScalar.h"
 #include "third_party/skia/include/core/SkShader.h"
+#include "third_party/skia/include/effects/SkLumaXfermode.h"
 
 #include <limits>
 #include <math.h>
@@ -324,7 +325,11 @@
 {
     TRACE_EVENT0("skia", "NativeImageSkia::draw");
     SkPaint paint;
-    paint.setXfermode(compOp.get());
+    if (context->drawLuminanceMask()) {
+        paint.setXfermode(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode));
+    } else {
+        paint.setXfermode(compOp.get());
+    }
     paint.setAlpha(context->getNormalizedAlpha());
     paint.setLooper(context->drawLooper());
     // only antialias if we're rotated or skewed
@@ -355,11 +360,12 @@
     resampling = limitResamplingMode(context, resampling);
     paint.setFilterBitmap(resampling == LinearResampling);
 
+    bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap());
     // FIXME: Bicubic filtering in Skia is only applied to defer-decoded images
     // as an experiment. Once this filtering code path becomes stable we should
     // turn this on for all cases, including non-defer-decoded images.
-    bool useBicubicFilter = resampling == AwesomeResampling
-        && DeferredImageDecoder::isLazyDecoded(bitmap());
+    bool useBicubicFilter = resampling == AwesomeResampling && isLazyDecoded;
+
     if (useBicubicFilter)
         paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
 
@@ -374,6 +380,8 @@
         // don't send extra pixels.
         context->drawBitmapRect(bitmap(), &srcRect, destRect, &paint);
     }
+    if (isLazyDecoded)
+        PlatformInstrumentation::didDrawLazyPixelRef(reinterpret_cast<unsigned long long>(bitmap().pixelRef()));
     context->didDrawRect(destRect, paint, &bitmap());
 }
 
@@ -416,9 +424,10 @@
     SkMatrix shaderTransform;
     RefPtr<SkShader> shader;
 
+    bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap());
     // Bicubic filter is only applied to defer-decoded images, see
     // NativeImageSkia::draw for details.
-    bool useBicubicFilter = resampling == AwesomeResampling && DeferredImageDecoder::isLazyDecoded(bitmap());
+    bool useBicubicFilter = resampling == AwesomeResampling && isLazyDecoded;
 
     if (resampling == AwesomeResampling && !useBicubicFilter) {
         // Do nice resampling.
@@ -461,11 +470,17 @@
 
     SkPaint paint;
     paint.setShader(shader.get());
-    paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
+    if (context->drawLuminanceMask()) {
+        paint.setXfermode(SkLumaMaskXfermode::Create(SkXfermode::kSrcOver_Mode));
+    } else {
+        paint.setXfermode(WebCoreCompositeToSkiaComposite(compositeOp, blendMode).get());
+    }
 
     paint.setFilterBitmap(resampling == LinearResampling);
     if (useBicubicFilter)
         paint.setFilterLevel(SkPaint::kHigh_FilterLevel);
+    if (isLazyDecoded)
+        PlatformInstrumentation::didDrawLazyPixelRef(reinterpret_cast<unsigned long long>(bitmap().pixelRef()));
 
     context->drawRect(destRect, paint);
 }
diff --git a/Source/core/platform/image-decoders/ImageDecoder.cpp b/Source/core/platform/image-decoders/ImageDecoder.cpp
index 657ee4c..7bae661 100644
--- a/Source/core/platform/image-decoders/ImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/ImageDecoder.cpp
@@ -28,6 +28,7 @@
 #include "core/platform/image-decoders/jpeg/JPEGImageDecoder.h"
 #include "core/platform/image-decoders/png/PNGImageDecoder.h"
 #include "core/platform/image-decoders/webp/WEBPImageDecoder.h"
+#include "public/platform/Platform.h"
 #include "wtf/PassOwnPtr.h"
 
 namespace WebCore {
@@ -87,27 +88,29 @@
     static const unsigned longestSignatureLength = sizeof("RIFF????WEBPVP") - 1;
     ASSERT(longestSignatureLength == 14);
 
+    size_t maxDecodedBytes = WebKit::Platform::current()->maxDecodedImageBytes();
+
     char contents[longestSignatureLength];
     if (copyFromSharedBuffer(contents, longestSignatureLength, data, 0) < longestSignatureLength)
         return nullptr;
 
     if (matchesJPEGSignature(contents))
-        return adoptPtr(new JPEGImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new JPEGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     if (matchesPNGSignature(contents))
-        return adoptPtr(new PNGImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new PNGImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     if (matchesGIFSignature(contents))
-        return adoptPtr(new GIFImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new GIFImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     if (matchesICOSignature(contents) || matchesCURSignature(contents))
-        return adoptPtr(new ICOImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new ICOImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     if (matchesWebPSignature(contents))
-        return adoptPtr(new WEBPImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new WEBPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     if (matchesBMPSignature(contents))
-        return adoptPtr(new BMPImageDecoder(alphaOption, gammaAndColorProfileOption, IntSize()));
+        return adoptPtr(new BMPImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes));
 
     return nullptr;
 }
@@ -157,13 +160,13 @@
     ASSERT(frameIndex <= m_frameBufferCache.size());
     if (!frameIndex) {
         // The first frame doesn't rely on any previous data.
-        return notFound;
+        return kNotFound;
     }
 
     const ImageFrame* currBuffer = &m_frameBufferCache[frameIndex];
     if ((frameRectIsOpaque || currBuffer->alphaBlendSource() == ImageFrame::BlendAtopBgcolor)
         && currBuffer->originalFrameRect().contains(IntRect(IntPoint(), size())))
-        return notFound;
+        return kNotFound;
 
     // The starting state for this frame depends on the previous frame's
     // disposal method.
@@ -190,10 +193,10 @@
         // this frame is a blank frame, so it can again be decoded alone.
         // Otherwise, the previous frame contributes to this frame.
         return (prevBuffer->originalFrameRect().contains(IntRect(IntPoint(), size()))
-            || (prevBuffer->requiredPreviousFrameIndex() == notFound)) ? notFound : prevFrame;
+            || (prevBuffer->requiredPreviousFrameIndex() == kNotFound)) ? kNotFound : prevFrame;
     default:
         ASSERT_NOT_REACHED();
-        return notFound;
+        return kNotFound;
     }
 }
 
diff --git a/Source/core/platform/image-decoders/ImageDecoder.h b/Source/core/platform/image-decoders/ImageDecoder.h
index 2beba3e..99f926c 100644
--- a/Source/core/platform/image-decoders/ImageDecoder.h
+++ b/Source/core/platform/image-decoders/ImageDecoder.h
@@ -33,6 +33,7 @@
 #include "core/platform/graphics/ImageSource.h"
 #include "core/platform/graphics/IntRect.h"
 #include "core/platform/graphics/skia/NativeImageSkia.h"
+#include "public/platform/Platform.h"
 #include "wtf/Assertions.h"
 #include "wtf/RefPtr.h"
 #include "wtf/text/WTFString.h"
@@ -221,7 +222,7 @@
         bool m_premultiplyAlpha;
 
         // The frame that must be decoded before this frame can be decoded.
-        // WTF::notFound if this frame doesn't require any previous frame.
+        // WTF::kNotFound if this frame doesn't require any previous frame.
         // This is used by ImageDecoder::clearCacheExceptFrame(), and will never
         // be read for image formats that do not have multiple frames.
         size_t m_requiredPreviousFrameIndex;
@@ -233,22 +234,15 @@
     // ImageDecoder is a base for all format-specific decoders
     // (e.g. JPEGImageDecoder). This base manages the ImageFrame cache.
     //
-    // |maxDecodedSize| is used to limit decoded image sizes to no larger than
-    // the provided size. This is used to limit memory consumption when
-    // decoding large images. Image should be shrunk such that both width and
-    // height fit inside the specified size.
-    //
-    // Individual image decoders may ignore this entirely (which may result in
-    // excessive memory consumption) or shrink images even smaller than the
-    // provided size (which may result in decreased visual fidelity of the
-    // rendered page).
     class ImageDecoder {
         WTF_MAKE_NONCOPYABLE(ImageDecoder); WTF_MAKE_FAST_ALLOCATED;
     public:
-    ImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption, const IntSize& maxDecodedSize)
+        static const size_t noDecodedImageByteLimit = WebKit::Platform::noDecodedImageByteLimit;
+
+        ImageDecoder(ImageSource::AlphaOption alphaOption, ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption, size_t maxDecodedBytes)
             : m_premultiplyAlpha(alphaOption == ImageSource::AlphaPremultiplied)
             , m_ignoreGammaAndColorProfile(gammaAndColorProfileOption == ImageSource::GammaAndColorProfileIgnored)
-            , m_maxDecodedSize(maxDecodedSize)
+            , m_maxDecodedBytes(maxDecodedBytes)
             , m_sizeAvailable(false)
             , m_isAllDataReceived(false)
             , m_failed(false) { }
@@ -258,8 +252,12 @@
         // Returns a caller-owned decoder of the appropriate type.  Returns 0 if
         // we can't sniff a supported type from the provided data (possibly
         // because there isn't enough data yet).
+        // Sets m_maxDecodedBytes to Platform::maxImageDecodedBytes().
         static PassOwnPtr<ImageDecoder> create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption);
 
+        // Returns a decoder with custom maxDecodedSize.
+        static PassOwnPtr<ImageDecoder> create(const SharedBuffer& data, ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedSize);
+
         virtual String filenameExtension() const = 0;
 
         bool isAllDataReceived() const { return m_isAllDataReceived; }
@@ -282,6 +280,10 @@
 
         virtual IntSize size() const { return m_size; }
 
+        // Decoders which downsample images should override this method to
+        // return the actual decoded size.
+        virtual IntSize decodedSize() const { return size(); }
+
         // This will only differ from size() for ICO (where each frame is a
         // different icon) or other formats where different frames are different
         // sizes. This does NOT differ from size() for GIF or WebP, since
@@ -296,7 +298,7 @@
         // overflow elsewhere).  If not, marks decoding as failed.
         virtual bool setSize(unsigned width, unsigned height)
         {
-            if (isOverSize(width, height))
+            if (sizeCalculationMayOverflow(width, height))
                 return setFailed();
             m_size = IntSize(width, height);
             m_sizeAvailable = true;
@@ -398,7 +400,7 @@
         bool failed() const { return m_failed; }
 
         // Clears decoded pixel data from all frames except the provided frame.
-        // Callers may pass WTF::notFound to clear all frames.
+        // Callers may pass WTF::kNotFound to clear all frames.
         // Note: If |m_frameBufferCache| contains only one frame, it won't be cleared.
         // Returns the number of bytes of frame data actually cleared.
         virtual size_t clearCacheExceptFrame(size_t);
@@ -423,7 +425,7 @@
         // order to decode frame |frameIndex|, based on frame disposal methods
         // and |frameRectIsOpaque|, where |frameRectIsOpaque| signifies whether
         // the rectangle of frame at |frameIndex| is known to be opaque.
-        // If no previous frame's data is required, returns WTF::notFound.
+        // If no previous frame's data is required, returns WTF::kNotFound.
         //
         // This function requires that the previous frame's
         // |m_requiredPreviousFrameIndex| member has been set correctly. The
@@ -445,12 +447,18 @@
         bool m_premultiplyAlpha;
         bool m_ignoreGammaAndColorProfile;
         ImageOrientation m_orientation;
-        IntSize m_maxDecodedSize;
+
+        // The maximum amount of memory a decoded image should require. Ideally,
+        // image decoders should downsample large images to fit under this limit
+        // (and then return the downsampled size from decodedSize()). Ignoring
+        // this limit can cause excessive memory use or even crashes on low-
+        // memory devices.
+        size_t m_maxDecodedBytes;
 
     private:
         // Some code paths compute the size of the image as "width * height * 4"
         // and return it as a (signed) int.  Avoid overflow.
-        static bool isOverSize(unsigned width, unsigned height)
+        static bool sizeCalculationMayOverflow(unsigned width, unsigned height)
         {
             unsigned long long total_size = static_cast<unsigned long long>(width)
                                           * static_cast<unsigned long long>(height);
diff --git a/Source/core/platform/image-decoders/ImageDecoderTest.cpp b/Source/core/platform/image-decoders/ImageDecoderTest.cpp
index d25aeeb..7227f5f 100644
--- a/Source/core/platform/image-decoders/ImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/ImageDecoderTest.cpp
@@ -42,7 +42,7 @@
 class TestImageDecoder : public ImageDecoder {
 public:
     TestImageDecoder()
-        : ImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, IntSize())
+        : ImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, noDecodedImageByteLimit)
     {
     }
 
@@ -69,6 +69,17 @@
     }
 };
 
+TEST(ImageDecoderTest, sizeCalculationMayOverflow)
+{
+    OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
+    EXPECT_FALSE(decoder->setSize(1 << 29, 1));
+    EXPECT_FALSE(decoder->setSize(1, 1 << 29));
+    EXPECT_FALSE(decoder->setSize(1 << 15, 1 << 15));
+    EXPECT_TRUE(decoder->setSize(1 << 28, 1));
+    EXPECT_TRUE(decoder->setSize(1, 1 << 28));
+    EXPECT_TRUE(decoder->setSize(1 << 14, 1 << 14));
+}
+
 TEST(ImageDecoderTest, requiredPreviousFrameIndex)
 {
     OwnPtr<TestImageDecoder> decoder(adoptPtr(new TestImageDecoder()));
@@ -83,7 +94,7 @@
     decoder->resetRequiredPreviousFrames();
 
     // The first frame doesn't require any previous frame.
-    EXPECT_EQ(notFound, frameBuffers[0].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[0].requiredPreviousFrameIndex());
     // The previous DisposeNotSpecified frame is required.
     EXPECT_EQ(0u, frameBuffers[1].requiredPreviousFrameIndex());
     // DisposeKeep is treated as DisposeNotSpecified.
@@ -103,7 +114,7 @@
     // Fully covering DisposeOverwriteBgcolor previous frame resets the starting state.
     frameBuffers[1].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
     decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(notFound, frameBuffers[2].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
 
     // Partially covering DisposeOverwriteBgcolor previous frame is required by this frame.
     frameBuffers[1].setOriginalFrameRect(IntRect(50, 50, 50, 50));
@@ -124,20 +135,20 @@
     // resets the starting state.
     frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
     decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(notFound, frameBuffers[1].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
     frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
     decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(notFound, frameBuffers[1].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
 
     // ... even if it partially covers.
     frameBuffers[0].setOriginalFrameRect(IntRect(50, 50, 50, 50));
 
     frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwritePrevious);
     decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(notFound, frameBuffers[1].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
     frameBuffers[0].setDisposalMethod(ImageFrame::DisposeOverwriteBgcolor);
     decoder->resetRequiredPreviousFrames();
-    EXPECT_EQ(notFound, frameBuffers[1].requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, frameBuffers[1].requiredPreviousFrameIndex());
 }
 
 TEST(ImageDecoderTest, requiredPreviousFrameIndexBlendAtopBgcolor)
@@ -153,7 +164,7 @@
     for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
         frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
         decoder->resetRequiredPreviousFrames();
-        EXPECT_EQ(notFound, frameBuffers[2].requiredPreviousFrameIndex());
+        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
     }
 
     // A non-full frame with 'blending method == BlendAtopBgcolor' does depend on a prior frame.
@@ -161,7 +172,7 @@
     for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
         frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
         decoder->resetRequiredPreviousFrames();
-        EXPECT_NE(notFound, frameBuffers[2].requiredPreviousFrameIndex());
+        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
     }
 }
 
@@ -177,7 +188,7 @@
     for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
         frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
         decoder->resetRequiredPreviousFrames(true);
-        EXPECT_EQ(notFound, frameBuffers[2].requiredPreviousFrameIndex());
+        EXPECT_EQ(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
     }
 
     // A non-full frame that is known to be opaque does depend on a prior frame.
@@ -185,7 +196,7 @@
     for (int disposeMethod = ImageFrame::DisposeNotSpecified; disposeMethod <= ImageFrame::DisposeOverwritePrevious; ++disposeMethod) {
         frameBuffers[1].setDisposalMethod(static_cast<ImageFrame::DisposalMethod>(disposeMethod));
         decoder->resetRequiredPreviousFrames(true);
-        EXPECT_NE(notFound, frameBuffers[2].requiredPreviousFrameIndex());
+        EXPECT_NE(kNotFound, frameBuffers[2].requiredPreviousFrameIndex());
     }
 }
 
@@ -196,7 +207,7 @@
 
     // This should not crash.
     decoder->initFrames(20);
-    decoder->clearCacheExceptFrame(notFound);
+    decoder->clearCacheExceptFrame(kNotFound);
 }
 
 TEST(ImageDecoderTest, clearCacheExceptFrameAll)
@@ -208,7 +219,7 @@
     for (size_t i = 0; i < numFrames; ++i)
         frameBuffers[i].setStatus(i % 2 ? ImageFrame::FramePartial : ImageFrame::FrameComplete);
 
-    decoder->clearCacheExceptFrame(notFound);
+    decoder->clearCacheExceptFrame(kNotFound);
 
     for (size_t i = 0; i < numFrames; ++i) {
         SCOPED_TRACE(testing::Message() << i);
diff --git a/Source/core/platform/image-decoders/ImageFrame.cpp b/Source/core/platform/image-decoders/ImageFrame.cpp
index 165d650..f325234 100644
--- a/Source/core/platform/image-decoders/ImageFrame.cpp
+++ b/Source/core/platform/image-decoders/ImageFrame.cpp
@@ -41,7 +41,7 @@
     , m_disposalMethod(DisposeNotSpecified)
     , m_alphaBlendSource(BlendAtopPreviousFrame)
     , m_premultiplyAlpha(true)
-    , m_requiredPreviousFrameIndex(notFound)
+    , m_requiredPreviousFrameIndex(kNotFound)
 #if !ASSERT_DISABLED
     , m_requiredPreviousFrameIndexValid(false)
 #endif
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp
index 053556b..3afdcbc 100644
--- a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -44,8 +44,8 @@
 
 BMPImageDecoder::BMPImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
     , m_decodedOffset(0)
 {
 }
diff --git a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h
index 0d13430..44dfb3e 100644
--- a/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h
+++ b/Source/core/platform/image-decoders/bmp/BMPImageDecoder.h
@@ -39,7 +39,7 @@
     // This class decodes the BMP image format.
     class BMPImageDecoder : public ImageDecoder {
     public:
-        BMPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+        BMPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
 
         // ImageDecoder
         virtual String filenameExtension() const { return "bmp"; }
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp
index 21ef4d1..9a69d66 100644
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -36,8 +36,8 @@
 
 GIFImageDecoder::GIFImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
     , m_repetitionCount(cAnimationLoopOnce)
 {
 }
@@ -228,8 +228,8 @@
         // resulting buffer was non-transparent, and we can setHasAlpha(false).
         if (buffer.originalFrameRect().contains(IntRect(IntPoint(), size()))) {
             buffer.setHasAlpha(false);
-            buffer.setRequiredPreviousFrameIndex(notFound);
-        } else if (buffer.requiredPreviousFrameIndex() != notFound) {
+            buffer.setRequiredPreviousFrameIndex(kNotFound);
+        } else if (buffer.requiredPreviousFrameIndex() != kNotFound) {
             // Tricky case.  This frame does not have alpha only if everywhere
             // outside its rect doesn't have alpha.  To know whether this is
             // true, we check the start state of the frame -- if it doesn't have
@@ -327,7 +327,7 @@
     do {
         framesToDecode.append(frameToDecode);
         frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
-    } while (frameToDecode != notFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
+    } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
 
     for (size_t i = framesToDecode.size(); i > 0; --i) {
         size_t frameIndex = framesToDecode[i - 1];
@@ -354,7 +354,7 @@
     ImageFrame* const buffer = &m_frameBufferCache[frameIndex];
 
     size_t requiredPreviousFrameIndex = buffer->requiredPreviousFrameIndex();
-    if (requiredPreviousFrameIndex == notFound) {
+    if (requiredPreviousFrameIndex == kNotFound) {
         // This frame doesn't rely on any previous data.
         if (!buffer->setSize(size().width(), size().height()))
             return setFailed();
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h b/Source/core/platform/image-decoders/gif/GIFImageDecoder.h
index d0232a7..5c946a2 100644
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoder.h
@@ -36,7 +36,7 @@
     // This class decodes the GIF image format.
     class GIFImageDecoder : public ImageDecoder {
     public:
-        GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+        GIFImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
         virtual ~GIFImageDecoder();
 
         enum GIFParseQuery { GIFSizeQuery, GIFFrameCountQuery };
diff --git a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp b/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
index c8f0263..a38879b 100644
--- a/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/gif/GIFImageDecoderTest.cpp
@@ -58,7 +58,7 @@
 
 PassOwnPtr<GIFImageDecoder> createDecoder()
 {
-    return adoptPtr(new GIFImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, IntSize()));
+    return adoptPtr(new GIFImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
 }
 
 unsigned hashSkBitmap(const SkBitmap& bitmap)
@@ -393,14 +393,14 @@
         ++partialSize;
     } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
 
-    EXPECT_EQ(notFound, decoder->frameBufferAtIndex(0)->requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, decoder->frameBufferAtIndex(0)->requiredPreviousFrameIndex());
     unsigned frameCount = decoder->frameCount();
     for (size_t i = 1; i < frameCount; ++i)
         EXPECT_EQ(i - 1, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
 
     decoder->setData(fullData.get(), true);
     for (size_t i = 0; i < frameCount; ++i)
-        EXPECT_EQ(notFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
+        EXPECT_EQ(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
 }
 
 TEST(GIFImageDecoderTest, randomFrameDecode)
@@ -444,7 +444,7 @@
     EXPECT_EQ(frameCount, decoder->frameCount());
     ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
     EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
-    decoder->clearCacheExceptFrame(notFound);
+    decoder->clearCacheExceptFrame(kNotFound);
 
     // Resume decoding of the first frame.
     ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
diff --git a/Source/core/platform/image-decoders/gif/GIFImageReader.h b/Source/core/platform/image-decoders/gif/GIFImageReader.h
index 33a1bd7..1197dd3 100644
--- a/Source/core/platform/image-decoders/gif/GIFImageReader.h
+++ b/Source/core/platform/image-decoders/gif/GIFImageReader.h
@@ -189,7 +189,7 @@
         , m_yOffset(0)
         , m_width(0)
         , m_height(0)
-        , m_transparentPixel(notFound)
+        , m_transparentPixel(kNotFound)
         , m_disposalMethod(WebCore::ImageFrame::DisposeNotSpecified)
         , m_dataSize(0)
         , m_progressiveDisplay(false)
@@ -258,7 +258,7 @@
     unsigned m_yOffset; // With respect to "screen" origin.
     unsigned m_width;
     unsigned m_height;
-    size_t m_transparentPixel; // Index of transparent pixel. Value is notFound if there is no transparent pixel.
+    size_t m_transparentPixel; // Index of transparent pixel. Value is kNotFound if there is no transparent pixel.
     WebCore::ImageFrame::DisposalMethod m_disposalMethod; // Restore to background, leave in place, etc.
     int m_dataSize;
 
diff --git a/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp
index 7e713c3..6367662 100644
--- a/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -48,8 +48,8 @@
 
 ICOImageDecoder::ICOImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
     , m_decodedOffset(0)
 {
 }
@@ -105,7 +105,7 @@
         m_frameBufferCache.resize(m_dirEntries.size());
         for (size_t i = 0; i < m_dirEntries.size(); ++i) {
             m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
-            m_frameBufferCache[i].setRequiredPreviousFrameIndex(notFound);
+            m_frameBufferCache[i].setRequiredPreviousFrameIndex(kNotFound);
         }
     }
     // CAUTION: We must not resize m_frameBufferCache again after this, as
@@ -230,7 +230,7 @@
     if (!m_pngDecoders[index]) {
         m_pngDecoders[index] = adoptPtr(
             new PNGImageDecoder(m_premultiplyAlpha ? ImageSource::AlphaPremultiplied : ImageSource::AlphaNotPremultiplied,
-                m_ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied, m_maxDecodedSize));
+                m_ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied, m_maxDecodedBytes));
         setDataForPNGDecoderAtIndex(index);
     }
     // Fail if the size the PNGImageDecoder calculated does not match the size
@@ -239,7 +239,7 @@
         return setFailed();
     m_frameBufferCache[index] = *m_pngDecoders[index]->frameBufferAtIndex(0);
     m_frameBufferCache[index].setPremultiplyAlpha(m_premultiplyAlpha);
-    m_frameBufferCache[index].setRequiredPreviousFrameIndex(notFound);
+    m_frameBufferCache[index].setRequiredPreviousFrameIndex(kNotFound);
     return !m_pngDecoders[index]->failed() || setFailed();
 }
 
diff --git a/Source/core/platform/image-decoders/ico/ICOImageDecoder.h b/Source/core/platform/image-decoders/ico/ICOImageDecoder.h
index 041affe..422a8cb 100644
--- a/Source/core/platform/image-decoders/ico/ICOImageDecoder.h
+++ b/Source/core/platform/image-decoders/ico/ICOImageDecoder.h
@@ -40,7 +40,7 @@
     // This class decodes the ICO and CUR image formats.
     class ICOImageDecoder : public ImageDecoder {
     public:
-        ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+        ICOImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
         virtual ~ICOImageDecoder();
 
         // ImageDecoder
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index cb36a28..52e7fd5 100644
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -43,6 +43,7 @@
 #include "core/platform/PlatformInstrumentation.h"
 #include "wtf/CPU.h"
 #include "wtf/PassOwnPtr.h"
+#include "wtf/dtoa/utils.h"
 
 extern "C" {
 #include <stdio.h> // jpeglib.h needs stdio FILE.
@@ -90,8 +91,15 @@
 inline bool doFancyUpsampling() { return true; }
 #endif
 
+namespace {
+
 const int exifMarker = JPEG_APP0 + 1;
 
+// JPEG only supports a denominator of 8.
+const unsigned scaleDenominator = 8;
+
+} // namespace
+
 namespace WebCore {
 
 struct decoder_error_mgr {
@@ -241,13 +249,12 @@
 class JPEGImageReader {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    JPEGImageReader(JPEGImageDecoder* decoder, const IntSize& maxDecodedSize)
+    JPEGImageReader(JPEGImageDecoder* decoder)
         : m_decoder(decoder)
         , m_bufferLength(0)
         , m_bytesToSkip(0)
         , m_state(JPEG_HEADER)
         , m_samples(0)
-        , m_maxDecodedSize(maxDecodedSize)
 #if USE(QCMSLIB)
         , m_transform(0)
 #endif
@@ -321,8 +328,6 @@
 
     bool decode(const SharedBuffer& data, bool onlySize)
     {
-        m_decodingSizeOnly = onlySize;
-
         unsigned newByteCount = data.size() - m_bufferLength;
         unsigned readOffset = m_bufferLength - m_info.src->bytes_in_buffer;
 
@@ -395,7 +400,7 @@
             // image is a sequential JPEG.
             m_info.buffered_image = jpeg_has_multiple_scans(&m_info);
 
-            if (m_decodingSizeOnly) {
+            if (onlySize) {
                 // We can stop here. Reduce our buffer length and available data.
                 m_bufferLength -= m_info.src->bytes_in_buffer;
                 m_info.src->bytes_in_buffer = 0;
@@ -413,15 +418,9 @@
             m_info.enable_2pass_quant = false;
             m_info.do_block_smoothing = true;
 
-            // Enable downsampling if maximum decoded size is specified.
-            if (!m_maxDecodedSize.isEmpty()) {
-                // JPEG only supports a denominator of 8.
-                m_info.scale_denom = 8;
-                unsigned scaleNumerator = std::min(m_info.scale_denom * m_maxDecodedSize.width() / m_info.image_width,
-                    m_info.scale_denom * m_maxDecodedSize.height() / m_info.image_height);
-
-                // Don't upsample, and don't downsample to zero size.
-                m_info.scale_num = std::min(m_info.scale_denom, std::max(scaleNumerator, 1u));
+            if (m_decoder->size() != m_decoder->decodedSize()) {
+                m_info.scale_denom = scaleDenominator;
+                m_info.scale_num = m_decoder->decodedSize().width() * scaleDenominator / m_info.image_width;
             }
 
             // Used to set up image size so arrays can be allocated.
@@ -554,14 +553,12 @@
     JPEGImageDecoder* m_decoder;
     unsigned m_bufferLength;
     int m_bytesToSkip;
-    bool m_decodingSizeOnly;
 
     jpeg_decompress_struct m_info;
     decoder_error_mgr m_err;
     jstate m_state;
 
     JSAMPARRAY m_samples;
-    IntSize m_maxDecodedSize;
 
 #if USE(QCMSLIB)
     qcms_transform* m_transform;
@@ -602,8 +599,8 @@
 
 JPEGImageDecoder::JPEGImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
 {
 }
 
@@ -619,6 +616,31 @@
     return ImageDecoder::isSizeAvailable();
 }
 
+bool JPEGImageDecoder::setSize(unsigned width, unsigned height)
+{
+    if (!ImageDecoder::setSize(width, height))
+        return false;
+
+    size_t originalBytes = width * height * 4;
+    if (originalBytes <= m_maxDecodedBytes) {
+        m_decodedSize = IntSize(width, height);
+        return true;
+    }
+
+    // Downsample according to the maximum decoded size.
+    unsigned scaleNumerator = static_cast<unsigned>(floor(sqrt(
+        // MSVC needs explicit parameter type for sqrt().
+        static_cast<float>(m_maxDecodedBytes * scaleDenominator * scaleDenominator / originalBytes))));
+    m_decodedSize = IntSize(scaleNumerator * width / scaleDenominator, scaleNumerator * height / scaleDenominator);
+
+    // The image is too big to be downsampled by libjpeg.
+    // FIXME: Post-process to downsample the image.
+    if (m_decodedSize.isEmpty())
+        return setFailed();
+
+    return true;
+}
+
 ImageFrame* JPEGImageDecoder::frameBufferAtIndex(size_t index)
 {
     if (index)
@@ -759,7 +781,7 @@
         return;
 
     if (!m_reader) {
-        m_reader = adoptPtr(new JPEGImageReader(this, m_maxDecodedSize));
+        m_reader = adoptPtr(new JPEGImageReader(this));
     }
 
     // If we couldn't decode the image but we've received all the data, decoding
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h
index 996ce65..3c603c0 100644
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -38,17 +38,19 @@
     // This class decodes the JPEG image format.
     class JPEGImageDecoder : public ImageDecoder {
     public:
-        JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+        JPEGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
         virtual ~JPEGImageDecoder();
 
         // ImageDecoder
-        virtual String filenameExtension() const { return "jpg"; }
-        virtual bool isSizeAvailable();
-        virtual ImageFrame* frameBufferAtIndex(size_t);
+        virtual String filenameExtension() const OVERRIDE { return "jpg"; }
+        virtual bool isSizeAvailable() OVERRIDE;
+        virtual IntSize decodedSize() const OVERRIDE { return m_decodedSize; }
+        virtual bool setSize(unsigned width, unsigned height) OVERRIDE;
+        virtual ImageFrame* frameBufferAtIndex(size_t) OVERRIDE;
         // CAUTION: setFailed() deletes |m_reader|.  Be careful to avoid
         // accessing deleted memory, especially when calling this from inside
         // JPEGImageReader!
-        virtual bool setFailed();
+        virtual bool setFailed() OVERRIDE;
 
         bool outputScanlines();
         void jpegComplete();
@@ -62,6 +64,7 @@
         void decode(bool onlySize);
 
         OwnPtr<JPEGImageReader> m_reader;
+        IntSize m_decodedSize;
     };
 
 } // namespace WebCore
diff --git a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
index a78d7d0..1ebc8ef 100644
--- a/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
@@ -57,34 +57,34 @@
     return Platform::current()->unitTestSupport()->readFromFile(filePath);
 }
 
-PassOwnPtr<JPEGImageDecoder> createDecoder(const IntSize& maxDecodedSize)
+PassOwnPtr<JPEGImageDecoder> createDecoder(size_t maxDecodedBytes)
 {
-    return adoptPtr(new JPEGImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, maxDecodedSize));
+    return adoptPtr(new JPEGImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, maxDecodedBytes));
 }
 
 } // namespace
 
-void downsample(unsigned width, unsigned height, unsigned* outputWidth, unsigned* outputHeight)
+void downsample(size_t maxDecodedBytes, unsigned* outputWidth, unsigned* outputHeight)
 {
     RefPtr<SharedBuffer> data = readFile("/LayoutTests/fast/images/resources/lenna.jpg");
     ASSERT_TRUE(data.get());
 
-    OwnPtr<JPEGImageDecoder> decoder = createDecoder(IntSize(width, height));
+    OwnPtr<JPEGImageDecoder> decoder = createDecoder(maxDecodedBytes);
     decoder->setData(data.get(), true);
 
     ImageFrame* frame = decoder->frameBufferAtIndex(0);
     ASSERT_TRUE(frame);
     *outputWidth = frame->getSkBitmap().width();
     *outputHeight = frame->getSkBitmap().height();
+    EXPECT_EQ(IntSize(*outputWidth, *outputHeight), decoder->decodedSize());
 }
 
-// Tests that a small size doesn't result in an empty image.
-TEST(JPEGImageDecoderTest, downsample0)
+// Tests failure on a too big image.
+TEST(JPEGImageDecoderTest, tooBig)
 {
-    unsigned outputWidth, outputHeight;
-    downsample(1, 1, &outputWidth, &outputHeight);
-    EXPECT_EQ(32u, outputWidth);
-    EXPECT_EQ(32u, outputHeight);
+    OwnPtr<JPEGImageDecoder> decoder = createDecoder(100);
+    EXPECT_FALSE(decoder->setSize(10000, 10000));
+    EXPECT_TRUE(decoder->failed());
 }
 
 // Tests that JPEG decoder can downsample from 1/8 to 7/8.
@@ -93,55 +93,46 @@
     unsigned outputWidth, outputHeight;
 
     // 1/8 downsample.
-    downsample(40, 40, &outputWidth, &outputHeight);
+    downsample(40 * 40 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(32u, outputWidth);
     EXPECT_EQ(32u, outputHeight);
 
     // 2/8 downsample.
-    downsample(70, 70, &outputWidth, &outputHeight);
+    downsample(70 * 70 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(64u, outputWidth);
     EXPECT_EQ(64u, outputHeight);
 
     // 3/8 downsample.
-    downsample(100, 100, &outputWidth, &outputHeight);
+    downsample(100 * 100 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(96u, outputWidth);
     EXPECT_EQ(96u, outputHeight);
 
     // 4/8 downsample.
-    downsample(130, 130, &outputWidth, &outputHeight);
+    downsample(130 * 130 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(128u, outputWidth);
     EXPECT_EQ(128u, outputHeight);
 
     // 5/8 downsample.
-    downsample(170, 170, &outputWidth, &outputHeight);
+    downsample(170 * 170 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(160u, outputWidth);
     EXPECT_EQ(160u, outputHeight);
 
     // 6/8 downsample.
-    downsample(200, 200, &outputWidth, &outputHeight);
+    downsample(200 * 200 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(192u, outputWidth);
     EXPECT_EQ(192u, outputHeight);
 
     // 7/8 downsample.
-    downsample(230, 230, &outputWidth, &outputHeight);
+    downsample(230 * 230 * 4, &outputWidth, &outputHeight);
     EXPECT_EQ(224u, outputWidth);
     EXPECT_EQ(224u, outputHeight);
 }
 
-// Tests that output image fits in a rectangular size.
-TEST(JPEGImageDecoderTest, downsampleRectangle)
-{
-    unsigned outputWidth, outputHeight;
-    downsample(130, 256, &outputWidth, &outputHeight);
-    EXPECT_EQ(128u, outputWidth);
-    EXPECT_EQ(128u, outputHeight);
-}
-
 // Tests that upsampling is not allowed.
 TEST(JPEGImageDecoderTest, upsample)
 {
     unsigned outputWidth, outputHeight;
-    downsample(1000, 1000, &outputWidth, &outputHeight);
+    downsample(1000 * 1000, &outputWidth, &outputHeight);
     EXPECT_EQ(256u, outputWidth);
     EXPECT_EQ(256u, outputHeight);
 }
diff --git a/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp b/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp
index 2bdde69..c695afb 100644
--- a/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -217,8 +217,8 @@
 
 PNGImageDecoder::PNGImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
     , m_doNothingOnFailure(false)
 {
 }
diff --git a/Source/core/platform/image-decoders/png/PNGImageDecoder.h b/Source/core/platform/image-decoders/png/PNGImageDecoder.h
index 1a4094e..ca09b6d 100644
--- a/Source/core/platform/image-decoders/png/PNGImageDecoder.h
+++ b/Source/core/platform/image-decoders/png/PNGImageDecoder.h
@@ -36,7 +36,7 @@
     // This class decodes the PNG image format.
     class PNGImageDecoder : public ImageDecoder {
     public:
-        PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+        PNGImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
         virtual ~PNGImageDecoder();
 
         // ImageDecoder
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
index c050942..84bfd9d 100644
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
+++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.cpp
@@ -49,8 +49,8 @@
 
 WEBPImageDecoder::WEBPImageDecoder(ImageSource::AlphaOption alphaOption,
     ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption,
-    const IntSize& maxDecodedSize)
-    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedSize)
+    size_t maxDecodedBytes)
+    : ImageDecoder(alphaOption, gammaAndColorProfileOption, maxDecodedBytes)
     , m_decoder(0)
     , m_formatFlags(0)
     , m_frameBackgroundHasAlpha(false)
@@ -123,7 +123,7 @@
         do {
             framesToDecode.append(frameToDecode);
             frameToDecode = m_frameBufferCache[frameToDecode].requiredPreviousFrameIndex();
-        } while (frameToDecode != notFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
+        } while (frameToDecode != kNotFound && m_frameBufferCache[frameToDecode].status() != ImageFrame::FrameComplete);
 
         ASSERT(m_demux);
         for (size_t i = framesToDecode.size(); i > 0; --i) {
@@ -238,7 +238,7 @@
             m_frameBufferCache[i].setPremultiplyAlpha(m_premultiplyAlpha);
             if (!hasAnimation) {
                 ASSERT(!i);
-                m_frameBufferCache[i].setRequiredPreviousFrameIndex(notFound);
+                m_frameBufferCache[i].setRequiredPreviousFrameIndex(kNotFound);
                 continue;
             }
             WebPIterator animatedFrame;
@@ -269,7 +269,7 @@
         return true;
 
     const size_t requiredPreviousFrameIndex = buffer.requiredPreviousFrameIndex();
-    if (requiredPreviousFrameIndex == notFound) {
+    if (requiredPreviousFrameIndex == kNotFound) {
         // This frame doesn't rely on any previous data.
         if (!buffer.setSize(size().width(), size().height()))
             return setFailed();
@@ -416,7 +416,7 @@
     // pixels based on disposal method of the previous frame and the previous frame buffer.
     // FIXME: This could be avoided if libwebp decoder had an API that used the previous required frame
     // to do the alpha-blending by itself.
-    if ((m_formatFlags & ANIMATION_FLAG) && frameIndex && buffer.alphaBlendSource() == ImageFrame::BlendAtopPreviousFrame && buffer.requiredPreviousFrameIndex() != notFound) {
+    if ((m_formatFlags & ANIMATION_FLAG) && frameIndex && buffer.alphaBlendSource() == ImageFrame::BlendAtopPreviousFrame && buffer.requiredPreviousFrameIndex() != kNotFound) {
         ImageFrame& prevBuffer = m_frameBufferCache[frameIndex - 1];
         ASSERT(prevBuffer.status() == ImageFrame::FrameComplete);
         ImageFrame::DisposalMethod prevDisposalMethod = prevBuffer.disposalMethod();
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
index ff184ce..2a165cd 100644
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
+++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoder.h
@@ -38,7 +38,7 @@
 
 class WEBPImageDecoder : public ImageDecoder {
 public:
-    WEBPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, const IntSize&);
+    WEBPImageDecoder(ImageSource::AlphaOption, ImageSource::GammaAndColorProfileOption, size_t maxDecodedBytes);
     virtual ~WEBPImageDecoder();
 
     virtual String filenameExtension() const OVERRIDE { return "webp"; }
diff --git a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp b/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
index de87b00..54db2d5 100644
--- a/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
+++ b/Source/core/platform/image-decoders/webp/WEBPImageDecoderTest.cpp
@@ -60,7 +60,7 @@
 
 PassOwnPtr<WEBPImageDecoder> createDecoder()
 {
-    return adoptPtr(new WEBPImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, IntSize()));
+    return adoptPtr(new WEBPImageDecoder(ImageSource::AlphaNotPremultiplied, ImageSource::GammaAndColorProfileApplied, ImageDecoder::noDecodedImageByteLimit));
 }
 
 unsigned hashSkBitmap(const SkBitmap& bitmap)
@@ -442,14 +442,14 @@
         ++partialSize;
     } while (!decoder->frameCount() || decoder->frameBufferAtIndex(0)->status() == ImageFrame::FrameEmpty);
 
-    EXPECT_EQ(notFound, decoder->frameBufferAtIndex(0)->requiredPreviousFrameIndex());
+    EXPECT_EQ(kNotFound, decoder->frameBufferAtIndex(0)->requiredPreviousFrameIndex());
     unsigned frameCount = decoder->frameCount();
     for (size_t i = 1; i < frameCount; ++i)
         EXPECT_EQ(i - 1, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
 
     decoder->setData(fullData.get(), true);
     for (size_t i = 0; i < frameCount; ++i)
-        EXPECT_EQ(notFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
+        EXPECT_EQ(kNotFound, decoder->frameBufferAtIndex(i)->requiredPreviousFrameIndex());
 }
 
 TEST_F(AnimatedWebPTests, randomFrameDecode)
@@ -491,7 +491,7 @@
     EXPECT_EQ(frameCount, decoder->frameCount());
     ImageFrame* lastFrame = decoder->frameBufferAtIndex(frameCount - 1);
     EXPECT_EQ(baselineHashes[frameCount - 1], hashSkBitmap(lastFrame->getSkBitmap()));
-    decoder->clearCacheExceptFrame(notFound);
+    decoder->clearCacheExceptFrame(kNotFound);
 
     // Resume decoding of the first frame.
     ImageFrame* firstFrame = decoder->frameBufferAtIndex(0);
diff --git a/Source/core/platform/mac/ScrollAnimatorMac.h b/Source/core/platform/mac/ScrollAnimatorMac.h
index 648d445..4d03966 100644
--- a/Source/core/platform/mac/ScrollAnimatorMac.h
+++ b/Source/core/platform/mac/ScrollAnimatorMac.h
@@ -40,7 +40,7 @@
 
 typedef id ScrollbarPainterController;
 
-#if !ENABLE(RUBBER_BANDING)
+#if !USE(RUBBER_BANDING)
 class ScrollElasticityControllerClient { };
 #endif
 
@@ -88,7 +88,7 @@
     virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
     virtual void scrollToOffsetWithoutAnimation(const FloatPoint&);
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
 #endif
 
@@ -130,7 +130,7 @@
 
     virtual bool isRubberBandInProgress() const OVERRIDE;
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     /// ScrollElasticityControllerClient member functions.
     virtual IntSize stretchAmount() OVERRIDE;
     virtual bool allowsHorizontalStretching() OVERRIDE;
diff --git a/Source/core/platform/mac/ScrollAnimatorMac.mm b/Source/core/platform/mac/ScrollAnimatorMac.mm
index 9f4dda5..a03cc70 100644
--- a/Source/core/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/core/platform/mac/ScrollAnimatorMac.mm
@@ -600,7 +600,7 @@
     : ScrollAnimator(scrollableArea)
     , m_initialScrollbarPaintTimer(this, &ScrollAnimatorMac::initialScrollbarPaintTimerFired)
     , m_sendContentAreaScrolledTimer(this, &ScrollAnimatorMac::sendContentAreaScrolledTimerFired)
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     , m_scrollElasticityController(this)
     , m_snapRubberBandTimer(this, &ScrollAnimatorMac::snapRubberBandTimerFired)
 #endif
@@ -639,7 +639,7 @@
     return enabled;
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 static bool rubberBandingEnabledForSystem()
 {
     static bool initialized = false;
@@ -720,7 +720,7 @@
 
 bool ScrollAnimatorMac::isRubberBandInProgress() const
 {
-#if !ENABLE(RUBBER_BANDING)
+#if !USE(RUBBER_BANDING)
     return false;
 #else
     return m_scrollElasticityController.isRubberBandInProgress();
@@ -1006,7 +1006,7 @@
         mayBeginScrollGesture();
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
 {
     m_haveScrolledSincePageLoad = true;
diff --git a/Source/core/platform/mac/ScrollElasticityController.h b/Source/core/platform/mac/ScrollElasticityController.h
index 6a032ac..7fde5e9 100644
--- a/Source/core/platform/mac/ScrollElasticityController.h
+++ b/Source/core/platform/mac/ScrollElasticityController.h
@@ -26,7 +26,7 @@
 #ifndef ScrollElasticityController_h
 #define ScrollElasticityController_h
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 
 #include "core/platform/ScrollTypes.h"
 #include "core/platform/graphics/FloatPoint.h"
@@ -98,6 +98,6 @@
 
 } // namespace WebCore
 
-#endif // ENABLE(RUBBER_BANDING)
+#endif // USE(RUBBER_BANDING)
 
 #endif // ScrollElasticityController_h
diff --git a/Source/core/platform/mac/ScrollElasticityController.mm b/Source/core/platform/mac/ScrollElasticityController.mm
index b10f6d2..58165c6 100644
--- a/Source/core/platform/mac/ScrollElasticityController.mm
+++ b/Source/core/platform/mac/ScrollElasticityController.mm
@@ -30,7 +30,7 @@
 #include <sys/time.h>
 #include "core/platform/PlatformWheelEvent.h"
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 
 static NSTimeInterval systemUptime()
 {
@@ -132,11 +132,12 @@
     }
 
     if (wheelEvent.phase() == PlatformWheelEventPhaseEnded) {
-        if (isRubberBandInProgress()) {
-            snapRubberBand();
-            return true;
-        }
-        return false;
+        bool wasRubberBandInProgress = isRubberBandInProgress();
+        // Call snapRubberBand() even if isRubberBandInProgress() is false. For example,
+        // m_inScrollGesture may be true (and needs to be reset on a phase end) even if
+        // isRubberBandInProgress() is not (e.g. the overhang area is empty).
+        snapRubberBand();
+        return wasRubberBandInProgress;
     }
 
     bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone);
@@ -319,7 +320,6 @@
 
                 m_stretchScrollForce = FloatSize();
                 m_startTime = 0;
-                m_startStretch = FloatSize();
                 m_origOrigin = FloatPoint();
                 m_origVelocity = FloatSize();
                 return;
@@ -392,11 +392,18 @@
     if (m_snapRubberbandTimerIsActive)
         return;
 
-    m_startTime = [NSDate timeIntervalSinceReferenceDate];
     m_startStretch = FloatSize();
     m_origOrigin = FloatPoint();
     m_origVelocity = FloatSize();
 
+    // If there's no momentum scroll or stretch amount, no need to start the timer.
+    if (!m_momentumScrollInProgress && m_client->stretchAmount() == FloatSize()) {
+        m_startTime = 0;
+        m_stretchScrollForce = FloatSize();
+        return;
+    }
+
+    m_startTime = [NSDate timeIntervalSinceReferenceDate];
     m_client->startSnapRubberbandTimer();
     m_snapRubberbandTimerIsActive = true;
 }
@@ -413,4 +420,4 @@
 
 } // namespace WebCore
 
-#endif // ENABLE(RUBBER_BANDING)
+#endif // USE(RUBBER_BANDING)
diff --git a/Source/core/platform/mediastream/MediaStreamDescriptor.cpp b/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
index 6d01fb2..cb1ae44 100644
--- a/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
+++ b/Source/core/platform/mediastream/MediaStreamDescriptor.cpp
@@ -55,11 +55,11 @@
 {
     switch (component->source()->type()) {
     case MediaStreamSource::TypeAudio:
-        if (m_audioComponents.find(component) == notFound)
+        if (m_audioComponents.find(component) == kNotFound)
             m_audioComponents.append(component);
         break;
     case MediaStreamSource::TypeVideo:
-        if (m_videoComponents.find(component) == notFound)
+        if (m_videoComponents.find(component) == kNotFound)
             m_videoComponents.append(component);
         break;
     }
@@ -67,16 +67,16 @@
 
 void MediaStreamDescriptor::removeComponent(PassRefPtr<MediaStreamComponent> component)
 {
-    size_t pos = notFound;
+    size_t pos = kNotFound;
     switch (component->source()->type()) {
     case MediaStreamSource::TypeAudio:
         pos = m_audioComponents.find(component);
-        if (pos != notFound)
+        if (pos != kNotFound)
             m_audioComponents.remove(pos);
         break;
     case MediaStreamSource::TypeVideo:
         pos = m_videoComponents.find(component);
-        if (pos != notFound)
+        if (pos != kNotFound)
             m_videoComponents.remove(pos);
         break;
     }
diff --git a/Source/core/platform/mediastream/MediaStreamSource.cpp b/Source/core/platform/mediastream/MediaStreamSource.cpp
index ffc3d9e..ea2e034 100644
--- a/Source/core/platform/mediastream/MediaStreamSource.cpp
+++ b/Source/core/platform/mediastream/MediaStreamSource.cpp
@@ -66,7 +66,7 @@
 void MediaStreamSource::removeObserver(MediaStreamSource::Observer* observer)
 {
     size_t pos = m_observers.find(observer);
-    if (pos != notFound)
+    if (pos != kNotFound)
         m_observers.remove(pos);
 }
 
@@ -82,7 +82,7 @@
     ASSERT(m_requiresConsumer);
     MutexLocker locker(m_audioConsumersLock);
     size_t pos = m_audioConsumers.find(consumer);
-    if (pos != notFound) {
+    if (pos != kNotFound) {
         m_audioConsumers.remove(pos);
         return true;
     }
diff --git a/Source/core/platform/network/HTTPParsers.cpp b/Source/core/platform/network/HTTPParsers.cpp
index 979dd26..cc2b296 100644
--- a/Source/core/platform/network/HTTPParsers.cpp
+++ b/Source/core/platform/network/HTTPParsers.cpp
@@ -246,7 +246,7 @@
     unsigned length = keyValuePairs.size();
     for (unsigned i = 0; i < length; i++) {
         size_t valueStartPos = keyValuePairs[i].find('=');
-        if (valueStartPos == notFound)
+        if (valueStartPos == kNotFound)
             continue;
 
         String key = keyValuePairs[i].left(valueStartPos).stripWhiteSpace();
@@ -318,7 +318,7 @@
 
     while (pos < length) {
         pos = mediaType.find("charset", pos, false);
-        if (pos == notFound || pos == 0) {
+        if (pos == kNotFound || !pos) {
             charsetLen = 0;
             return;
         }
diff --git a/Source/core/platform/network/MIMEHeader.cpp b/Source/core/platform/network/MIMEHeader.cpp
index 7e56eea..168db89 100644
--- a/Source/core/platform/network/MIMEHeader.cpp
+++ b/Source/core/platform/network/MIMEHeader.cpp
@@ -66,7 +66,7 @@
             value.clear();
         }
         size_t semiColonIndex = line.find(':');
-        if (semiColonIndex == notFound) {
+        if (semiColonIndex == kNotFound) {
             // This is not a key value pair, ignore.
             continue;
         }
diff --git a/Source/core/platform/network/ParsedContentType.cpp b/Source/core/platform/network/ParsedContentType.cpp
index d8db86a..101d5a7 100644
--- a/Source/core/platform/network/ParsedContentType.cpp
+++ b/Source/core/platform/network/ParsedContentType.cpp
@@ -49,12 +49,7 @@
         ++startIndex;
 }
 
-static bool isTokenCharacter(char c)
-{
-    return isASCII(c) && c > ' ' && c != '"' && c != '(' && c != ')' && c != ',' && c != '/' && (c < ':' || c > '@') && (c < '[' || c > ']');
-}
-
-static SubstringRange parseToken(const String& input, unsigned& startIndex)
+static SubstringRange parseParameterPart(const String& input, unsigned& startIndex)
 {
     unsigned inputLength = input.length();
     unsigned tokenStart = startIndex;
@@ -63,42 +58,24 @@
     if (tokenEnd >= inputLength)
         return SubstringRange();
 
+    bool quoted = input[tokenStart] == '\"';
+    bool escape = false;
+
     while (tokenEnd < inputLength) {
-        if (!isTokenCharacter(input[tokenEnd]))
+        UChar c = input[tokenEnd];
+        if (quoted && tokenStart != tokenEnd && c == '\"' && !escape)
+            return SubstringRange(tokenStart + 1, tokenEnd++ - tokenStart - 1);
+        if (!quoted && (c == ';' || c == '='))
             return SubstringRange(tokenStart, tokenEnd - tokenStart);
+        escape = !escape && c == '\\';
         ++tokenEnd;
     }
 
+    if (quoted)
+        return SubstringRange();
     return SubstringRange(tokenStart, tokenEnd - tokenStart);
 }
 
-static SubstringRange parseQuotedString(const String& input, unsigned& startIndex)
-{
-    unsigned inputLength = input.length();
-    unsigned quotedStringStart = startIndex + 1;
-    unsigned& quotedStringEnd = startIndex;
-
-    if (quotedStringEnd >= inputLength)
-        return SubstringRange();
-
-    if (input[quotedStringEnd++] != '"' || quotedStringEnd >= inputLength)
-        return SubstringRange();
-
-    bool lastCharacterWasBackslash = false;
-    char currentCharacter;
-    while ((currentCharacter = input[quotedStringEnd++]) != '"' || lastCharacterWasBackslash) {
-        if (quotedStringEnd >= inputLength)
-            return SubstringRange();
-        if (currentCharacter == '\\' && !lastCharacterWasBackslash) {
-            lastCharacterWasBackslash = true;
-            continue;
-        }
-        if (lastCharacterWasBackslash)
-            lastCharacterWasBackslash = false;
-    }
-    return SubstringRange(quotedStringStart, quotedStringEnd - quotedStringStart - 1);
-}
-
 static String substringForRange(const String& string, const SubstringRange& range)
 {
     return string.substring(range.first, range.second);
@@ -163,7 +140,7 @@
 
     // There should not be any quoted strings until we reach the parameters.
     size_t semiColonIndex = contentType.find(';', index);
-    if (semiColonIndex == notFound) {
+    if (semiColonIndex == kNotFound) {
         receiver.setContentType(SubstringRange(index, contentTypeLength - index));
         return true;
     }
@@ -172,34 +149,29 @@
     index = semiColonIndex + 1;
     while (true) {
         skipSpaces(contentType, index);
-        SubstringRange keyRange = parseToken(contentType, index);
+        SubstringRange keyRange = parseParameterPart(contentType, index);
         if (!keyRange.second || index >= contentTypeLength) {
-            LOG_ERROR("Invalid Content-Type parameter name.");
+            LOG_ERROR("Invalid Content-Type parameter name. (at %i)", index);
             return false;
         }
 
         // Should we tolerate spaces here?
         if (contentType[index++] != '=' || index >= contentTypeLength) {
-            LOG_ERROR("Invalid Content-Type malformed parameter.");
+            LOG_ERROR("Invalid Content-Type malformed parameter (at %i).", index);
             return false;
         }
 
         // Should we tolerate spaces here?
-        String value;
-        SubstringRange valueRange;
-        if (contentType[index] == '"')
-            valueRange = parseQuotedString(contentType, index);
-        else
-            valueRange = parseToken(contentType, index);
+        SubstringRange valueRange = parseParameterPart(contentType, index);
 
         if (!valueRange.second) {
-            LOG_ERROR("Invalid Content-Type, invalid parameter value.");
+            LOG_ERROR("Invalid Content-Type, invalid parameter value (at %i, for '%s').", index, substringForRange(contentType, keyRange).stripWhiteSpace().ascii().data());
             return false;
         }
 
         // Should we tolerate spaces here?
         if (index < contentTypeLength && contentType[index++] != ';') {
-            LOG_ERROR("Invalid Content-Type, invalid character at the end of key/value parameter.");
+            LOG_ERROR("Invalid Content-Type, invalid character at the end of key/value parameter (at %i).", index);
             return false;
         }
 
diff --git a/Source/core/platform/network/ResourceResponse.cpp b/Source/core/platform/network/ResourceResponse.cpp
index db90cab..2b27a64 100644
--- a/Source/core/platform/network/ResourceResponse.cpp
+++ b/Source/core/platform/network/ResourceResponse.cpp
@@ -474,7 +474,7 @@
     DEFINE_STATIC_LOCAL(const AtomicString, headerName, ("content-disposition", AtomicString::ConstructFromLiteral));
     String value = m_httpHeaderFields.get(headerName);
     size_t loc = value.find(';');
-    if (loc != notFound)
+    if (loc != kNotFound)
         value = value.left(loc);
     value = value.stripWhiteSpace();
     DEFINE_STATIC_LOCAL(const AtomicString, attachmentString, ("attachment", AtomicString::ConstructFromLiteral));
@@ -627,7 +627,7 @@
     for (unsigned pos = 0; pos < max; /* pos incremented in loop */) {
         size_t nextCommaPosition = safeHeader.find(',', pos);
         size_t nextEqualSignPosition = safeHeader.find('=', pos);
-        if (nextEqualSignPosition != notFound && (nextEqualSignPosition < nextCommaPosition || nextCommaPosition == notFound)) {
+        if (nextEqualSignPosition != kNotFound && (nextEqualSignPosition < nextCommaPosition || nextCommaPosition == kNotFound)) {
             // Get directive name, parse right hand side of equal sign, then add to map
             String directive = trimToNextSeparator(safeHeader.substring(pos, nextEqualSignPosition - pos).stripWhiteSpace());
             pos += nextEqualSignPosition - pos + 1;
@@ -636,13 +636,13 @@
             if (value[0] == '"') {
                 // The value is a quoted string
                 size_t nextDoubleQuotePosition = value.find('"', 1);
-                if (nextDoubleQuotePosition != notFound) {
+                if (nextDoubleQuotePosition != kNotFound) {
                     // Store the value as a quoted string without quotes
                     result.append(pair<String, String>(directive, value.substring(1, nextDoubleQuotePosition - 1).stripWhiteSpace()));
                     pos += (safeHeader.find('"', pos) - pos) + nextDoubleQuotePosition + 1;
                     // Move past next comma, if there is one
                     size_t nextCommaPosition2 = safeHeader.find(',', pos);
-                    if (nextCommaPosition2 != notFound)
+                    if (nextCommaPosition2 != kNotFound)
                         pos += nextCommaPosition2 - pos + 1;
                     else
                         return; // Parse error if there is anything left with no comma
@@ -654,7 +654,7 @@
             } else {
                 // The value is a token until the next comma
                 size_t nextCommaPosition2 = value.find(',');
-                if (nextCommaPosition2 != notFound) {
+                if (nextCommaPosition2 != kNotFound) {
                     // The value is delimited by the next comma
                     result.append(pair<String, String>(directive, trimToNextSeparator(value.substring(0, nextCommaPosition2).stripWhiteSpace())));
                     pos += (safeHeader.find(',', pos) - pos) + 1;
@@ -664,7 +664,7 @@
                     return;
                 }
             }
-        } else if (nextCommaPosition != notFound && (nextCommaPosition < nextEqualSignPosition || nextEqualSignPosition == notFound)) {
+        } else if (nextCommaPosition != kNotFound && (nextCommaPosition < nextEqualSignPosition || nextEqualSignPosition == kNotFound)) {
             // Add directive to map with empty string as value
             result.append(pair<String, String>(trimToNextSeparator(safeHeader.substring(pos, nextCommaPosition - pos).stripWhiteSpace()), ""));
             pos += nextCommaPosition - pos + 1;
diff --git a/Source/core/platform/text/BidiResolver.h b/Source/core/platform/text/BidiResolver.h
index dc5ee34..435612e 100644
--- a/Source/core/platform/text/BidiResolver.h
+++ b/Source/core/platform/text/BidiResolver.h
@@ -223,6 +223,8 @@
 
     bool isEndOfParagraph(const Iterator& end) { return m_current == end || m_current.atEnd(); }
 
+    TextDirection determineParagraphDirectionality(bool* hasStrongDirectionality = 0);
+
 protected:
     void increment() { m_current.increment(); }
     // FIXME: Instead of InlineBidiResolvers subclassing this method, we should
@@ -525,6 +527,36 @@
 }
 
 template <class Iterator, class Run>
+TextDirection BidiResolver<Iterator, Run>::determineParagraphDirectionality(bool* hasStrongDirectionality)
+{
+    while (!m_current.atEnd()) {
+        if (inIsolate()) {
+            increment();
+            continue;
+        }
+        if (m_current.atParagraphSeparator())
+            break;
+        if (UChar current = m_current.current()) {
+            WTF::Unicode::Direction charDirection = WTF::Unicode::direction(current);
+            if (charDirection == WTF::Unicode::LeftToRight) {
+                if (hasStrongDirectionality)
+                    *hasStrongDirectionality = true;
+                return LTR;
+            }
+            if (charDirection == WTF::Unicode::RightToLeft || charDirection == WTF::Unicode::RightToLeftArabic) {
+                if (hasStrongDirectionality)
+                    *hasStrongDirectionality = true;
+                return RTL;
+            }
+        }
+        increment();
+    }
+    if (hasStrongDirectionality)
+        *hasStrongDirectionality = false;
+    return LTR;
+}
+
+template <class Iterator, class Run>
 void BidiResolver<Iterator, Run>::createBidiRunsForLine(const Iterator& end, VisualDirectionOverride override, bool hardLineBreak)
 {
     using namespace WTF::Unicode;
diff --git a/Source/core/platform/text/DateTimeFormat.cpp b/Source/core/platform/text/DateTimeFormat.cpp
index 6cf33d4..0a02cdc 100644
--- a/Source/core/platform/text/DateTimeFormat.cpp
+++ b/Source/core/platform/text/DateTimeFormat.cpp
@@ -250,12 +250,12 @@
     if (literal.length() <= 0)
         return;
 
-    if (literal.find(isASCIIAlphabetOrQuote) == notFound) {
+    if (literal.find(isASCIIAlphabetOrQuote) == kNotFound) {
         buffer.append(literal);
         return;
     }
 
-    if (literal.find('\'') == notFound) {
+    if (literal.find('\'') == kNotFound) {
         buffer.append("'");
         buffer.append(literal);
         buffer.append("'");
diff --git a/Source/core/platform/text/DecodeEscapeSequences.h b/Source/core/platform/text/DecodeEscapeSequences.h
index d809896..81b43e3 100644
--- a/Source/core/platform/text/DecodeEscapeSequences.h
+++ b/Source/core/platform/text/DecodeEscapeSequences.h
@@ -130,7 +130,7 @@
     size_t decodedPosition = 0;
     size_t searchPosition = 0;
     size_t encodedRunPosition;
-    while ((encodedRunPosition = EscapeSequence::findInString(string, searchPosition)) != notFound) {
+    while ((encodedRunPosition = EscapeSequence::findInString(string, searchPosition)) != kNotFound) {
         size_t encodedRunEnd = EscapeSequence::findEndOfRun(string, encodedRunPosition, length);
         searchPosition = encodedRunEnd;
         if (encodedRunEnd == encodedRunPosition) {
diff --git a/Source/core/platform/text/LocaleToScriptMappingDefault.cpp b/Source/core/platform/text/LocaleToScriptMappingDefault.cpp
index 6a410f3..197d87a 100644
--- a/Source/core/platform/text/LocaleToScriptMappingDefault.cpp
+++ b/Source/core/platform/text/LocaleToScriptMappingDefault.cpp
@@ -391,7 +391,7 @@
         if (it != localeScriptMap.end())
             return it->value;
         size_t pos = canonicalLocale.reverseFind('_');
-        if (pos == notFound)
+        if (pos == kNotFound)
             break;
         UScriptCode code = scriptNameToCode(canonicalLocale.substring(pos + 1));
         if (code != USCRIPT_INVALID_CODE && code != USCRIPT_UNKNOWN)
diff --git a/Source/core/platform/text/PlatformLocale.cpp b/Source/core/platform/text/PlatformLocale.cpp
index 1b09c63..ef0ad72 100644
--- a/Source/core/platform/text/PlatformLocale.cpp
+++ b/Source/core/platform/text/PlatformLocale.cpp
@@ -202,6 +202,11 @@
     return Platform::current()->queryLocalizedString(name, parameter1, parameter2);
 }
 
+String Locale::validationMessageTooLongText(unsigned valueLength, int maxLength)
+{
+    return queryString(WebLocalizedString::ValidationTooLong, convertToLocalizedNumber(String::number(valueLength)), convertToLocalizedNumber(String::number(maxLength)));
+}
+
 void Locale::setLocaleData(const Vector<String, DecimalSymbolsSize>& symbols, const String& positivePrefix, const String& positiveSuffix, const String& negativePrefix, const String& negativeSuffix)
 {
     for (size_t i = 0; i < symbols.size(); ++i) {
diff --git a/Source/core/platform/text/PlatformLocale.h b/Source/core/platform/text/PlatformLocale.h
index 8f19dd4..45e40e6 100644
--- a/Source/core/platform/text/PlatformLocale.h
+++ b/Source/core/platform/text/PlatformLocale.h
@@ -44,6 +44,7 @@
     String queryString(WebKit::WebLocalizedString::Name);
     String queryString(WebKit::WebLocalizedString::Name, const String& parameter);
     String queryString(WebKit::WebLocalizedString::Name, const String& parameter1, const String& parameter2);
+    String validationMessageTooLongText(unsigned valueLength, int maxLength);
 
     // Converts the specified number string to another number string localized
     // for this Locale locale. The input string must conform to HTML
diff --git a/Source/core/platform/text/mac/LocaleMac.mm b/Source/core/platform/text/mac/LocaleMac.mm
index 1dbcf4d..fdcb333 100644
--- a/Source/core/platform/text/mac/LocaleMac.mm
+++ b/Source/core/platform/text/mac/LocaleMac.mm
@@ -49,7 +49,7 @@
     String normalizedLocale = locale;
     normalizedLocale.replace('-', '_');
     size_t separatorPosition = normalizedLocale.find('_');
-    if (separatorPosition == notFound)
+    if (separatorPosition == kNotFound)
         return normalizedLocale;
     return normalizedLocale.left(separatorPosition);
 }
diff --git a/Source/core/platform/text/win/LocaleWin.cpp b/Source/core/platform/text/win/LocaleWin.cpp
index e29b5af..811fd6d 100644
--- a/Source/core/platform/text/win/LocaleWin.cpp
+++ b/Source/core/platform/text/win/LocaleWin.cpp
@@ -57,7 +57,7 @@
 static String extractLanguageCode(const String& locale)
 {
     size_t dashPosition = locale.find('-');
-    if (dashPosition == notFound)
+    if (dashPosition == kNotFound)
         return locale;
     return locale.left(dashPosition);
 }
@@ -65,7 +65,7 @@
 static String removeLastComponent(const String& name)
 {
     size_t lastSeparator = name.reverseFind('-');
-    if (lastSeparator == notFound)
+    if (lastSeparator == kNotFound)
         return emptyString();
     return name.left(lastSeparator);
 }
@@ -455,7 +455,7 @@
         builder.append(getLocaleInfoString(LOCALE_STIME));
         builder.append("ss");
         size_t pos = format.reverseFind(builder.toString());
-        if (pos != notFound)
+        if (pos != kNotFound)
             format.remove(pos, builder.length());
     }
     m_timeFormatWithoutSeconds = convertWindowsDateTimeFormat(format);
diff --git a/Source/core/rendering/FloatingObjects.cpp b/Source/core/rendering/FloatingObjects.cpp
index 0250448..bcd9846 100644
--- a/Source/core/rendering/FloatingObjects.cpp
+++ b/Source/core/rendering/FloatingObjects.cpp
@@ -168,6 +168,7 @@
     , m_rightObjectsCount(0)
     , m_horizontalWritingMode(horizontalWritingMode)
     , m_renderer(renderer)
+    , m_cachedHorizontalWritingMode(false)
 {
 }
 
@@ -373,7 +374,7 @@
     const FloatingObject* outermostFloat = adapter.outermostFloat();
     if (offsetMode == ShapeOutsideFloatShapeOffset && outermostFloat) {
         if (ShapeOutsideInfo* shapeOutside = outermostFloat->renderer()->shapeOutsideInfo()) {
-            shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, outermostFloat->logicalTop(m_horizontalWritingMode), logicalHeight);
+            shapeOutside->computeSegmentsForContainingBlockLine(m_renderer, outermostFloat, logicalTop, logicalHeight);
             offset += shapeOutside->rightSegmentMarginBoxDelta();
         }
     }
@@ -393,7 +394,7 @@
     const FloatingObject* outermostFloat = adapter.outermostFloat();
     if (offsetMode == ShapeOutsideFloatShapeOffset && outermostFloat) {
         if (ShapeOutsideInfo* shapeOutside = outermostFloat->renderer()->shapeOutsideInfo()) {
-            shapeOutside->computeSegmentsForContainingBlockLine(logicalTop, outermostFloat->logicalTop(m_horizontalWritingMode), logicalHeight);
+            shapeOutside->computeSegmentsForContainingBlockLine(m_renderer, outermostFloat, logicalTop, logicalHeight);
             offset += shapeOutside->leftSegmentMarginBoxDelta();
         }
     }
diff --git a/Source/core/rendering/HitTestResult.cpp b/Source/core/rendering/HitTestResult.cpp
index 8dc1cfc..f8e4caa 100644
--- a/Source/core/rendering/HitTestResult.cpp
+++ b/Source/core/rendering/HitTestResult.cpp
@@ -261,7 +261,7 @@
 
     RenderObject* renderer = m_innerNonSharedNode->renderer();
     if (renderer && renderer->isImage()) {
-        RenderImage* image = static_cast<WebCore::RenderImage*>(renderer);
+        RenderImage* image = toRenderImage(renderer);
         if (image->cachedImage() && !image->cachedImage()->errorOccurred())
             return image->cachedImage()->imageForRenderer(image);
     }
@@ -357,7 +357,7 @@
     if (pos.isNull())
         return false;
     return m_innerNonSharedNode->document().markers()->markersInRange(
-        makeRange(pos, pos).get(), DocumentMarker::Spelling | DocumentMarker::Grammar).size() > 0;
+        makeRange(pos, pos).get(), DocumentMarker::MisspellingMarkers()).size() > 0;
 }
 
 String HitTestResult::titleDisplayString() const
diff --git a/Source/core/rendering/InlineIterator.h b/Source/core/rendering/InlineIterator.h
index fa5a8ad..1885f8e 100644
--- a/Source/core/rendering/InlineIterator.h
+++ b/Source/core/rendering/InlineIterator.h
@@ -78,13 +78,13 @@
     void increment(InlineBidiResolver* = 0, IncrementRule = FastIncrementInTextNode);
     bool atEnd() const;
 
-    inline bool atTextParagraphSeparator()
+    inline bool atTextParagraphSeparator() const
     {
         return m_obj && m_obj->preservesNewline() && m_obj->isText() && toRenderText(m_obj)->textLength()
             && !toRenderText(m_obj)->isWordBreak() && toRenderText(m_obj)->characterAt(m_pos) == '\n';
     }
 
-    inline bool atParagraphSeparator()
+    inline bool atParagraphSeparator() const
     {
         return (m_obj && m_obj->isBR()) || atTextParagraphSeparator();
     }
diff --git a/Source/core/rendering/LineWidth.cpp b/Source/core/rendering/LineWidth.cpp
index 72d1656..35946fe 100644
--- a/Source/core/rendering/LineWidth.cpp
+++ b/Source/core/rendering/LineWidth.cpp
@@ -52,7 +52,7 @@
 void LineWidth::updateAvailableWidth(LayoutUnit replacedHeight)
 {
     LayoutUnit height = m_block.logicalHeight();
-    LayoutUnit logicalHeight = logicalHeightForLine(&m_block, m_isFirstLine, replacedHeight);
+    LayoutUnit logicalHeight = m_block.minLineHeightForReplacedRenderer(m_isFirstLine, replacedHeight);
     m_left = m_block.logicalLeftOffsetForLine(height, shouldIndentText(), logicalHeight);
     m_right = m_block.logicalRightOffsetForLine(height, shouldIndentText(), logicalHeight);
 
@@ -79,19 +79,20 @@
     const FloatingObjectSet& floatingObjectSet = m_block.m_floatingObjects->set();
     FloatingObjectSetIterator it = floatingObjectSet.end();
     FloatingObjectSetIterator begin = floatingObjectSet.begin();
+    LayoutUnit lineHeight = m_block.lineHeight(m_isFirstLine, m_block.isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
     for (--it; it != begin; --it) {
         FloatingObject* previousFloat = *it;
         if (previousFloat != newFloat && previousFloat->type() == newFloat->type()) {
             previousShapeOutsideInfo = previousFloat->renderer()->shapeOutsideInfo();
             if (previousShapeOutsideInfo)
-                previousShapeOutsideInfo->computeSegmentsForContainingBlockLine(m_block.logicalHeight(), previousFloat->logicalTop(m_block.isHorizontalWritingMode()), logicalHeightForLine(&m_block, m_isFirstLine));
+                previousShapeOutsideInfo->computeSegmentsForContainingBlockLine(&m_block, previousFloat, m_block.logicalHeight(), lineHeight);
             break;
         }
     }
 
     ShapeOutsideInfo* shapeOutsideInfo = newFloat->renderer()->shapeOutsideInfo();
     if (shapeOutsideInfo)
-        shapeOutsideInfo->computeSegmentsForContainingBlockLine(m_block.logicalHeight(), newFloat->logicalTop(m_block.isHorizontalWritingMode()), logicalHeightForLine(&m_block, m_isFirstLine));
+        shapeOutsideInfo->computeSegmentsForContainingBlockLine(&m_block, newFloat, m_block.logicalHeight(), lineHeight);
 
     if (newFloat->type() == FloatingObject::FloatLeft) {
         float newLeft = newFloat->logicalRight(m_block.isHorizontalWritingMode());
@@ -149,7 +150,7 @@
     float newLineLeft = m_left;
     float newLineRight = m_right;
     while (true) {
-        floatLogicalBottom = m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom);
+        floatLogicalBottom = m_block.nextFloatLogicalBottomBelow(lastFloatLogicalBottom, ShapeOutsideFloatShapeOffset);
         if (floatLogicalBottom <= lastFloatLogicalBottom)
             break;
 
diff --git a/Source/core/rendering/LineWidth.h b/Source/core/rendering/LineWidth.h
index f0bd81a..9db6362 100644
--- a/Source/core/rendering/LineWidth.h
+++ b/Source/core/rendering/LineWidth.h
@@ -37,17 +37,6 @@
 
 enum IndentTextOrNot { DoNotIndentText, IndentText };
 
-inline LayoutUnit logicalHeightForLine(const RenderBlock* block, bool isFirstLine, LayoutUnit replacedHeight = 0)
-{
-    if (!block->document().inNoQuirksMode() && replacedHeight)
-        return replacedHeight;
-
-    if (!(block->style(isFirstLine)->lineBoxContain() & LineBoxContainBlock))
-        return 0;
-
-    return std::max<LayoutUnit>(replacedHeight, block->lineHeight(isFirstLine, block->isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
-}
-
 class LineWidth {
 public:
     LineWidth(RenderBlock&, bool isFirstLine, IndentTextOrNot shouldIndentText);
diff --git a/Source/core/rendering/PaintPhase.h b/Source/core/rendering/PaintPhase.h
index af0bd59..cee9e9b 100644
--- a/Source/core/rendering/PaintPhase.h
+++ b/Source/core/rendering/PaintPhase.h
@@ -49,7 +49,8 @@
     PaintPhaseSelection,
     PaintPhaseCollapsedTableBorders,
     PaintPhaseTextClip,
-    PaintPhaseMask
+    PaintPhaseMask,
+    PaintPhaseClippingMask,
 };
 
 enum PaintBehaviorFlags {
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 4520c82..ecc9665 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -28,7 +28,7 @@
 #include "core/accessibility/AXObjectCache.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
-#include "core/dom/OverflowEvent.h"
+#include "core/events/OverflowEvent.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/Editor.h"
 #include "core/editing/FrameSelection.h"
@@ -1360,6 +1360,50 @@
     invalidateBackgroundObscurationStatus();
 }
 
+void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize offset)
+{
+    LayoutUnit left = isHorizontalWritingMode() ? offset.width() : offset.height();
+    if (!left || !child || child->shapeInsideInfo() || !layoutShapeInsideInfo())
+        return;
+    // Propagate layout markers only up to the child, as we are still in the middle
+    // of a layout pass
+    child->setNormalChildNeedsLayout(true);
+    child->markShapeInsideDescendantsForLayout();
+    child->layoutIfNeeded();
+}
+
+LayoutSize RenderBlock::logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const
+{
+    const RenderBlock* currentBlock = this;
+    LayoutRect blockRect(currentBlock->borderBoxRect());
+    while (currentBlock && !currentBlock->isRenderFlowThread() && currentBlock != container) {
+        RenderBlock* containerBlock = currentBlock->containingBlock();
+        ASSERT(containerBlock);
+        if (!containerBlock)
+            return LayoutSize();
+
+        if (containerBlock->style()->writingMode() != currentBlock->style()->writingMode()) {
+            // We have to put the block rect in container coordinates
+            // and we have to take into account both the container and current block flipping modes
+            // Bug: Flipping inline and block directions at the same time will not work,
+            // as one of the flipped dimensions will not yet have been set to its final size
+            if (containerBlock->style()->isFlippedBlocksWritingMode()) {
+                if (containerBlock->isHorizontalWritingMode())
+                    blockRect.setY(currentBlock->height() - blockRect.maxY());
+                else
+                    blockRect.setX(currentBlock->width() - blockRect.maxX());
+            }
+            currentBlock->flipForWritingMode(blockRect);
+        }
+
+        blockRect.moveBy(currentBlock->location());
+        currentBlock = containerBlock;
+    }
+
+    LayoutSize result = isHorizontalWritingMode() ? LayoutSize(blockRect.x(), blockRect.y()) : LayoutSize(blockRect.y(), blockRect.x());
+    return result;
+}
+
 void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*)
 {
     RenderBox::imageChanged(image);
@@ -1952,6 +1996,21 @@
     }
 }
 
+LayoutUnit RenderBlock::marginIntrinsicLogicalWidthForChild(RenderBox* child) const
+{
+    // A margin has three types: fixed, percentage, and auto (variable).
+    // Auto and percentage margins become 0 when computing min/max width.
+    // Fixed margins can be added in as is.
+    Length marginLeft = child->style()->marginStartUsing(style());
+    Length marginRight = child->style()->marginEndUsing(style());
+    LayoutUnit margin = 0;
+    if (marginLeft.isFixed())
+        margin += marginLeft.value();
+    if (marginRight.isFixed())
+        margin += marginRight.value();
+    return margin;
+}
+
 void RenderBlock::layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly)
 {
     TrackedRendererListHashSet* positionedDescendants = positionedObjects();
@@ -3579,7 +3638,7 @@
     return right;
 }
 
-LayoutUnit RenderBlock::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight) const
+LayoutUnit RenderBlock::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode offsetMode) const
 {
     if (!m_floatingObjects)
         return logicalHeight;
@@ -3588,8 +3647,13 @@
     const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
     FloatingObjectSetIterator end = floatingObjectSet.end();
     for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
-        FloatingObject* r = *it;
-        LayoutUnit floatBottom = r->logicalBottom(isHorizontalWritingMode());
+        FloatingObject* floatingObject = *it;
+        LayoutUnit floatBottom;
+        ShapeOutsideInfo* shapeOutside = floatingObject->renderer()->shapeOutsideInfo();
+        if (offsetMode == ShapeOutsideFloatShapeOffset && shapeOutside)
+            floatBottom = floatingObject->logicalTop(isHorizontalWritingMode()) + marginBeforeForChild(floatingObject->renderer()) + shapeOutside->shapeLogicalBottom();
+        else
+            floatBottom = floatingObject->logicalBottom(isHorizontalWritingMode());
         if (floatBottom > logicalHeight)
             bottom = min(floatBottom, bottom);
     }
@@ -5450,6 +5514,17 @@
     return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
 }
 
+LayoutUnit RenderBlock::minLineHeightForReplacedRenderer(bool isFirstLine, LayoutUnit replacedHeight) const
+{
+    if (!document().inNoQuirksMode() && replacedHeight)
+        return replacedHeight;
+
+    if (!(style(isFirstLine)->lineBoxContain() & LineBoxContainBlock))
+        return 0;
+
+    return std::max<LayoutUnit>(replacedHeight, lineHeight(isFirstLine, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
+}
+
 int RenderBlock::firstLineBoxBaseline() const
 {
     if (isWritingModeRoot() && !isRubyRun())
diff --git a/Source/core/rendering/RenderBlock.h b/Source/core/rendering/RenderBlock.h
index 40f38d5..8608a82 100644
--- a/Source/core/rendering/RenderBlock.h
+++ b/Source/core/rendering/RenderBlock.h
@@ -99,6 +99,8 @@
     virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE FINAL;
     virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;
 
+    LayoutUnit minLineHeightForReplacedRenderer(bool isFirstLine, LayoutUnit replacedHeight) const;
+
     RenderLineBoxList* lineBoxes() { return &m_lineBoxes; }
     const RenderLineBoxList* lineBoxes() const { return &m_lineBoxes; }
 
@@ -442,6 +444,8 @@
     void layoutPositionedObjects(bool relayoutChildren, bool fixedPositionObjectsOnly = false);
     void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLayoutScope&);
 
+    LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const;
+
     virtual bool supportsPartialLayout() const OVERRIDE { return true; };
 
     virtual void paint(PaintInfo&, const LayoutPoint&);
@@ -534,6 +538,8 @@
     void computeShapeSize();
     void updateRegionsAndShapesAfterChildLayout(RenderFlowThread*, bool);
     void updateShapeInsideInfoAfterStyleChange(const ShapeValue*, const ShapeValue* oldShape);
+    void relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize offset);
+    LayoutSize logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const;
 
     virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return children(); }
     virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); }
@@ -661,7 +667,7 @@
     LayoutUnit addOverhangingFloats(RenderBlock* child, bool makeChildPaintOtherFloats);
 
     LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::FloatLeftRight) const;
-    LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit) const;
+    LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMode = ShapeOutsideFloatMarginBoxOffset) const;
 
     bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
     bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
@@ -746,7 +752,7 @@
     RootInlineBox* createLineBoxesFromBidiRuns(unsigned bidiLevel, BidiRunList<BidiRun>&, const InlineIterator& end, LineInfo&, VerticalPositionCache&, BidiRun* trailingSpaceRun, WordMeasurements&);
     void layoutRunsAndFloats(LineLayoutState&, bool hasInlineChild);
     void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus, unsigned consecutiveHyphenatedLines);
-    void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, LayoutUnit&, LineLayoutState&);
+    void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, const LayoutSize&, LineLayoutState&);
     void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&);
     bool adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo*, LayoutUnit, LineLayoutState&, InlineBidiResolver&, FloatingObject*, InlineIterator&, WordMeasurements&);
     const InlineIterator& restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight,  FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver&,  const InlineIterator&);
diff --git a/Source/core/rendering/RenderBlockFlow.cpp b/Source/core/rendering/RenderBlockFlow.cpp
index b65fa04..51faaef 100644
--- a/Source/core/rendering/RenderBlockFlow.cpp
+++ b/Source/core/rendering/RenderBlockFlow.cpp
@@ -440,6 +440,9 @@
     // Now place the child in the correct left position
     determineLogicalLeftPositionForChild(child, ApplyLayoutDelta);
 
+    LayoutSize childOffset = child->location() - oldRect.location();
+    relayoutShapeDescendantIfMoved(childRenderBlock, childOffset);
+
     // Update our height now that the child has been placed in the correct position.
     setLogicalHeight(logicalHeight() + logicalHeightForChild(child));
     if (mustSeparateMarginAfterForChild(child)) {
@@ -451,7 +454,6 @@
     if (childRenderBlock && childRenderBlock->containsFloats())
         maxFloatLogicalBottom = max(maxFloatLogicalBottom, addOverhangingFloats(toRenderBlock(child), !childNeededLayout));
 
-    LayoutSize childOffset = child->location() - oldRect.location();
     if (childOffset.width() || childOffset.height()) {
         view()->addLayoutDelta(childOffset);
 
diff --git a/Source/core/rendering/RenderBlockLineLayout.cpp b/Source/core/rendering/RenderBlockLineLayout.cpp
index 6235fdd..70bdd9a 100644
--- a/Source/core/rendering/RenderBlockLineLayout.cpp
+++ b/Source/core/rendering/RenderBlockLineLayout.cpp
@@ -97,8 +97,9 @@
     ShapeInsideInfo* shapeInsideInfo = view()->layoutState()->shapeInsideInfo();
 
     if (!shapeInsideInfo && flowThreadContainingBlock() && allowsShapeInsideInfoSharing()) {
+        LayoutUnit lineHeight = this->lineHeight(false, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
         // regionAtBlockOffset returns regions like an array first={0,N-1}, second={N,M-1}, ...
-        LayoutUnit offset = logicalHeight() + logicalHeightForLine(this, false) - LayoutUnit(1);
+        LayoutUnit offset = logicalHeight() + lineHeight - LayoutUnit(1);
         RenderRegion* region = regionAtBlockOffset(offset);
         if (region)
             shapeInsideInfo = region->shapeInsideInfo();
@@ -240,25 +241,9 @@
 {
     InlineIterator iter(root, firstRenderObjectForDirectionalityDetermination(root, current), pos);
     InlineBidiResolver observer;
-    observer.setPositionIgnoringNestedIsolates(iter);
     observer.setStatus(BidiStatus(root->style()->direction(), isOverride(root->style()->unicodeBidi())));
-    while (!iter.atEnd()) {
-        if (observer.inIsolate()) {
-            iter.increment(&observer, InlineIterator::FastIncrementInIsolatedRenderer);
-            continue;
-        }
-        if (iter.atParagraphSeparator())
-            break;
-        if (UChar current = iter.current()) {
-            Direction charDirection = direction(current);
-            if (charDirection == LeftToRight)
-                return LTR;
-            if (charDirection == RightToLeft || charDirection == RightToLeftArabic)
-                return RTL;
-        }
-        iter.increment(&observer);
-    }
-    return LTR;
+    observer.setPositionIgnoringNestedIsolates(iter);
+    return observer.determineParagraphDirectionality();
 }
 
 static void checkMidpoints(LineMidpointState& lineMidpointState, InlineIterator& lBreak)
@@ -859,7 +844,7 @@
 
 static void updateLogicalInlinePositions(RenderBlock* block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine, IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight)
 {
-    LayoutUnit lineLogicalHeight = logicalHeightForLine(block, firstLine, boxLogicalHeight);
+    LayoutUnit lineLogicalHeight = block->minLineHeightForReplacedRenderer(firstLine, boxLogicalHeight);
     lineLogicalLeft = block->pixelSnappedLogicalLeftOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
     lineLogicalRight = block->pixelSnappedLogicalRightOffsetForLine(block->logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
     availableLogicalWidth = lineLogicalRight - lineLogicalLeft;
@@ -1511,7 +1496,7 @@
     block->setLogicalHeight(newLogicalHeight);
 }
 
-void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, LayoutUnit& absoluteLogicalTop, LineLayoutState& layoutState)
+void RenderBlock::updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*& shapeInsideInfo, const LayoutSize& logicalOffsetFromShapeContainer, LineLayoutState& layoutState)
 {
     if (layoutState.flowThread())
         return updateShapeAndSegmentsForCurrentLineInFlowThread(shapeInsideInfo, layoutState);
@@ -1519,11 +1504,12 @@
     if (!shapeInsideInfo)
         return;
 
-    LayoutUnit lineTop = logicalHeight() + absoluteLogicalTop;
+    LayoutUnit lineTop = logicalHeight() + logicalOffsetFromShapeContainer.height();
+    LayoutUnit lineLeft = logicalOffsetFromShapeContainer.width();
     LayoutUnit lineHeight = this->lineHeight(layoutState.lineInfo().isFirstLine(), isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes);
 
     // FIXME: Bug 95361: It is possible for a line to grow beyond lineHeight, in which case these segments may be incorrect.
-    shapeInsideInfo->computeSegmentsForLine(lineTop, lineHeight);
+    shapeInsideInfo->computeSegmentsForLine(LayoutSize(lineLeft, lineTop), lineHeight);
 
     pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
 }
@@ -1594,7 +1580,8 @@
     }
 
     LayoutUnit lineTop = logicalLineTopInFlowThread - currentRegion->logicalTopForFlowThreadContent() + currentRegion->borderAndPaddingBefore();
-    shapeInsideInfo->computeSegmentsForLine(lineTop, lineHeight);
+    // FIXME: Shape inside on a region does not yet take into account its padding for nested flow blocks
+    shapeInsideInfo->computeSegmentsForLine(LayoutSize(0, lineTop), lineHeight);
 
     if (currentRegion->isLastRegion())
         pushShapeContentOverflowBelowTheContentBox(this, shapeInsideInfo, lineTop, lineHeight);
@@ -1630,18 +1617,18 @@
 
     LineBreaker lineBreaker(this);
 
-    LayoutUnit absoluteLogicalTop;
+    LayoutSize logicalOffsetFromShapeContainer;
     ShapeInsideInfo* shapeInsideInfo = layoutShapeInsideInfo();
     if (shapeInsideInfo) {
         ASSERT(shapeInsideInfo->owner() == this || allowsShapeInsideInfoSharing());
         if (shapeInsideInfo != this->shapeInsideInfo()) {
             // FIXME Bug 100284: If subsequent LayoutStates are pushed, we will have to add
             // their offsets from the original shape-inside container.
-            absoluteLogicalTop = logicalTop();
+            logicalOffsetFromShapeContainer = logicalOffsetFromShapeAncestorContainer(shapeInsideInfo->owner());
         }
         // Begin layout at the logical top of our shape inside.
-        if (logicalHeight() + absoluteLogicalTop < shapeInsideInfo->shapeLogicalTop()) {
-            LayoutUnit logicalHeight = shapeInsideInfo->shapeLogicalTop() - absoluteLogicalTop;
+        if (logicalHeight() + logicalOffsetFromShapeContainer.height() < shapeInsideInfo->shapeLogicalTop()) {
+            LayoutUnit logicalHeight = shapeInsideInfo->shapeLogicalTop() - logicalOffsetFromShapeContainer.height();
             if (layoutState.flowThread())
                 logicalHeight -= shapeInsideInfo->owner()->borderAndPaddingBefore();
             setLogicalHeight(logicalHeight);
@@ -1667,7 +1654,7 @@
         bool isNewUBAParagraph = layoutState.lineInfo().previousLineBrokeCleanly();
         FloatingObject* lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last() : 0;
 
-        updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, absoluteLogicalTop, layoutState);
+        updateShapeAndSegmentsForCurrentLine(shapeInsideInfo, logicalOffsetFromShapeContainer, layoutState);
 
         WordMeasurements wordMeasurements;
         end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines, wordMeasurements);
@@ -1682,7 +1669,7 @@
             break;
         }
 
-        if (adjustLogicalLineTopAndLogicalHeightIfNeeded(shapeInsideInfo, absoluteLogicalTop, layoutState, resolver, lastFloatFromPreviousLine, end, wordMeasurements))
+        if (adjustLogicalLineTopAndLogicalHeightIfNeeded(shapeInsideInfo, logicalOffsetFromShapeContainer.height(), layoutState, resolver, lastFloatFromPreviousLine, end, wordMeasurements))
             continue;
 
         ASSERT(end != resolver.position());
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index f870131..040172a 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -254,7 +254,7 @@
 
     // If our zoom factor changes and we have a defined scrollLeft/Top, we need to adjust that value into the
     // new zoomed coordinate space.
-    if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() != newStyle->effectiveZoom()) {
+    if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() != newStyle->effectiveZoom() && layer()) {
         if (int left = layer()->scrollXOffset()) {
             left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom();
             layer()->scrollToXOffset(left);
@@ -1107,7 +1107,11 @@
 
     LayoutRect paintRect = borderBoxRectInRegion(paintInfo.renderRegion);
     paintRect.moveBy(paintOffset);
+    paintBoxDecorationsWithRect(paintInfo, paintOffset, paintRect);
+}
 
+void RenderBox::paintBoxDecorationsWithRect(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const LayoutRect& paintRect)
+{
     BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context);
 
     // FIXME: Should eventually give the theme control over whether the box shadow should paint, since controls could have
@@ -1126,6 +1130,14 @@
         paintInfo.context->beginTransparencyLayer(1);
     }
 
+    paintBackgroundWithBorderAndBoxShadow(paintInfo, paintRect, bleedAvoidance);
+
+    if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
+        paintInfo.context->endLayer();
+}
+
+void RenderBox::paintBackgroundWithBorderAndBoxShadow(PaintInfo& paintInfo, const LayoutRect& paintRect, BackgroundBleedAvoidance bleedAvoidance)
+{
     // If we have a native theme appearance, paint that before painting our background.
     // The theme will tell us whether or not we should also paint the CSS background.
     IntRect snappedPaintRect(pixelSnappedIntRect(paintRect));
@@ -1144,9 +1156,6 @@
     // The theme will tell us whether or not we should also paint the CSS border.
     if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style()->hasAppearance() || (!themePainted && RenderTheme::theme().paintBorderOnly(this, paintInfo, snappedPaintRect))) && style()->hasBorder())
         paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
-
-    if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
-        paintInfo.context->endLayer();
 }
 
 void RenderBox::paintBackground(const PaintInfo& paintInfo, const LayoutRect& paintRect, BackgroundBleedAvoidance bleedAvoidance)
@@ -1317,6 +1326,18 @@
     paintMaskImages(paintInfo, paintRect);
 }
 
+void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+    if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDisabled())
+        return;
+
+    if (!layer() || !layer()->isComposited())
+        return;
+
+    LayoutRect paintRect = LayoutRect(paintOffset, size());
+    paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black);
+}
+
 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& paintRect)
 {
     // Figure out if we need to push a transparency layer to render our mask.
@@ -3084,6 +3105,8 @@
         for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) {
             if (curr->isBox()) {
                 staticPosition += toRenderBox(curr)->logicalLeft();
+                if (toRenderBox(curr)->isRelPositioned())
+                    staticPosition += toRenderBox(curr)->relativePositionOffset().width();
                 if (region && curr->isRenderBlock()) {
                     const RenderBlock* cb = toRenderBlock(curr);
                     region = cb->clampToStartAndEndRegions(region);
@@ -3091,16 +3114,26 @@
                     if (boxInfo)
                         staticPosition += boxInfo->logicalLeft();
                 }
+            } else if (curr->isInline()) {
+                if (curr->isRelPositioned()) {
+                    if (!curr->style()->logicalLeft().isAuto())
+                        staticPosition += curr->style()->logicalLeft().value();
+                    else
+                        staticPosition -= curr->style()->logicalRight().value();
+                }
             }
         }
         logicalLeft.setValue(Fixed, staticPosition);
     } else {
         RenderBox* enclosingBox = child->parent()->enclosingBox();
         LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalLeft();
-        for (RenderObject* curr = enclosingBox; curr; curr = curr->container()) {
+        for (RenderObject* curr = child->parent(); curr; curr = curr->container()) {
             if (curr->isBox()) {
-                if (curr != containerBlock)
+                if (curr != containerBlock) {
                     staticPosition -= toRenderBox(curr)->logicalLeft();
+                    if (toRenderBox(curr)->isRelPositioned())
+                        staticPosition -= toRenderBox(curr)->relativePositionOffset().width();
+                }
                 if (curr == enclosingBox)
                     staticPosition -= enclosingBox->logicalWidth();
                 if (region && curr->isRenderBlock()) {
@@ -3114,6 +3147,13 @@
                             staticPosition += enclosingBox->logicalWidth() - boxInfo->logicalWidth();
                     }
                 }
+            } else if (curr->isInline()) {
+                if (curr->isRelPositioned()) {
+                    if (!curr->style()->logicalLeft().isAuto())
+                        staticPosition -= curr->style()->logicalLeft().value();
+                    else
+                        staticPosition += curr->style()->logicalRight().value();
+                }
             }
             if (curr == containerBlock)
                 break;
diff --git a/Source/core/rendering/RenderBox.h b/Source/core/rendering/RenderBox.h
index 208cfe7..88d627d 100644
--- a/Source/core/rendering/RenderBox.h
+++ b/Source/core/rendering/RenderBox.h
@@ -491,6 +491,7 @@
     virtual void paintObject(PaintInfo&, const LayoutPoint&) { ASSERT_NOT_REACHED(); }
     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
     virtual void paintMask(PaintInfo&, const LayoutPoint&);
+    virtual void paintClippingMask(PaintInfo&, const LayoutPoint&);
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
 
     // Called when a positioned object moves but doesn't necessarily change size.  A simplified layout is attempted
@@ -608,12 +609,14 @@
     virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned maxDepthToTest) const;
     virtual bool computeBackgroundIsKnownToBeObscured() OVERRIDE;
 
+    virtual void paintBackgroundWithBorderAndBoxShadow(PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance);
     void paintBackground(const PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone);
 
     void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
     void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
 
     void paintMaskImages(const PaintInfo&, const LayoutRect&);
+    void paintBoxDecorationsWithRect(PaintInfo&, const LayoutPoint&, const LayoutRect&);
 
     BackgroundBleedAvoidance determineBackgroundBleedAvoidance(GraphicsContext*) const;
     bool backgroundHasOpaqueTopLayer() const;
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index aada216..932db84 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -742,6 +742,7 @@
             RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
             RefPtr<Image> image = bgImage->image(clientForBackgroundImage, geometry.tileSize());
             bool useLowQualityScaling = shouldPaintAtLowQuality(context, image.get(), bgLayer, geometry.tileSize());
+            context->setDrawLuminanceMask(bgLayer->maskSourceType() == MaskLuminance);
             context->drawTiledImage(image.get(), geometry.destRect(), geometry.relativePhase(), geometry.tileSize(),
                 compositeOp, useLowQualityScaling, bgLayer->blendMode());
         }
@@ -934,7 +935,7 @@
             float verticalScaleFactor = imageIntrinsicSize.height()
                 ? static_cast<float>(positioningAreaSize.height()) / imageIntrinsicSize.height() : 1;
             float scaleFactor = type == Contain ? min(horizontalScaleFactor, verticalScaleFactor) : max(horizontalScaleFactor, verticalScaleFactor);
-            return IntSize(max(1, static_cast<int>(imageIntrinsicSize.width() * scaleFactor)), max(1, static_cast<int>(imageIntrinsicSize.height() * scaleFactor)));
+            return IntSize(max(1l, lround(imageIntrinsicSize.width() * scaleFactor)), max(1l, lround(imageIntrinsicSize.height() * scaleFactor)));
        }
     }
 
@@ -1062,8 +1063,7 @@
 
     LayoutUnit computedXPosition = minimumValueForLength(fillLayer->xPosition(), availableWidth, renderView, true);
     if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && fillTileSize.width() > 0) {
-        int nrTiles = ceil((double)positioningAreaSize.width() /
-            fillTileSize.width());
+        long nrTiles = lroundf((float)positioningAreaSize.width() / fillTileSize.width());
 
         if (fillLayer->size().size.height().isAuto() && backgroundRepeatY != RoundFill) {
             fillTileSize.setHeight(fillTileSize.height() * positioningAreaSize.width() / (nrTiles * fillTileSize.width()));
@@ -1076,8 +1076,7 @@
 
     LayoutUnit computedYPosition = minimumValueForLength(fillLayer->yPosition(), availableHeight, renderView, true);
     if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && fillTileSize.height() > 0) {
-        int nrTiles = ceil((double)positioningAreaSize.height() /
-            fillTileSize.height());
+        long nrTiles = lroundf((float)positioningAreaSize.height() / fillTileSize.height());
 
         if (fillLayer->size().size.width().isAuto() && backgroundRepeatX != RoundFill) {
             fillTileSize.setWidth(fillTileSize.width() * positioningAreaSize.height() / (nrTiles * fillTileSize.height()));
diff --git a/Source/core/rendering/RenderFlexibleBox.cpp b/Source/core/rendering/RenderFlexibleBox.cpp
index 65f35a4..65c8222 100644
--- a/Source/core/rendering/RenderFlexibleBox.cpp
+++ b/Source/core/rendering/RenderFlexibleBox.cpp
@@ -90,21 +90,6 @@
     return "RenderFlexibleBox";
 }
 
-static LayoutUnit marginLogicalWidthForChild(RenderBox* child, RenderStyle* parentStyle)
-{
-    // A margin has three types: fixed, percentage, and auto (variable).
-    // Auto and percentage margins become 0 when computing min/max width.
-    // Fixed margins can be added in as is.
-    Length marginLeft = child->style()->marginStartUsing(parentStyle);
-    Length marginRight = child->style()->marginEndUsing(parentStyle);
-    LayoutUnit margin = 0;
-    if (marginLeft.isFixed())
-        margin += marginLeft.value();
-    if (marginRight.isFixed())
-        margin += marginRight.value();
-    return margin;
-}
-
 void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
 {
     // FIXME: We're ignoring flex-basis here and we shouldn't. We can't start honoring it though until
@@ -114,7 +99,7 @@
         if (child->isOutOfFlowPositioned())
             continue;
 
-        LayoutUnit margin = marginLogicalWidthForChild(child, style());
+        LayoutUnit margin = marginIntrinsicLogicalWidthForChild(child);
         bool hasOrthogonalWritingMode = child->isHorizontalWritingMode() != isHorizontalWritingMode();
         LayoutUnit minPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->minPreferredLogicalWidth();
         LayoutUnit maxPreferredLogicalWidth = hasOrthogonalWritingMode ? child->logicalHeight() : child->maxPreferredLogicalWidth();
diff --git a/Source/core/rendering/RenderFrameSet.cpp b/Source/core/rendering/RenderFrameSet.cpp
index 86748fb..ba44185 100644
--- a/Source/core/rendering/RenderFrameSet.cpp
+++ b/Source/core/rendering/RenderFrameSet.cpp
@@ -25,8 +25,8 @@
 #include "core/rendering/RenderFrameSet.h"
 
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/HTMLDimension.h"
 #include "core/html/HTMLFrameSetElement.h"
 #include "core/page/EventHandler.h"
diff --git a/Source/core/rendering/RenderGeometryMap.cpp b/Source/core/rendering/RenderGeometryMap.cpp
index 842fbd3..f7dc640 100644
--- a/Source/core/rendering/RenderGeometryMap.cpp
+++ b/Source/core/rendering/RenderGeometryMap.cpp
@@ -36,7 +36,7 @@
 namespace WebCore {
 
 RenderGeometryMap::RenderGeometryMap(MapCoordinatesFlags flags)
-    : m_insertionPosition(notFound)
+    : m_insertionPosition(kNotFound)
     , m_nonUniformStepsCount(0)
     , m_transformedStepsCount(0)
     , m_fixedStepsCount(0)
@@ -229,7 +229,7 @@
 {
 //    fprintf(stderr, "RenderGeometryMap::push %p %d,%d isNonUniform=%d\n", renderer, offsetFromContainer.width().toInt(), offsetFromContainer.height().toInt(), isNonUniform);
 
-    ASSERT(m_insertionPosition != notFound);
+    ASSERT(m_insertionPosition != kNotFound);
     ASSERT(!renderer->isRenderView() || !m_insertionPosition || m_mapCoordinatesFlags & TraverseDocumentBoundaries);
     ASSERT(offsetForFixedPosition.isZero() || renderer->isRenderView());
 
@@ -244,7 +244,7 @@
 
 void RenderGeometryMap::push(const RenderObject* renderer, const TransformationMatrix& t, bool accumulatingTransform, bool isNonUniform, bool isFixedPosition, bool hasTransform, LayoutSize offsetForFixedPosition)
 {
-    ASSERT(m_insertionPosition != notFound);
+    ASSERT(m_insertionPosition != kNotFound);
     ASSERT(!renderer->isRenderView() || !m_insertionPosition || m_mapCoordinatesFlags & TraverseDocumentBoundaries);
     ASSERT(offsetForFixedPosition.isZero() || renderer->isRenderView());
 
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index 887c26b..86e84fa 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -146,6 +146,24 @@
     size_t m_childIndex;
 };
 
+struct RenderGrid::GridSizingData {
+    WTF_MAKE_NONCOPYABLE(GridSizingData);
+public:
+    GridSizingData(size_t gridColumnCount, size_t gridRowCount)
+        : columnTracks(gridColumnCount)
+        , rowTracks(gridRowCount)
+    {
+    }
+
+    Vector<GridTrack> columnTracks;
+    Vector<GridTrack> rowTracks;
+    Vector<size_t> contentSizedTracksIndex;
+
+    // Performance optimization: hold onto these Vectors until the end of Layout to avoid repeated malloc / free.
+    Vector<LayoutUnit> distributeTrackVector;
+    Vector<GridTrack*> filteredTracks;
+};
+
 RenderGrid::RenderGrid(Element* element)
     : RenderBlock(element)
     , m_gridIsDirty(true)
@@ -333,20 +351,18 @@
     if (length.isMinContent()) {
         LayoutUnit minContentSize = 0;
         GridIterator iterator(m_grid, ForColumns, trackIndex);
-        while (RenderBox* gridItem = iterator.nextGridItem()) {
-            // FIXME: We should include the child's fixed margins like RenderFlexibleBox.
-            minContentSize = std::max(minContentSize, gridItem->minPreferredLogicalWidth());
-        }
+        while (RenderBox* gridItem = iterator.nextGridItem())
+            minContentSize = std::max(minContentSize, gridItem->minPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(gridItem));
+
         return minContentSize;
     }
 
     if (length.isMaxContent()) {
         LayoutUnit maxContentSize = 0;
         GridIterator iterator(m_grid, ForColumns, trackIndex);
-        while (RenderBox* gridItem = iterator.nextGridItem()) {
-            // FIXME: We should include the child's fixed margins like RenderFlexibleBox.
-            maxContentSize = std::max(maxContentSize, gridItem->maxPreferredLogicalWidth());
-        }
+        while (RenderBox* gridItem = iterator.nextGridItem())
+            maxContentSize = std::max(maxContentSize, gridItem->maxPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(gridItem));
+
         return maxContentSize;
     }
 
@@ -355,11 +371,11 @@
     return 0;
 }
 
-void RenderGrid::computedUsedBreadthOfGridTracks(TrackSizingDirection direction, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks)
+void RenderGrid::computedUsedBreadthOfGridTracks(TrackSizingDirection direction, GridSizingData& sizingData)
 {
     LayoutUnit availableLogicalSpace = (direction == ForColumns) ? availableLogicalWidth() : availableLogicalHeight(IncludeMarginBorderPadding);
-    Vector<GridTrack>& tracks = (direction == ForColumns) ? columnTracks : rowTracks;
-    Vector<size_t> contentSizedTracks;
+    Vector<GridTrack>& tracks = (direction == ForColumns) ? sizingData.columnTracks : sizingData.rowTracks;
+    sizingData.contentSizedTracksIndex.shrink(0);
     for (size_t i = 0; i < tracks.size(); ++i) {
         GridTrack& track = tracks[i];
         const GridTrackSize& trackSize = gridTrackSize(direction, i);
@@ -372,11 +388,11 @@
         track.m_maxBreadth = std::max(track.m_maxBreadth, track.m_usedBreadth);
 
         if (trackSize.isContentSized())
-            contentSizedTracks.append(i);
+            sizingData.contentSizedTracksIndex.append(i);
     }
 
-    if (!contentSizedTracks.isEmpty())
-        resolveContentBasedTrackSizingFunctions(direction, columnTracks, rowTracks, contentSizedTracks, availableLogicalSpace);
+    if (!sizingData.contentSizedTracksIndex.isEmpty())
+        resolveContentBasedTrackSizingFunctions(direction, sizingData, availableLogicalSpace);
 
     for (size_t i = 0; i < tracks.size(); ++i) {
         ASSERT(tracks[i].m_maxBreadth != infinity);
@@ -391,7 +407,7 @@
     for (size_t i = 0; i < tracksSize; ++i)
         tracksForDistribution[i] = tracks.data() + i;
 
-    distributeSpaceToTracks(tracksForDistribution, 0, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth, availableLogicalSpace);
+    distributeSpaceToTracks(tracksForDistribution, 0, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth, sizingData, availableLogicalSpace);
 
     // 4. Grow all Grid tracks having a fraction as the MaxTrackSizingFunction.
 
@@ -565,54 +581,54 @@
     return logicalContentHeightForChild(child, columnTracks);
 }
 
-void RenderGrid::resolveContentBasedTrackSizingFunctions(TrackSizingDirection direction, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, Vector<size_t> contentSizedTracks, LayoutUnit& availableLogicalSpace)
+void RenderGrid::resolveContentBasedTrackSizingFunctions(TrackSizingDirection direction, GridSizingData& sizingData, LayoutUnit& availableLogicalSpace)
 {
     // FIXME: Split the grid tracks into groups that doesn't overlap a <flex> grid track (crbug.com/235258).
 
     // FIXME: Per step 2 of the specification, we should order the grid items by increasing span.
 
-    for (size_t i = 0; i < contentSizedTracks.size(); ++i) {
-        GridIterator iterator(m_grid, direction, contentSizedTracks[i]);
+    for (size_t i = 0; i < sizingData.contentSizedTracksIndex.size(); ++i) {
+        GridIterator iterator(m_grid, direction, sizingData.contentSizedTracksIndex[i]);
         while (RenderBox* gridItem = iterator.nextGridItem()) {
-            resolveContentBasedTrackSizingFunctionsForItems(direction, columnTracks, rowTracks, gridItem, &GridTrackSize::hasMinOrMaxContentMinTrackBreadth, &RenderGrid::minContentForChild, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth);
-            resolveContentBasedTrackSizingFunctionsForItems(direction, columnTracks, rowTracks, gridItem, &GridTrackSize::hasMaxContentMinTrackBreadth, &RenderGrid::maxContentForChild, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth);
-            resolveContentBasedTrackSizingFunctionsForItems(direction, columnTracks, rowTracks, gridItem, &GridTrackSize::hasMinOrMaxContentMaxTrackBreadth, &RenderGrid::minContentForChild, &GridTrack::maxBreadthIfNotInfinite, &GridTrack::growMaxBreadth);
-            resolveContentBasedTrackSizingFunctionsForItems(direction, columnTracks, rowTracks, gridItem, &GridTrackSize::hasMaxContentMaxTrackBreadth, &RenderGrid::maxContentForChild, &GridTrack::maxBreadthIfNotInfinite, &GridTrack::growMaxBreadth);
+            resolveContentBasedTrackSizingFunctionsForItems(direction, sizingData, gridItem, &GridTrackSize::hasMinOrMaxContentMinTrackBreadth, &RenderGrid::minContentForChild, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth);
+            resolveContentBasedTrackSizingFunctionsForItems(direction, sizingData, gridItem, &GridTrackSize::hasMaxContentMinTrackBreadth, &RenderGrid::maxContentForChild, &GridTrack::usedBreadth, &GridTrack::growUsedBreadth);
+            resolveContentBasedTrackSizingFunctionsForItems(direction, sizingData, gridItem, &GridTrackSize::hasMinOrMaxContentMaxTrackBreadth, &RenderGrid::minContentForChild, &GridTrack::maxBreadthIfNotInfinite, &GridTrack::growMaxBreadth);
+            resolveContentBasedTrackSizingFunctionsForItems(direction, sizingData, gridItem, &GridTrackSize::hasMaxContentMaxTrackBreadth, &RenderGrid::maxContentForChild, &GridTrack::maxBreadthIfNotInfinite, &GridTrack::growMaxBreadth);
         }
 
-        GridTrack& track = (direction == ForColumns) ? columnTracks[i] : rowTracks[i];
+        GridTrack& track = (direction == ForColumns) ? sizingData.columnTracks[i] : sizingData.rowTracks[i];
         if (track.m_maxBreadth == infinity)
             track.m_maxBreadth = track.m_usedBreadth;
     }
 }
 
-void RenderGrid::resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection direction, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, RenderBox* gridItem, FilterFunction filterFunction, SizingFunction sizingFunction, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction)
+void RenderGrid::resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection direction, GridSizingData& sizingData, RenderBox* gridItem, FilterFunction filterFunction, SizingFunction sizingFunction, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction)
 {
     const GridCoordinate coordinate = cachedGridCoordinate(gridItem);
     const size_t initialTrackIndex = (direction == ForColumns) ? coordinate.columns.initialPositionIndex : coordinate.rows.initialPositionIndex;
     const size_t finalTrackIndex = (direction == ForColumns) ? coordinate.columns.finalPositionIndex : coordinate.rows.finalPositionIndex;
 
-    Vector<GridTrack*> tracks;
+    sizingData.filteredTracks.shrink(0);
     for (size_t trackIndex = initialTrackIndex; trackIndex <= finalTrackIndex; ++trackIndex) {
         const GridTrackSize& trackSize = gridTrackSize(direction, trackIndex);
         if (!(trackSize.*filterFunction)())
             continue;
 
-        GridTrack& track = (direction == ForColumns) ? columnTracks[trackIndex] : rowTracks[trackIndex];
-        tracks.append(&track);
+        GridTrack& track = (direction == ForColumns) ? sizingData.columnTracks[trackIndex] : sizingData.rowTracks[trackIndex];
+        sizingData.filteredTracks.append(&track);
     }
 
-    if (tracks.isEmpty())
+    if (sizingData.filteredTracks.isEmpty())
         return;
 
-    LayoutUnit additionalBreadthSpace = (this->*sizingFunction)(gridItem, direction, columnTracks);
+    LayoutUnit additionalBreadthSpace = (this->*sizingFunction)(gridItem, direction, sizingData.columnTracks);
     for (size_t trackIndexForSpace = initialTrackIndex; trackIndexForSpace <= finalTrackIndex; ++trackIndexForSpace) {
-        GridTrack& track = (direction == ForColumns) ? columnTracks[trackIndexForSpace] : rowTracks[trackIndexForSpace];
+        GridTrack& track = (direction == ForColumns) ? sizingData.columnTracks[trackIndexForSpace] : sizingData.rowTracks[trackIndexForSpace];
         additionalBreadthSpace -= (track.*trackGetter)();
     }
 
     // FIXME: We should pass different values for |tracksForGrowthAboveMaxBreadth|.
-    distributeSpaceToTracks(tracks, &tracks, trackGetter, trackGrowthFunction, additionalBreadthSpace);
+    distributeSpaceToTracks(sizingData.filteredTracks, &sizingData.filteredTracks, trackGetter, trackGrowthFunction, sizingData, additionalBreadthSpace);
 }
 
 static bool sortByGridTrackGrowthPotential(const GridTrack* track1, const GridTrack* track2)
@@ -620,12 +636,12 @@
     return (track1->m_maxBreadth - track1->m_usedBreadth) < (track2->m_maxBreadth - track2->m_usedBreadth);
 }
 
-void RenderGrid::distributeSpaceToTracks(Vector<GridTrack*>& tracks, Vector<GridTrack*>* tracksForGrowthAboveMaxBreadth, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction, LayoutUnit& availableLogicalSpace)
+void RenderGrid::distributeSpaceToTracks(Vector<GridTrack*>& tracks, Vector<GridTrack*>* tracksForGrowthAboveMaxBreadth, AccumulatorGetter trackGetter, AccumulatorGrowFunction trackGrowthFunction, GridSizingData& sizingData, LayoutUnit& availableLogicalSpace)
 {
     std::sort(tracks.begin(), tracks.end(), sortByGridTrackGrowthPotential);
 
     size_t tracksSize = tracks.size();
-    Vector<LayoutUnit> updatedTrackBreadths(tracksSize);
+    sizingData.distributeTrackVector.resize(tracksSize);
 
     for (size_t i = 0; i < tracksSize; ++i) {
         GridTrack& track = *tracks[i];
@@ -633,7 +649,7 @@
         LayoutUnit trackBreadth = (tracks[i]->*trackGetter)();
         LayoutUnit growthShare = std::max(LayoutUnit(), std::min(availableLogicalSpaceShare, track.m_maxBreadth - trackBreadth));
         // We should never shrink any grid track or else we can't guarantee we abide by our min-sizing function.
-        updatedTrackBreadths[i] = trackBreadth + growthShare;
+        sizingData.distributeTrackVector[i] = trackBreadth + growthShare;
         availableLogicalSpace -= growthShare;
     }
 
@@ -641,13 +657,13 @@
         tracksSize = tracksForGrowthAboveMaxBreadth->size();
         for (size_t i = 0; i < tracksSize; ++i) {
             LayoutUnit growthShare = availableLogicalSpace / (tracksSize - i);
-            updatedTrackBreadths[i] += growthShare;
+            sizingData.distributeTrackVector[i] += growthShare;
             availableLogicalSpace -= growthShare;
         }
     }
 
     for (size_t i = 0; i < tracksSize; ++i) {
-        LayoutUnit growth = updatedTrackBreadths[i] - (tracks[i]->*trackGetter)();
+        LayoutUnit growth = sizingData.distributeTrackVector[i] - (tracks[i]->*trackGetter)();
         if (growth >= 0)
             (tracks[i]->*trackGrowthFunction)(growth);
     }
@@ -771,7 +787,7 @@
         m_grid[i].grow(maximumColumnIndex);
 }
 
-void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
+void RenderGrid::placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>& autoGridItems)
 {
     for (size_t i = 0; i < autoGridItems.size(); ++i) {
         OwnPtr<GridSpan> majorAxisPositions = resolveGridPositionsFromStyle(autoGridItems[i], autoPlacementMajorAxisDirection());
@@ -788,7 +804,7 @@
     }
 }
 
-void RenderGrid::placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*> autoGridItems)
+void RenderGrid::placeAutoMajorAxisItemsOnGrid(const Vector<RenderBox*>& autoGridItems)
 {
     for (size_t i = 0; i < autoGridItems.size(); ++i)
         placeAutoMajorAxisItemOnGrid(autoGridItems[i]);
@@ -849,14 +865,13 @@
 {
     placeItemsOnGrid();
 
-    Vector<GridTrack> columnTracks(gridColumnCount());
-    Vector<GridTrack> rowTracks(gridRowCount());
-    computedUsedBreadthOfGridTracks(ForColumns, columnTracks, rowTracks);
-    ASSERT(tracksAreWiderThanMinTrackBreadth(ForColumns, columnTracks));
-    computedUsedBreadthOfGridTracks(ForRows, columnTracks, rowTracks);
-    ASSERT(tracksAreWiderThanMinTrackBreadth(ForRows, rowTracks));
+    GridSizingData sizingData(gridColumnCount(), gridRowCount());
+    computedUsedBreadthOfGridTracks(ForColumns, sizingData);
+    ASSERT(tracksAreWiderThanMinTrackBreadth(ForColumns, sizingData.columnTracks));
+    computedUsedBreadthOfGridTracks(ForRows, sizingData);
+    ASSERT(tracksAreWiderThanMinTrackBreadth(ForRows, sizingData.rowTracks));
 
-    populateGridPositions(columnTracks, rowTracks);
+    populateGridPositions(sizingData);
 
     for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
         // Because the grid area cannot be styled, we don't need to adjust
@@ -864,8 +879,8 @@
         LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit();
         LayoutUnit oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit();
 
-        LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
-        LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, rowTracks);
+        LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, sizingData.columnTracks);
+        LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, sizingData.rowTracks);
 
         SubtreeLayoutScope layoutScope(child);
         if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (child->hasRelativeLogicalHeight() && oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight))
@@ -881,7 +896,7 @@
         // now, just size as if we were a regular child.
         child->layoutIfNeeded();
 
-        child->setLogicalLocation(findChildLogicalPosition(child, columnTracks, rowTracks));
+        child->setLogicalLocation(findChildLogicalPosition(child, sizingData));
 
         // If the child moved, we have to repaint it as well as any floating/positioned
         // descendants. An exception is if we need a layout. In this case, we know we're going to
@@ -890,8 +905,8 @@
             child->repaintDuringLayoutIfMoved(oldChildRect);
     }
 
-    for (size_t i = 0; i < rowTracks.size(); ++i)
-        setLogicalHeight(logicalHeight() + rowTracks[i].m_usedBreadth);
+    for (size_t i = 0; i < sizingData.rowTracks.size(); ++i)
+        setLogicalHeight(logicalHeight() + sizingData.rowTracks[i].m_usedBreadth);
 
     // FIXME: We should handle min / max logical height.
 
@@ -1120,24 +1135,24 @@
     return gridAreaBreadth;
 }
 
-void RenderGrid::populateGridPositions(const Vector<GridTrack>& columnTracks, const Vector<GridTrack>& rowTracks)
+void RenderGrid::populateGridPositions(const GridSizingData& sizingData)
 {
-    m_columnPositions.resize(columnTracks.size() + 1);
+    m_columnPositions.resize(sizingData.columnTracks.size() + 1);
     m_columnPositions[0] = borderAndPaddingStart();
     for (size_t i = 0; i < m_columnPositions.size() - 1; ++i)
-        m_columnPositions[i + 1] = m_columnPositions[i] + columnTracks[i].m_usedBreadth;
+        m_columnPositions[i + 1] = m_columnPositions[i] + sizingData.columnTracks[i].m_usedBreadth;
 
-    m_rowPositions.resize(rowTracks.size() + 1);
+    m_rowPositions.resize(sizingData.rowTracks.size() + 1);
     m_rowPositions[0] = borderAndPaddingBefore();
     for (size_t i = 0; i < m_rowPositions.size() - 1; ++i)
-        m_rowPositions[i + 1] = m_rowPositions[i] + rowTracks[i].m_usedBreadth;
+        m_rowPositions[i + 1] = m_rowPositions[i] + sizingData.rowTracks[i].m_usedBreadth;
 }
 
-LayoutPoint RenderGrid::findChildLogicalPosition(RenderBox* child, const Vector<GridTrack>& columnTracks, const Vector<GridTrack>& rowTracks)
+LayoutPoint RenderGrid::findChildLogicalPosition(RenderBox* child, const GridSizingData& sizingData)
 {
     const GridCoordinate& coordinate = cachedGridCoordinate(child);
-    ASSERT(coordinate.columns.initialPositionIndex < columnTracks.size());
-    ASSERT(coordinate.rows.initialPositionIndex < rowTracks.size());
+    ASSERT(coordinate.columns.initialPositionIndex < sizingData.columnTracks.size());
+    ASSERT(coordinate.rows.initialPositionIndex < sizingData.rowTracks.size());
 
     // The grid items should be inside the grid container's border box, that's why they need to be shifted.
     return LayoutPoint(m_columnPositions[coordinate.columns.initialPositionIndex] + marginStartForChild(child), m_rowPositions[coordinate.rows.initialPositionIndex] + marginBeforeForChild(child));
@@ -1172,7 +1187,7 @@
 
         for (size_t row = dirtiedRows.initialPositionIndex; row < dirtiedRows.finalPositionIndex; ++row) {
             for (size_t column = dirtiedColumns.initialPositionIndex; column < dirtiedColumns.finalPositionIndex; ++column) {
-                const Vector<RenderBox*, 1> children = m_grid[row][column];
+                const Vector<RenderBox*, 1>& children = m_grid[row][column];
                 // FIXME: If we start adding spanning children in all grid areas they span, this
                 // would make us paint them several times, which is wrong!
                 for (size_t j = 0; j < children.size(); ++j)
diff --git a/Source/core/rendering/RenderGrid.h b/Source/core/rendering/RenderGrid.h
index 50b58c1..2f9ea1f 100644
--- a/Source/core/rendering/RenderGrid.h
+++ b/Source/core/rendering/RenderGrid.h
@@ -72,26 +72,27 @@
     LayoutUnit computePreferredTrackWidth(const GridLength&, size_t) const;
 
     class GridIterator;
+    class GridSizingData;
     enum TrackSizingDirection { ForColumns, ForRows };
-    void computedUsedBreadthOfGridTracks(TrackSizingDirection, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks);
+    void computedUsedBreadthOfGridTracks(TrackSizingDirection, GridSizingData&);
     LayoutUnit computeUsedBreadthOfMinLength(TrackSizingDirection, const GridLength&) const;
     LayoutUnit computeUsedBreadthOfMaxLength(TrackSizingDirection, const GridLength&, LayoutUnit usedBreadth) const;
     LayoutUnit computeUsedBreadthOfSpecifiedLength(TrackSizingDirection, const Length&) const;
-    void resolveContentBasedTrackSizingFunctions(TrackSizingDirection, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, Vector<size_t>, LayoutUnit& availableLogicalSpace);
+    void resolveContentBasedTrackSizingFunctions(TrackSizingDirection, GridSizingData&, LayoutUnit& availableLogicalSpace);
 
     void growGrid(TrackSizingDirection);
     void insertItemIntoGrid(RenderBox*, size_t rowTrack, size_t columnTrack);
     void insertItemIntoGrid(RenderBox*, const GridCoordinate&);
     void placeItemsOnGrid();
     void populateExplicitGridAndOrderIterator();
-    void placeSpecifiedMajorAxisItemsOnGrid(Vector<RenderBox*>);
-    void placeAutoMajorAxisItemsOnGrid(Vector<RenderBox*>);
+    void placeSpecifiedMajorAxisItemsOnGrid(const Vector<RenderBox*>&);
+    void placeAutoMajorAxisItemsOnGrid(const Vector<RenderBox*>&);
     void placeAutoMajorAxisItemOnGrid(RenderBox*);
     TrackSizingDirection autoPlacementMajorAxisDirection() const;
     TrackSizingDirection autoPlacementMinorAxisDirection() const;
 
     void layoutGridItems();
-    void populateGridPositions(const Vector<GridTrack>& columnTracks, const Vector<GridTrack>& rowTracks);
+    void populateGridPositions(const GridSizingData&);
 
     virtual bool supportsPartialLayout() const OVERRIDE { return false; }
 
@@ -99,8 +100,8 @@
     typedef LayoutUnit (GridTrack::* AccumulatorGetter)() const;
     typedef void (GridTrack::* AccumulatorGrowFunction)(LayoutUnit);
     typedef bool (GridTrackSize::* FilterFunction)() const;
-    void resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection, Vector<GridTrack>& columnTracks, Vector<GridTrack>& rowTracks, RenderBox*, FilterFunction, SizingFunction, AccumulatorGetter, AccumulatorGrowFunction);
-    void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracksForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, LayoutUnit& availableLogicalSpace);
+    void resolveContentBasedTrackSizingFunctionsForItems(TrackSizingDirection, GridSizingData&, RenderBox*, FilterFunction, SizingFunction, AccumulatorGetter, AccumulatorGrowFunction);
+    void distributeSpaceToTracks(Vector<GridTrack*>&, Vector<GridTrack*>* tracksForGrowthAboveMaxBreadth, AccumulatorGetter, AccumulatorGrowFunction, GridSizingData&, LayoutUnit& availableLogicalSpace);
 
     double computeNormalizedFractionBreadth(Vector<GridTrack>&, TrackSizingDirection, LayoutUnit availableLogicalSpace) const;
 
@@ -112,7 +113,7 @@
     LayoutUnit logicalContentHeightForChild(RenderBox*, Vector<GridTrack>&);
     LayoutUnit minContentForChild(RenderBox*, TrackSizingDirection, Vector<GridTrack>& columnTracks);
     LayoutUnit maxContentForChild(RenderBox*, TrackSizingDirection, Vector<GridTrack>& columnTracks);
-    LayoutPoint findChildLogicalPosition(RenderBox*, const Vector<GridTrack>& columnTracks, const Vector<GridTrack>& rowTracks);
+    LayoutPoint findChildLogicalPosition(RenderBox*, const GridSizingData&);
     GridCoordinate cachedGridCoordinate(const RenderBox*) const;
 
     GridSpan resolveGridPositionsFromAutoPlacementPosition(const RenderBox*, TrackSizingDirection, size_t) const;
diff --git a/Source/core/rendering/RenderImage.cpp b/Source/core/rendering/RenderImage.cpp
index e622c9c..8a2c637 100644
--- a/Source/core/rendering/RenderImage.cpp
+++ b/Source/core/rendering/RenderImage.cpp
@@ -517,6 +517,9 @@
     // Background shows in padding area.
     if ((backgroundClip == BorderFillBox || backgroundClip == PaddingFillBox) && style()->hasPadding())
         return false;
+    // Object-position may leave parts of the content box empty, regardless of the value of object-fit.
+    if (style()->objectPosition() != RenderStyle::initialObjectPosition())
+        return false;
     // Object-fit may leave parts of the content box empty.
     ObjectFit objectFit = style()->objectFit();
     if (objectFit != ObjectFitFill && objectFit != ObjectFitCover)
diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
index 2e5e260..bf22001 100644
--- a/Source/core/rendering/RenderLayer.cpp
+++ b/Source/core/rendering/RenderLayer.cpp
@@ -50,7 +50,7 @@
 #include "SVGNames.h"
 #include "core/css/PseudoStyleRequest.h"
 #include "core/dom/Document.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/html/HTMLFrameElement.h"
 #include "core/html/HTMLFrameOwnerElement.h"
@@ -158,7 +158,6 @@
     , m_staticInlinePosition(0)
     , m_staticBlockPosition(0)
     , m_reflection(0)
-    , m_scrollCorner(0)
     , m_resizer(0)
     , m_enclosingPaginationLayer(0)
     , m_forceNeedsCompositedScrolling(DoNotForceCompositedScrolling)
@@ -212,8 +211,6 @@
 
     clearBacking(true);
 
-    if (m_scrollCorner)
-        m_scrollCorner->destroy();
     if (m_resizer)
         m_resizer->destroy();
 }
@@ -561,7 +558,7 @@
 
     if (!posZOrderListBeforePromote)
         posZOrderListBeforePromote = adoptPtr(new Vector<RenderLayer*>());
-    else if (posZOrderListBeforePromote->find(this) != notFound)
+    else if (posZOrderListBeforePromote->find(this) != kNotFound)
         return;
 
     // The current layer will appear in the z-order lists after promotion, so
@@ -2490,20 +2487,10 @@
     scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 
-bool RenderLayer::canResize() const
-{
-    if (!renderer())
-        return false;
-    // We need a special case for <iframe> because they never have
-    // hasOverflowClip(). However, they do "implicitly" clip their contents, so
-    // we want to allow resizing them also.
-    return (renderer()->hasOverflowClip() || renderer()->isRenderIFrame()) && renderer()->style()->resize() != RESIZE_NONE;
-}
-
 void RenderLayer::resize(const PlatformEvent& evt, const LayoutSize& oldOffset)
 {
     // FIXME: This should be possible on generated content but is not right now.
-    if (!inResizeMode() || !canResize() || !renderer()->node())
+    if (!inResizeMode() || !renderer()->canResize() || !renderer()->node())
         return;
 
     ASSERT(renderer()->node()->isElementNode());
@@ -2712,13 +2699,6 @@
 
 void RenderLayer::invalidateScrollCornerRect(const IntRect& rect)
 {
-    if (GraphicsLayer* layer = layerForScrollCorner()) {
-        layer->setNeedsDisplayInRect(rect);
-        return;
-    }
-
-    if (m_scrollCorner)
-        m_scrollCorner->repaintRectangle(rect);
     if (m_resizer)
         m_resizer->repaintRectangle(rect);
 }
@@ -2760,12 +2740,12 @@
 
 bool RenderLayer::hasOverflowControls() const
 {
-    return m_scrollableArea->hasScrollbar() || m_scrollCorner || renderer()->style()->resize() != RESIZE_NONE;
+    return m_scrollableArea->hasScrollbar() || m_scrollableArea->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE;
 }
 
 void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
 {
-    if (!m_scrollableArea->hasScrollbar() && !canResize())
+    if (!m_scrollableArea->hasScrollbar() && !renderer()->canResize())
         return;
 
     RenderBox* box = renderBox();
@@ -2775,10 +2755,6 @@
     m_scrollableArea->positionOverflowControls(offsetFromRoot);
 
     const IntRect borderBox = box->pixelSnappedBorderBoxRect();
-    const IntRect& scrollCorner = scrollCornerRect();
-    IntRect absBounds(borderBox.location() + offsetFromRoot, borderBox.size());
-    if (m_scrollCorner)
-        m_scrollCorner->setFrameRect(scrollCorner);
     if (m_resizer)
         m_resizer->setFrameRect(resizerCornerRect(borderBox, ResizerForPointer));
 
@@ -2848,38 +2824,13 @@
     if (layerForScrollCorner())
         return;
 
-    // We fill our scroll corner with white if we have a scrollbar that doesn't run all the way up to the
-    // edge of the box.
-    paintScrollCorner(context, adjustedPaintOffset, damageRect);
-
     // Paint our resizer last, since it sits on top of the scroll corner.
     paintResizer(context, adjustedPaintOffset, damageRect);
 }
 
 void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
 {
-    RenderBox* box = renderBox();
-    ASSERT(box);
-
-    IntRect absRect = scrollCornerRect();
-    absRect.moveBy(paintOffset);
-    if (!absRect.intersects(damageRect))
-        return;
-
-    if (context->updatingControlTints()) {
-        updateScrollCornerStyle();
-        return;
-    }
-
-    if (m_scrollCorner) {
-        m_scrollCorner->paintIntoRect(context, paintOffset, absRect);
-        return;
-    }
-
-    // We don't want to paint white if we have overlay scrollbars, since we need
-    // to see what is behind it.
-    if (!hasOverlayScrollbars())
-        context->fillRect(absRect, Color::white);
+    m_scrollableArea->paintScrollCorner(context, paintOffset, damageRect);
 }
 
 void RenderLayer::drawPlatformResizerImage(GraphicsContext* context, IntRect resizerCornerRect)
@@ -2953,7 +2904,7 @@
 bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint,
                                          ResizerHitTestType resizerHitTestType) const
 {
-    if (!canResize())
+    if (!renderer()->canResize())
         return false;
 
     RenderBox* box = renderBox();
@@ -2966,7 +2917,7 @@
 
 bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint)
 {
-    if (!m_scrollableArea->hasScrollbar() && !canResize())
+    if (!m_scrollableArea->hasScrollbar() && !renderer()->canResize())
         return false;
 
     RenderBox* box = renderBox();
@@ -2979,8 +2930,6 @@
             return true;
     }
 
-    // FIXME: We should hit test the m_scrollCorner and pass it back through the result.
-
     return m_scrollableArea->hitTestOverflowControls(result, localPoint, resizeControlRect);
 }
 
@@ -3331,6 +3280,7 @@
     bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForeground;
     bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars;
     bool shouldPaintMask = (paintFlags & PaintLayerPaintingCompositingMaskPhase) && shouldPaintContent && renderer()->hasMask() && !selectionOnly;
+    bool shouldPaintClippingMask = (paintFlags & PaintLayerPaintingChildClippingMaskPhase) && renderer()->style()->hasBorderRadius() && shouldPaintContent && !selectionOnly;
 
     PaintBehavior paintBehavior = PaintBehaviorNormal;
     if (paintFlags & PaintLayerPaintingSkipRootBackground)
@@ -3386,6 +3336,11 @@
     if (shouldPaintMask)
         paintMaskForFragments(layerFragments, context, localPaintingInfo, paintingRootForRenderer);
 
+    if (shouldPaintClippingMask) {
+        // Paint the border radius mask for the fragments.
+        paintChildClippingMaskForFragments(layerFragments, context, localPaintingInfo, paintingRootForRenderer);
+    }
+
     // End our transparency layer
     if (haveTransparency && m_usedTransparency && !m_paintingInsideReflection) {
         context->endLayer();
@@ -3688,6 +3643,26 @@
     }
 }
 
+void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layerFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo,
+    RenderObject* paintingRootForRenderer)
+{
+    for (size_t i = 0; i < layerFragments.size(); ++i) {
+        const LayerFragment& fragment = layerFragments.at(i);
+        if (!fragment.shouldPaintContent)
+            continue;
+
+        if (localPaintingInfo.clipToDirtyRect)
+            clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child clipping mask painting will handle clipping to self.
+
+        // Paint the the clipped mask.
+        PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect.rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer, localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer());
+        renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - renderBoxLocation() + localPaintingInfo.subPixelAccumulation));
+
+        if (localPaintingInfo.clipToDirtyRect)
+            restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.foregroundRect);
+    }
+}
+
 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo)
 {
     for (size_t i = 0; i < layerFragments.size(); ++i) {
@@ -4073,7 +4048,7 @@
     LayerFragments layerFragments;
     collectFragments(layerFragments, rootLayer, hitTestLocation.region(), hitTestRect, RootRelativeClipRects, IncludeOverlayScrollbarSize);
 
-    if (canResize() && hitTestResizerInFragments(layerFragments, hitTestLocation)) {
+    if (renderer()->canResize() && hitTestResizerInFragments(layerFragments, hitTestLocation)) {
         renderer()->updateHitTestResult(result, hitTestLocation.point());
         return this;
     }
@@ -5007,6 +4982,11 @@
     return m_backing && m_backing->hasMaskLayer();
 }
 
+bool RenderLayer::hasCompositedClippingMask() const
+{
+    return m_backing && m_backing->hasChildClippingMaskLayer();
+}
+
 GraphicsLayer* RenderLayer::layerForScrolling() const
 {
     return m_backing ? m_backing->scrollingContentsLayer() : 0;
@@ -5014,25 +4994,7 @@
 
 GraphicsLayer* RenderLayer::layerForScrollChild() const
 {
-    // If we have an ancestor clipping layer because of our scroll parent, we do not want to
-    // scroll that clip layer -- we need it to stay put and we will slide within it. If, on
-    // the other hand, we have an ancestor clipping layer due to some other clipping layer, we
-    // want to scroll the root of the layer's associated graphics layer subtree. I.e., we want it
-    // and its clip to move in concert.
-
-    if (!backing())
-        return 0;
-
-    if (backing()->hasAncestorScrollClippingLayer()) {
-        return backing()->hasAncestorClippingLayer()
-            ? backing()->ancestorClippingLayer()
-            : backing()->graphicsLayer();
-    }
-
-    if (renderer()->containingBlock()->enclosingLayer() == ancestorScrollingLayer())
-        return backing()->graphicsLayer();
-
-    return backing()->childForSuperlayers();
+    return m_backing ? m_backing->childForSuperlayers() : 0;
 }
 
 GraphicsLayer* RenderLayer::layerForHorizontalScrollbar() const
@@ -5668,7 +5630,6 @@
         updateReflectionStyle();
     }
 
-    updateScrollCornerStyle();
     updateResizerStyle();
 
     updateDescendantDependentFlags();
@@ -5700,7 +5661,7 @@
     FrameView* frameView = frame->view();
     if (!frameView)
         return;
-    if (canResize())
+    if (renderer()->canResize())
         frameView->addResizerArea(this);
     else
         frameView->removeResizerArea(this);
@@ -5750,22 +5711,6 @@
     }
 }
 
-void RenderLayer::updateScrollCornerStyle()
-{
-    RenderObject* actualRenderer = rendererForScrollbar(renderer());
-    RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
-    if (corner) {
-        if (!m_scrollCorner) {
-            m_scrollCorner = RenderScrollbarPart::createAnonymous(&renderer()->document());
-            m_scrollCorner->setParent(renderer());
-        }
-        m_scrollCorner->setStyle(corner.release());
-    } else if (m_scrollCorner) {
-        m_scrollCorner->destroy();
-        m_scrollCorner = 0;
-    }
-}
-
 void RenderLayer::updateResizerStyle()
 {
     RenderObject* actualRenderer = rendererForScrollbar(renderer());
diff --git a/Source/core/rendering/RenderLayer.h b/Source/core/rendering/RenderLayer.h
index db3753a..a782789 100644
--- a/Source/core/rendering/RenderLayer.h
+++ b/Source/core/rendering/RenderLayer.h
@@ -179,7 +179,6 @@
     bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
     void autoscroll(const IntPoint&);
 
-    bool canResize() const;
     void resize(const PlatformEvent&, const LayoutSize&);
     bool inResizeMode() const { return m_inResizeMode; }
     void setInResizeMode(bool b) { m_inResizeMode = b; }
@@ -348,6 +347,7 @@
         PaintLayerPaintingOverflowContents = 1 << 9,
         PaintLayerPaintingRootBackgroundOnly = 1 << 10,
         PaintLayerPaintingSkipRootBackground = 1 << 11,
+        PaintLayerPaintingChildClippingMaskPhase = 1 << 12,
         PaintLayerPaintingCompositingAllPhases = (PaintLayerPaintingCompositingBackgroundPhase | PaintLayerPaintingCompositingForegroundPhase | PaintLayerPaintingCompositingMaskPhase)
     };
 
@@ -476,6 +476,7 @@
 
     bool isComposited() const { return m_backing != 0; }
     bool hasCompositedMask() const;
+    bool hasCompositedClippingMask() const;
     RenderLayerBacking* backing() const { return m_backing.get(); }
     RenderLayerBacking* ensureBacking();
     void clearBacking(bool layerBeingDestroyed = false);
@@ -697,6 +698,7 @@
     void paintOutlineForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&, PaintBehavior, RenderObject* paintingRootForRenderer);
     void paintOverflowControlsForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&);
     void paintMaskForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer);
+    void paintChildClippingMaskForFragments(const LayerFragments&, GraphicsContext*, const LayerPaintingInfo&, RenderObject* paintingRootForRenderer);
     void paintTransformedLayerIntoFragments(GraphicsContext*, const LayerPaintingInfo&, PaintLayerFlags);
 
     RenderLayer* hitTestLayer(RenderLayer* rootLayer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult& result,
@@ -789,7 +791,7 @@
 
     void updateCompositingLayersAfterScroll();
 
-    bool requiresScrollableArea() const { return renderer()->style()->overflowX() != OVISIBLE || canResize() || usesCompositedScrolling(); }
+    bool requiresScrollableArea() const { return renderer()->style()->overflowX() != OVISIBLE || renderer()->canResize() || usesCompositedScrolling(); }
     void updateResizerAreaSet();
     void updateScrollableAreaSet(bool hasOverflow);
 
@@ -827,7 +829,6 @@
     LayoutPoint absoluteToContents(const LayoutPoint&) const;
 
     void positionOverflowControls(const IntSize&);
-    void updateScrollCornerStyle();
     void updateResizerStyle();
 
     void drawPlatformResizerImage(GraphicsContext*, IntRect resizerCornerRect);
@@ -968,8 +969,7 @@
     // May ultimately be extended to many replicas (with their own paint order).
     RenderReplica* m_reflection;
 
-    // Renderers to hold our custom scroll corner and resizer.
-    RenderScrollbarPart* m_scrollCorner;
+    // Renderers to hold our custom resizer.
     RenderScrollbarPart* m_resizer;
 
     // Pointer to the enclosing RenderLayer that caused us to be paginated. It is 0 if we are not paginated.
diff --git a/Source/core/rendering/RenderLayerBacking.cpp b/Source/core/rendering/RenderLayerBacking.cpp
index 5719cb9..5a16fab 100644
--- a/Source/core/rendering/RenderLayerBacking.cpp
+++ b/Source/core/rendering/RenderLayerBacking.cpp
@@ -40,7 +40,6 @@
 #include "core/page/Settings.h"
 #include "core/page/animation/AnimationController.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
-#include "core/platform/animation/KeyframeValueList.h"
 #include "core/platform/graphics/FontCache.h"
 #include "core/platform/graphics/GraphicsContext.h"
 #include "core/platform/graphics/GraphicsLayer.h"
@@ -53,6 +52,7 @@
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderVideo.h"
 #include "core/rendering/RenderView.h"
+#include "core/rendering/animation/WebAnimationProvider.h"
 #include "core/rendering/style/KeyframeList.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/text/StringBuilder.h"
@@ -140,6 +140,13 @@
     return contentsRect(renderer).contains(backgroundRect(renderer));
 }
 
+static inline bool isAcceleratedContents(RenderObject* renderer)
+{
+    return isAcceleratedCanvas(renderer)
+        || (renderer->isEmbeddedObject() && toRenderEmbeddedObject(renderer)->allowsAcceleratedCompositing())
+        || renderer->isVideo();
+}
+
 // Get the scrolling coordinator in a way that works inside RenderLayerBacking's destructor.
 static ScrollingCoordinator* scrollingCoordinatorFromLayer(RenderLayer* layer)
 {
@@ -152,6 +159,7 @@
 
 RenderLayerBacking::RenderLayerBacking(RenderLayer* layer)
     : m_owningLayer(layer)
+    , m_animationProvider(adoptPtr(new WebAnimationProvider))
     , m_artificiallyInflatedBounds(false)
     , m_boundsConstrainedByClipping(false)
     , m_isMainFrameRenderViewLayer(false)
@@ -172,11 +180,12 @@
 
 RenderLayerBacking::~RenderLayerBacking()
 {
-    updateClippingLayers(false, false, false);
+    updateClippingLayers(false, false);
     updateOverflowControlsLayers(false, false, false);
     updateForegroundLayer(false);
     updateBackgroundLayer(false);
     updateMaskLayer(false);
+    updateClippingMaskLayers(false);
     updateScrollingLayers(false);
     destroyGraphicsLayers();
 }
@@ -222,6 +231,7 @@
     m_backgroundLayer = nullptr;
     m_childContainmentLayer = nullptr;
     m_maskLayer = nullptr;
+    m_childClippingMaskLayer = nullptr;
 
     m_scrollingLayer = nullptr;
     m_scrollingContentsLayer = nullptr;
@@ -380,16 +390,14 @@
         // The solution is to update compositing children of this layer here,
         // via updateCompositingChildrenGeometry().
         updateCompositedBounds();
-        HashSet<RenderLayer*> visited;
-        layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, visited, flags & CompositingChildrenOnly);
-        visited.clear();
+        layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, flags & CompositingChildrenOnly);
 
         if (flags & IsUpdateRoot) {
             updateGraphicsLayerGeometry();
             layerCompositor->updateRootLayerPosition();
             RenderLayer* stackingContainer = m_owningLayer->enclosingStackingContainer();
             if (!layerCompositor->compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != m_owningLayer))
-                layerCompositor->updateCompositingDescendantGeometry(stackingContainer, stackingContainer, visited, flags & CompositingChildrenOnly);
+                layerCompositor->updateCompositingDescendantGeometry(stackingContainer, stackingContainer, flags & CompositingChildrenOnly);
         }
     }
 
@@ -423,8 +431,13 @@
 
     RenderLayer* scrollParent = m_owningLayer->scrollParent();
     bool needsAncestorClip = compositor->clippedByAncestor(m_owningLayer);
-    bool needsScrollClip = !!scrollParent;
-    if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer, needsScrollClip))
+    if (scrollParent) {
+        // If our containing block is our ancestor scrolling layer, then we'll already be clipped
+        // to it via our scroll parent and we don't need an ancestor clipping layer.
+        if (m_owningLayer->renderer()->containingBlock()->enclosingLayer() == m_owningLayer->ancestorScrollingLayer())
+            needsAncestorClip = false;
+    }
+    if (updateClippingLayers(needsAncestorClip, needsDescendentsClippingLayer))
         layerConfigChanged = true;
 
     if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), requiresVerticalScrollbarLayer(), requiresScrollCornerLayer()))
@@ -442,6 +455,10 @@
     if (updateMaskLayer(renderer->hasMask()))
         m_graphicsLayer->setMaskLayer(m_maskLayer.get());
 
+    bool needsChildClippingMask = renderer->style()->hasBorderRadius() && isAcceleratedContents(renderer);
+    if (updateClippingMaskLayers(needsChildClippingMask))
+        m_graphicsLayer->setContentsClippingMaskLayer(m_childClippingMaskLayer.get());
+
     if (m_owningLayer->hasReflection()) {
         if (m_owningLayer->reflectionLayer()->backing()) {
             GraphicsLayer* reflectionLayer = m_owningLayer->reflectionLayer()->backing()->graphicsLayer();
@@ -510,7 +527,13 @@
     // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer and its non-compositing
     // descendants. So, the visibility flag for m_graphicsLayer should be true if there are any
     // non-compositing visible layers.
-    m_graphicsLayer->setContentsVisible(m_owningLayer->hasVisibleContent() || hasVisibleNonCompositingDescendantLayers());
+    bool contentsVisible = m_owningLayer->hasVisibleContent() || hasVisibleNonCompositingDescendantLayers();
+    if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && renderer()->isVideo()) {
+        HTMLMediaElement* mediaElement = toHTMLMediaElement(renderer()->node());
+        if (mediaElement->isFullscreen())
+            contentsVisible = false;
+    }
+    m_graphicsLayer->setContentsVisible(contentsVisible);
 
     RenderStyle* style = renderer()->style();
     // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
@@ -552,30 +575,6 @@
         graphicsLayerParentLocation = scrollOrigin - scrollOffset;
     }
 
-    if (compAncestor && m_ancestorScrollClippingLayer && m_owningLayer->ancestorScrollingLayer()) {
-        // Our scroll parent must have been processed before us. The code in RenderLayerCompositor
-        // that coordinates updating graphics layer geometry has been set up to guarantee that this is the case.
-        RenderLayer* scrollParent = m_owningLayer->ancestorScrollingLayer();
-        GraphicsLayer* scrollParentClippingLayer = scrollParent->backing()->scrollingLayer();
-
-        // Not relative to our parent graphics layer.
-        FloatPoint position;
-        GraphicsLayer* scrollParentChildForSuperlayers = scrollParent->backing()->childForSuperlayers();
-
-        for (GraphicsLayer* scrollAncestor = scrollParentClippingLayer; scrollAncestor; scrollAncestor = scrollAncestor->parent()) {
-            ASSERT(scrollAncestor->transform().isIdentity());
-            position = position + toFloatSize(scrollAncestor->position());
-            if (scrollAncestor == scrollParentChildForSuperlayers)
-                break;
-        }
-
-        m_ancestorScrollClippingLayer->setPosition(position);
-        m_ancestorScrollClippingLayer->setSize(scrollParentClippingLayer->size());
-        m_ancestorScrollClippingLayer->setOffsetFromRenderer(toIntSize(roundedIntPoint(-position)));
-
-        graphicsLayerParentLocation = roundedIntPoint(position);
-    }
-
     if (compAncestor && m_ancestorClippingLayer) {
         // Call calculateRects to get the backgroundRect which is what is used to clip the contents of this
         // layer. Note that we call it with temporaryClipRects = true because normally when computing clip rects
@@ -782,9 +781,6 @@
 
 void RenderLayerBacking::updateInternalHierarchy()
 {
-    if (m_ancestorScrollClippingLayer)
-        m_ancestorScrollClippingLayer->removeAllChildren();
-
     // m_foregroundLayer has to be inserted in the correct order with child layers,
     // so it's not inserted here.
     if (m_ancestorClippingLayer)
@@ -795,13 +791,6 @@
     if (m_ancestorClippingLayer)
         m_ancestorClippingLayer->addChild(m_graphicsLayer.get());
 
-    if (m_ancestorScrollClippingLayer) {
-        if (m_ancestorClippingLayer)
-            m_ancestorScrollClippingLayer->addChild(m_ancestorClippingLayer.get());
-        else
-            m_ancestorScrollClippingLayer->addChild(m_graphicsLayer.get());
-    }
-
     if (m_childContainmentLayer) {
         m_childContainmentLayer->removeFromParent();
         m_graphicsLayer->addChild(m_childContainmentLayer.get());
@@ -880,7 +869,7 @@
 }
 
 // Return true if the layers changed.
-bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip, bool needsScrollClip)
+bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip)
 {
     bool layersChanged = false;
 
@@ -910,18 +899,6 @@
         layersChanged = true;
     }
 
-    if (needsScrollClip) {
-        if (!m_ancestorScrollClippingLayer) {
-            m_ancestorScrollClippingLayer = createGraphicsLayer(CompositingReasonLayerForClip);
-            m_ancestorScrollClippingLayer->setMasksToBounds(true);
-            layersChanged = true;
-        }
-    } else if (m_ancestorScrollClippingLayer) {
-        m_ancestorScrollClippingLayer->removeFromParent();
-        m_ancestorScrollClippingLayer = nullptr;
-        layersChanged = true;
-    }
-
     return layersChanged;
 }
 
@@ -1100,6 +1077,23 @@
     return layerChanged;
 }
 
+bool RenderLayerBacking::updateClippingMaskLayers(bool needsChildClippingMaskLayer)
+{
+    bool layerChanged = false;
+    if (needsChildClippingMaskLayer) {
+        if (!m_childClippingMaskLayer) {
+            m_childClippingMaskLayer = createGraphicsLayer(CompositingReasonLayerForMask);
+            m_childClippingMaskLayer->setDrawsContent(true);
+            m_childClippingMaskLayer->setPaintingPhase(GraphicsLayerPaintChildClippingMask);
+            layerChanged = true;
+        }
+    } else if (m_childClippingMaskLayer) {
+        m_childClippingMaskLayer = nullptr;
+        layerChanged = true;
+    }
+    return layerChanged;
+}
+
 bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
 {
     ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer);
@@ -1146,14 +1140,25 @@
 
 void RenderLayerBacking::updateScrollParent(RenderLayer* scrollParent)
 {
-    if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer))
-        scrollingCoordinator->updateScrollParentForLayer(m_owningLayer, scrollParent);
+    if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer)) {
+        if (m_ancestorClippingLayer) {
+            ASSERT(childForSuperlayers() == m_ancestorClippingLayer.get());
+            // If we have an ancestor clipping layer, it is the scroll child. The other layer that may have
+            // been the scroll child is the graphics layer. We will ensure that we clear its association
+            // with a scroll parent if it had one.
+            scrollingCoordinator->updateScrollParentForGraphicsLayer(m_ancestorClippingLayer.get(), scrollParent);
+            scrollingCoordinator->updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), 0);
+        } else {
+            ASSERT(childForSuperlayers() == m_graphicsLayer.get());
+            scrollingCoordinator->updateScrollParentForGraphicsLayer(m_graphicsLayer.get(), scrollParent);
+        }
+    }
 }
 
 void RenderLayerBacking::updateClipParent(RenderLayer* clipParent)
 {
     if (ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m_owningLayer))
-        scrollingCoordinator->updateClipParentForLayer(m_owningLayer, clipParent);
+        scrollingCoordinator->updateClipParentForGraphicsLayer(m_graphicsLayer.get(), clipParent);
 }
 
 GraphicsLayerPaintingPhase RenderLayerBacking::paintingPhaseForPrimaryLayer() const
@@ -1511,9 +1516,6 @@
 
 GraphicsLayer* RenderLayerBacking::childForSuperlayers() const
 {
-    if (m_ancestorScrollClippingLayer)
-        return m_ancestorScrollClippingLayer.get();
-
     if (m_ancestorClippingLayer)
         return m_ancestorClippingLayer.get();
 
@@ -1555,6 +1557,9 @@
     if (m_maskLayer && m_maskLayer->drawsContent())
         m_maskLayer->setNeedsDisplay();
 
+    if (m_childClippingMaskLayer && m_childClippingMaskLayer->drawsContent())
+        m_childClippingMaskLayer->setNeedsDisplay();
+
     if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent())
         m_scrollingContentsLayer->setNeedsDisplay();
 }
@@ -1589,6 +1594,12 @@
         m_maskLayer->setNeedsDisplayInRect(layerDirtyRect);
     }
 
+    if (m_childClippingMaskLayer && m_childClippingMaskLayer->drawsContent()) {
+        IntRect layerDirtyRect = r;
+        layerDirtyRect.move(-m_childClippingMaskLayer->offsetFromRenderer());
+        m_childClippingMaskLayer->setNeedsDisplayInRect(layerDirtyRect);
+    }
+
     if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) {
         IntRect layerDirtyRect = r;
         layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer());
@@ -1613,6 +1624,8 @@
         paintFlags |= RenderLayer::PaintLayerPaintingCompositingForegroundPhase;
     if (paintInfo.paintingPhase & GraphicsLayerPaintMask)
         paintFlags |= RenderLayer::PaintLayerPaintingCompositingMaskPhase;
+    if (paintInfo.paintingPhase & GraphicsLayerPaintChildClippingMask)
+        paintFlags |= RenderLayer::PaintLayerPaintingChildClippingMaskPhase;
     if (paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)
         paintFlags |= RenderLayer::PaintLayerPaintingOverflowContents;
     if (paintInfo.paintingPhase & GraphicsLayerPaintCompositedScroll)
@@ -1688,6 +1701,7 @@
         || graphicsLayer == m_foregroundLayer.get()
         || graphicsLayer == m_backgroundLayer.get()
         || graphicsLayer == m_maskLayer.get()
+        || graphicsLayer == m_childClippingMaskLayer.get()
         || graphicsLayer == m_scrollingContentsLayer.get()) {
 
         GraphicsLayerPaintInfo paintInfo;
@@ -1750,111 +1764,87 @@
 
 bool RenderLayerBacking::startAnimation(double timeOffset, const CSSAnimationData* anim, const KeyframeList& keyframes)
 {
-    bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity);
     bool hasTransform = renderer()->isBox() && keyframes.containsProperty(CSSPropertyWebkitTransform);
-    bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter);
-
-    if (!hasOpacity && !hasTransform && !hasFilter)
+    IntSize boxSize;
+    if (hasTransform)
+        boxSize = toRenderBox(renderer())->pixelSnappedBorderBoxRect().size();
+    WebAnimations animations(m_animationProvider->startAnimation(timeOffset, anim, keyframes, hasTransform, boxSize));
+    if (animations.isEmpty())
         return false;
 
-    KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
-    KeyframeValueList opacityVector(AnimatedPropertyOpacity);
-    KeyframeValueList filterVector(AnimatedPropertyWebkitFilter);
+    bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity);
+    bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter);
+    int animationId = m_animationProvider->getWebAnimationId(keyframes.animationName());
 
-    size_t numKeyframes = keyframes.size();
-    for (size_t i = 0; i < numKeyframes; ++i) {
-        const KeyframeValue& currentKeyframe = keyframes[i];
-        const RenderStyle* keyframeStyle = currentKeyframe.style();
-        double key = currentKeyframe.key();
-
-        if (!keyframeStyle)
-            continue;
-
-        // Get timing function.
-        RefPtr<TimingFunction> tf = KeyframeValue::timingFunction(currentKeyframe.style(), keyframes.animationName());
-
-        bool isFirstOrLastKeyframe = key == 0 || key == 1;
-        if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
-            transformVector.insert(adoptPtr(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf)));
-
-        if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyOpacity))
-            opacityVector.insert(adoptPtr(new FloatAnimationValue(key, keyframeStyle->opacity(), tf)));
-
-        if ((hasFilter && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitFilter))
-            filterVector.insert(adoptPtr(new FilterAnimationValue(key, &(keyframeStyle->filter()), tf)));
+    // Animating only some properties of the animation is not supported. So if the
+    // GraphicsLayer rejects any property of the animation, we have to remove the
+    // animation and return false to indicate un-accelerated animation is required.
+    if (hasTransform) {
+        if (!animations.m_transformAnimation || !m_graphicsLayer->addAnimation(animations.m_transformAnimation.get()))
+            return false;
     }
-
-    bool didAnimate = false;
-
-    if (hasTransform && m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->pixelSnappedBorderBoxRect().size(), anim, keyframes.animationName(), timeOffset))
-        didAnimate = true;
-
-    if (hasOpacity && m_graphicsLayer->addAnimation(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset))
-        didAnimate = true;
-
-    if (hasFilter && m_graphicsLayer->addAnimation(filterVector, IntSize(), anim, keyframes.animationName(), timeOffset))
-        didAnimate = true;
-
-    return didAnimate;
+    if (hasOpacity) {
+        if (!animations.m_opacityAnimation || !m_graphicsLayer->addAnimation(animations.m_opacityAnimation.get())) {
+            if (hasTransform)
+                m_graphicsLayer->removeAnimation(animationId);
+            return false;
+        }
+    }
+    if (hasFilter) {
+        if (!animations.m_filterAnimation || !m_graphicsLayer->addAnimation(animations.m_filterAnimation.get())) {
+            if (hasTransform || hasOpacity)
+                m_graphicsLayer->removeAnimation(animationId);
+            return false;
+        }
+    }
+    return true;
 }
 
 void RenderLayerBacking::animationPaused(double timeOffset, const String& animationName)
 {
-    m_graphicsLayer->pauseAnimation(animationName, timeOffset);
+    int animationId = m_animationProvider->getWebAnimationId(animationName);
+    if (animationId)
+        m_graphicsLayer->pauseAnimation(animationId, timeOffset);
 }
 
 void RenderLayerBacking::animationFinished(const String& animationName)
 {
-    m_graphicsLayer->removeAnimation(animationName);
+    int animationId = m_animationProvider->getWebAnimationId(animationName);
+    if (animationId)
+        m_graphicsLayer->removeAnimation(animationId);
 }
 
 bool RenderLayerBacking::startTransition(double timeOffset, CSSPropertyID property, const RenderStyle* fromStyle, const RenderStyle* toStyle)
 {
-    bool didAnimate = false;
-
     ASSERT(property != CSSPropertyInvalid);
-
-    if (property == CSSPropertyOpacity) {
-        const CSSAnimationData* opacityAnim = toStyle->transitionForProperty(CSSPropertyOpacity);
-        if (opacityAnim && !opacityAnim->isEmptyOrZeroDuration()) {
-            KeyframeValueList opacityVector(AnimatedPropertyOpacity);
-            opacityVector.insert(adoptPtr(new FloatAnimationValue(0, compositingOpacity(fromStyle->opacity()))));
-            opacityVector.insert(adoptPtr(new FloatAnimationValue(1, compositingOpacity(toStyle->opacity()))));
-            // The boxSize param is only used for transform animations (which can only run on RenderBoxes), so we pass an empty size here.
-            if (m_graphicsLayer->addAnimation(opacityVector, IntSize(), opacityAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyOpacity), timeOffset)) {
-                // To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
-                updateOpacity(toStyle);
-                didAnimate = true;
-            }
-        }
-    }
-
+    IntSize boxSize;
     if (property == CSSPropertyWebkitTransform && m_owningLayer->hasTransform()) {
-        const CSSAnimationData* transformAnim = toStyle->transitionForProperty(CSSPropertyWebkitTransform);
-        if (transformAnim && !transformAnim->isEmptyOrZeroDuration()) {
-            KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
-            transformVector.insert(adoptPtr(new TransformAnimationValue(0, &fromStyle->transform())));
-            transformVector.insert(adoptPtr(new TransformAnimationValue(1, &toStyle->transform())));
-            if (m_graphicsLayer->addAnimation(transformVector, toRenderBox(renderer())->pixelSnappedBorderBoxRect().size(), transformAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitTransform), timeOffset)) {
-                // To ensure that the correct transform is visible when the animation ends, also set the final transform.
-                updateTransform(toStyle);
-                didAnimate = true;
-            }
-        }
+        ASSERT(renderer()->isBox());
+        boxSize = toRenderBox(renderer())->pixelSnappedBorderBoxRect().size();
     }
-
-    if (property == CSSPropertyWebkitFilter && m_owningLayer->hasFilter()) {
-        const CSSAnimationData* filterAnim = toStyle->transitionForProperty(CSSPropertyWebkitFilter);
-        if (filterAnim && !filterAnim->isEmptyOrZeroDuration()) {
-            KeyframeValueList filterVector(AnimatedPropertyWebkitFilter);
-            filterVector.insert(adoptPtr(new FilterAnimationValue(0, &fromStyle->filter())));
-            filterVector.insert(adoptPtr(new FilterAnimationValue(1, &toStyle->filter())));
-            if (m_graphicsLayer->addAnimation(filterVector, IntSize(), filterAnim, GraphicsLayer::animationNameForTransition(AnimatedPropertyWebkitFilter), timeOffset)) {
-                // To ensure that the correct filter is visible when the animation ends, also set the final filter.
-                updateFilters(toStyle);
-                didAnimate = true;
-            }
-        }
+    float fromOpacity = 0;
+    float toOpacity = 0;
+    if (property == CSSPropertyOpacity) {
+        fromOpacity = compositingOpacity(fromStyle->opacity());
+        toOpacity = compositingOpacity(toStyle->opacity());
+    }
+    WebAnimations animations(m_animationProvider->startTransition(timeOffset, property, fromStyle,
+        toStyle, m_owningLayer->hasTransform(), m_owningLayer->hasFilter(), boxSize, fromOpacity, toOpacity));
+    bool didAnimate = false;
+    if (animations.m_transformAnimation && m_graphicsLayer->addAnimation(animations.m_transformAnimation.get())) {
+        // To ensure that the correct transform is visible when the animation ends, also set the final transform.
+        updateTransform(toStyle);
+        didAnimate = true;
+    }
+    if (animations.m_opacityAnimation && m_graphicsLayer->addAnimation(animations.m_opacityAnimation.get())) {
+        // To ensure that the correct opacity is visible when the animation ends, also set the final opacity.
+        updateOpacity(toStyle);
+        didAnimate = true;
+    }
+    if (animations.m_filterAnimation && m_graphicsLayer->addAnimation(animations.m_filterAnimation.get())) {
+        // To ensure that the correct filter is visible when the animation ends, also set the final filter.
+        updateFilters(toStyle);
+        didAnimate = true;
     }
 
     return didAnimate;
@@ -1862,16 +1852,16 @@
 
 void RenderLayerBacking::transitionPaused(double timeOffset, CSSPropertyID property)
 {
-    AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
-    if (animatedProperty != AnimatedPropertyInvalid)
-        m_graphicsLayer->pauseAnimation(GraphicsLayer::animationNameForTransition(animatedProperty), timeOffset);
+    int animationId = m_animationProvider->getWebAnimationId(property);
+    if (animationId)
+        m_graphicsLayer->pauseAnimation(animationId, timeOffset);
 }
 
 void RenderLayerBacking::transitionFinished(CSSPropertyID property)
 {
-    AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
-    if (animatedProperty != AnimatedPropertyInvalid)
-        m_graphicsLayer->removeAnimation(GraphicsLayer::animationNameForTransition(animatedProperty));
+    int animationId = m_animationProvider->getWebAnimationId(property);
+    if (animationId)
+        m_graphicsLayer->removeAnimation(animationId);
 }
 
 void RenderLayerBacking::notifyAnimationStarted(const GraphicsLayer*, double time)
@@ -1900,46 +1890,6 @@
     m_compositedBounds = bounds;
 }
 
-CSSPropertyID RenderLayerBacking::graphicsLayerToCSSProperty(AnimatedPropertyID property)
-{
-    CSSPropertyID cssProperty = CSSPropertyInvalid;
-    switch (property) {
-        case AnimatedPropertyWebkitTransform:
-            cssProperty = CSSPropertyWebkitTransform;
-            break;
-        case AnimatedPropertyOpacity:
-            cssProperty = CSSPropertyOpacity;
-            break;
-        case AnimatedPropertyBackgroundColor:
-            cssProperty = CSSPropertyBackgroundColor;
-            break;
-        case AnimatedPropertyWebkitFilter:
-            cssProperty = CSSPropertyWebkitFilter;
-            break;
-        case AnimatedPropertyInvalid:
-            ASSERT_NOT_REACHED();
-    }
-    return cssProperty;
-}
-
-AnimatedPropertyID RenderLayerBacking::cssToGraphicsLayerProperty(CSSPropertyID cssProperty)
-{
-    switch (cssProperty) {
-        case CSSPropertyWebkitTransform:
-            return AnimatedPropertyWebkitTransform;
-        case CSSPropertyOpacity:
-            return AnimatedPropertyOpacity;
-        case CSSPropertyBackgroundColor:
-            return AnimatedPropertyBackgroundColor;
-        case CSSPropertyWebkitFilter:
-            return AnimatedPropertyWebkitFilter;
-        default:
-            // It's fine if we see other css properties here; they are just not accelerated.
-            break;
-    }
-    return AnimatedPropertyInvalid;
-}
-
 CompositingLayerType RenderLayerBacking::compositingLayerType() const
 {
     if (m_graphicsLayer->hasContentsLayer())
@@ -1963,6 +1913,8 @@
         backingMemory += m_backgroundLayer->backingStoreMemoryEstimate();
     if (m_maskLayer)
         backingMemory += m_maskLayer->backingStoreMemoryEstimate();
+    if (m_childClippingMaskLayer)
+        backingMemory += m_childClippingMaskLayer->backingStoreMemoryEstimate();
 
     if (m_scrollingContentsLayer)
         backingMemory += m_scrollingContentsLayer->backingStoreMemoryEstimate();
@@ -1984,8 +1936,6 @@
     String name;
     if (graphicsLayer == m_graphicsLayer.get()) {
         name = m_owningLayer->debugName();
-    } else if (graphicsLayer == m_ancestorScrollClippingLayer.get()) {
-        name = "Ancestor Scroll Clipping Layer";
     } else if (graphicsLayer == m_ancestorClippingLayer.get()) {
         name = "Ancestor Clipping Layer";
     } else if (graphicsLayer == m_foregroundLayer.get()) {
diff --git a/Source/core/rendering/RenderLayerBacking.h b/Source/core/rendering/RenderLayerBacking.h
index 6285afd..a20c9af 100644
--- a/Source/core/rendering/RenderLayerBacking.h
+++ b/Source/core/rendering/RenderLayerBacking.h
@@ -37,6 +37,7 @@
 
 class KeyframeList;
 class RenderLayerCompositor;
+class WebAnimationProvider;
 
 enum CompositingLayerType {
     NormalCompositingLayer, // non-tiled layer with backing store
@@ -97,9 +98,6 @@
     bool hasAncestorClippingLayer() const { return m_ancestorClippingLayer; }
     GraphicsLayer* ancestorClippingLayer() const { return m_ancestorClippingLayer.get(); }
 
-    bool hasAncestorScrollClippingLayer() const { return m_ancestorScrollClippingLayer; }
-    GraphicsLayer* ancestorScrollClippingLayer() const { return m_ancestorScrollClippingLayer.get(); }
-
     bool hasContentsLayer() const { return m_foregroundLayer != 0; }
     GraphicsLayer* foregroundLayer() const { return m_foregroundLayer.get(); }
 
@@ -111,6 +109,7 @@
     GraphicsLayer* scrollingContentsLayer() const { return m_scrollingContentsLayer.get(); }
 
     bool hasMaskLayer() const { return m_maskLayer != 0; }
+    bool hasChildClippingMaskLayer() const { return m_childClippingMaskLayer; }
 
     GraphicsLayer* parentForSublayers() const;
     GraphicsLayer* childForSuperlayers() const;
@@ -192,11 +191,12 @@
     RenderLayerCompositor* compositor() const { return m_owningLayer->compositor(); }
 
     void updateInternalHierarchy();
-    bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip, bool needsScrollClip);
+    bool updateClippingLayers(bool needsAncestorClip, bool needsDescendantClip);
     bool updateOverflowControlsLayers(bool needsHorizontalScrollbarLayer, bool needsVerticalScrollbarLayer, bool needsScrollCornerLayer);
     bool updateForegroundLayer(bool needsForegroundLayer);
     bool updateBackgroundLayer(bool needsBackgroundLayer);
     bool updateMaskLayer(bool needsMaskLayer);
+    bool updateClippingMaskLayers(bool needsChildClippingMaskLayer);
     bool requiresHorizontalScrollbarLayer() const { return m_owningLayer->horizontalScrollbar(); }
     bool requiresVerticalScrollbarLayer() const { return m_owningLayer->verticalScrollbar(); }
     bool requiresScrollCornerLayer() const { return !m_owningLayer->scrollCornerAndResizerRect().isEmpty(); }
@@ -247,56 +247,35 @@
 
     void doPaintTask(GraphicsLayerPaintInfo&, GraphicsContext*, const IntRect& clip);
 
-    static CSSPropertyID graphicsLayerToCSSProperty(AnimatedPropertyID);
-    static AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID);
-
     RenderLayer* m_owningLayer;
 
     // The hierarchy of layers that is maintained by the RenderLayerBacking looks like this:
     //
-    // m_ancestorScrollClippingLayer [OPTIONAL]
     //  + m_ancestorClippingLayer [OPTIONAL]
     //     + m_graphicsLayer
     //        + m_childContainmentLayer [OPTIONAL] <-OR-> m_scrollingLayer [OPTIONAL]
     //                                                     + m_scrollingContentsLayer [OPTIONAL]
     //
-    // We need an ancestor scroll clipping layer if we have a "scroll parent". That is, if
-    // our scrolling ancestor is not our ancestor in the stacking tree. Similarly, we need
-    // an ancestor clipping layer if our clipping ancestor is not our ancestor in the clipping
-    // tree. Here's what that might look like.
+    // We need an ancestor clipping layer if our clipping ancestor is not our ancestor in the
+    // clipping tree. Here's what that might look like.
     //
-    // Let A = the scrolling ancestor,
-    //     B = the clipping ancestor,
-    //     C = the scroll/clip descendant, and
-    //     SC = the stacking context that is the ancestor of A, B and C in the stacking tree.
+    // Let A = the clipping ancestor,
+    //     B = the clip descendant, and
+    //     SC = the stacking context that is the ancestor of A and B in the stacking tree.
     //
     // SC
     //  + A = m_graphicsLayer
-    //  |      + m_scrollingLayer [*]
-    //  |         + m_scrollingContentsLayer [+]
-    //  |            + ...
+    //  |  + m_childContainmentLayer
+    //  |     + ...
     //  ...
     //  |
-    //  + B = m_graphicsLayer
-    //  |      + m_childContainmentLayer
-    //  |         + ...
-    //  ...
-    //  |
-    //  + C = m_ancestorScrollClippingLayer [**]
-    //         + m_ancestorClippingLayer [++]
-    //            + m_graphicsLayer
-    //               + ...
+    //  + B = m_ancestorClippingLayer [+]
+    //     + m_graphicsLayer
+    //        + ...
     //
-    // Note that [*] and [**] exist for the same reason: to clip scrolling content. That is,
-    // when we scroll A, in fact [+] and [++] are moved and are clipped to [*] and [**],
-    // respectively.
-    //
-    // Now, it may also be the case that C is also clipped by another layer that doesn't happen
-    // to be its scrolling ancestor. B, in this case. When this happens, we create an
-    // ancestor clipping layer for C, [++]. Unlike the scroll clipping layer, [**], which must
-    // stay put during a scroll to do its job, the ancestor clipping layer [++] does move with
-    // the content it clips.
-    OwnPtr<GraphicsLayer> m_ancestorScrollClippingLayer; // Used if and only if we have a scroll parent.
+    // In this case B is clipped by another layer that doesn't happen to be its ancestor: A.
+    // So we create an ancestor clipping layer for B, [+], which ensures that B is clipped
+    // as if it had been A's descendant.
     OwnPtr<GraphicsLayer> m_ancestorClippingLayer; // Only used if we are clipped by an ancestor which is not a stacking context.
     OwnPtr<GraphicsLayer> m_graphicsLayer;
     OwnPtr<GraphicsLayer> m_childContainmentLayer; // Only used if we have clipping on a stacking context with compositing children.
@@ -307,6 +286,7 @@
     // the layers above. It's added to m_graphicsLayer as its mask layer (naturally) if
     // we have a mask, and isn't part of the typical hierarchy (it has no children).
     OwnPtr<GraphicsLayer> m_maskLayer; // Only used if we have a mask.
+    OwnPtr<GraphicsLayer> m_childClippingMaskLayer; // Only used if we have to clip child layers or accelerated contents with border radius or clip-path.
 
     // There are two other (optional) layers whose painting is managed by the RenderLayerBacking,
     // but whose position in the hierarchy is maintained by the RenderLayerCompositor. These
@@ -337,6 +317,8 @@
     OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
     OwnPtr<GraphicsLayer> m_layerForScrollCorner;
 
+    OwnPtr<WebAnimationProvider> m_animationProvider;
+
     IntRect m_compositedBounds;
 
     bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
diff --git a/Source/core/rendering/RenderLayerCompositor.cpp b/Source/core/rendering/RenderLayerCompositor.cpp
index cdde2da..3511500 100644
--- a/Source/core/rendering/RenderLayerCompositor.cpp
+++ b/Source/core/rendering/RenderLayerCompositor.cpp
@@ -29,9 +29,12 @@
 
 #include "CSSPropertyNames.h"
 #include "HTMLNames.h"
+#include "RuntimeEnabledFeatures.h"
+#include "core/dom/FullscreenElementStack.h"
 #include "core/dom/NodeList.h"
 #include "core/html/HTMLCanvasElement.h"
 #include "core/html/HTMLIFrameElement.h"
+#include "core/html/HTMLVideoElement.h"
 #include "core/html/canvas/CanvasRenderingContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/Chrome.h"
@@ -61,6 +64,7 @@
 #include "core/rendering/RenderVideo.h"
 #include "core/rendering/RenderView.h"
 #include "wtf/TemporaryChange.h"
+#include "wtf/text/StringBuilder.h"
 
 #if !LOG_DISABLED
 #include "wtf/CurrentTime.h"
@@ -350,6 +354,23 @@
     }
 }
 
+static RenderVideo* findFullscreenVideoRenderer(Document* document)
+{
+    Element* fullscreenElement = FullscreenElementStack::currentFullScreenElementFrom(document);
+    while (fullscreenElement && fullscreenElement->isFrameOwnerElement()) {
+        document = toHTMLFrameOwnerElement(fullscreenElement)->contentDocument();
+        if (!document)
+            return 0;
+        fullscreenElement = FullscreenElementStack::currentFullScreenElementFrom(document);
+    }
+    if (!fullscreenElement || !isHTMLVideoElement(fullscreenElement))
+        return 0;
+    RenderObject* renderer = fullscreenElement->renderer();
+    if (!renderer)
+        return 0;
+    return toRenderVideo(renderer);
+}
+
 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
 {
     // Avoid updating the layers with old values. Compositing layers will be updated after the layout is finished.
@@ -439,14 +460,23 @@
     if (needHierarchyUpdate) {
         // Update the hierarchy of the compositing layers.
         Vector<GraphicsLayer*> childList;
-        HashSet<RenderLayer*> visited;
         {
             TRACE_EVENT0("blink_rendering", "RenderLayerCompositor::rebuildCompositingLayerTree");
-            rebuildCompositingLayerTree(updateRoot, childList, visited, 0);
+            rebuildCompositingLayerTree(updateRoot, childList, 0);
         }
 
         // Host the document layer in the RenderView's root layer.
         if (isFullUpdate) {
+            if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && isMainFrame()) {
+                RenderVideo* video = findFullscreenVideoRenderer(&m_renderView->document());
+                if (video) {
+                    RenderLayerBacking* backing = video->backing();
+                    if (backing) {
+                        childList.clear();
+                        childList.append(backing->graphicsLayer());
+                    }
+                }
+            }
             // Even when childList is empty, don't drop out of compositing mode if there are
             // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden).
             if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(updateRoot))
@@ -457,8 +487,7 @@
     } else if (needGeometryUpdate) {
         // We just need to do a geometry update. This is only used for position:fixed scrolling;
         // most of the time, geometry is updated via RenderLayer::styleChanged().
-        HashSet<RenderLayer*> visited;
-        updateLayerTreeGeometry(updateRoot, visited, 0);
+        updateLayerTreeGeometry(updateRoot, 0);
     }
 
 #if !LOG_DISABLED
@@ -1065,46 +1094,7 @@
     return o->supportsAcceleratedRendering();
 }
 
-// The purpose of this function is to ensure that we call rebuildCompostingLayerTree on curLayer's
-// scroll parent (if it has one) before we call it on curLayer. This is necessary because rebuilding the
-// compositing layer tree for curLayer will use values we computed for the scroll parent. More specifically,
-// rebuildCompositingLayreTree will call RenderLayerBacking::updateGraphicsLayerGeometry, and it's this
-// function that will pull values from a scroll parent's graphics layers. Unfortunately,
-// the childList needs to be populated as if we'd visited all the layers in paint order. To work around
-// this, when we visit a scroll parent out of order, we'll set its additions to childList aside (in
-// scrollParentChildLists), and add them to the real childList when we visit the scroll parent in paint
-// order.
-void RenderLayerCompositor::rebuildCompositingLayerTreeForLayerAndScrollParents(RenderLayer* curLayer, Vector<GraphicsLayer*>& childList, HashSet<RenderLayer*>& visited, HashMap<RenderLayer*, Vector<GraphicsLayer*> >& scrollParentChildLists, int depth)
-{
-    ASSERT(curLayer->zIndex() >= 0 || !visited.contains(curLayer));
-    if (visited.contains(curLayer)) {
-        // We've already processed this layer, but since we processed it out of order, its
-        // contribution to childList was not added. We must do that now.
-        HashMap<RenderLayer*, Vector<GraphicsLayer*> >::iterator it = scrollParentChildLists.find(curLayer);
-        ASSERT(it != scrollParentChildLists.end());
-        childList.append(it->value);
-        scrollParentChildLists.remove(it);
-        return;
-    }
-
-    if (requiresCompositingForOverflowScrollingParent(curLayer)) {
-        RenderLayer* scrollParent = curLayer->ancestorScrollingLayer();
-        if (!visited.contains(scrollParent)) {
-            ASSERT(!scrollParentChildLists.contains(scrollParent));
-            // We will populate scrollParentChildList rather than childList, since we're visiting it
-            // out of order.
-            Vector<GraphicsLayer*> scrollParentChildList;
-            rebuildCompositingLayerTreeForLayerAndScrollParents(scrollParent, scrollParentChildList, visited, scrollParentChildLists, depth);
-            // We will set aside the scrollParentChildList in scrollParentChildLists so that we can
-            // add it to childList when we visit the scrollParent normally.
-            scrollParentChildLists.add(scrollParent, scrollParentChildList);
-        }
-    }
-
-    rebuildCompositingLayerTree(curLayer, childList, visited, depth);
-}
-
-void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vector<GraphicsLayer*>& childLayersOfEnclosingLayer, HashSet<RenderLayer*>& visited, int depth)
+void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, Vector<GraphicsLayer*>& childLayersOfEnclosingLayer, int depth)
 {
     // Make the layer compositing if necessary, and set up clipping and content layers.
     // Note that we can only do work here that is independent of whether the descendant layers
@@ -1120,8 +1110,6 @@
         pixelsAddedByPromotingAllTransitions = 0.0;
     }
 
-    visited.add(layer);
-
     RenderLayerBacking* layerBacking = layer->backing();
     if (layerBacking) {
         // The compositing state of all our children has been updated already, so now
@@ -1164,13 +1152,12 @@
     LayerListMutationDetector mutationChecker(layer);
 #endif
 
-    HashMap<RenderLayer*, Vector<GraphicsLayer*> > scrollParentChildLists;
     if (layer->isStackingContainer()) {
         if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
             size_t listSize = negZOrderList->size();
             for (size_t i = 0; i < listSize; ++i) {
                 RenderLayer* curLayer = negZOrderList->at(i);
-                rebuildCompositingLayerTreeForLayerAndScrollParents(curLayer, childList, visited, scrollParentChildLists, depth + 1);
+                rebuildCompositingLayerTree(curLayer, childList, depth + 1);
             }
         }
 
@@ -1183,7 +1170,7 @@
         size_t listSize = normalFlowList->size();
         for (size_t i = 0; i < listSize; ++i) {
             RenderLayer* curLayer = normalFlowList->at(i);
-            rebuildCompositingLayerTreeForLayerAndScrollParents(curLayer, childList, visited, scrollParentChildLists, depth + 1);
+            rebuildCompositingLayerTree(curLayer, childList, depth + 1);
         }
     }
 
@@ -1192,7 +1179,7 @@
             size_t listSize = posZOrderList->size();
             for (size_t i = 0; i < listSize; ++i) {
                 RenderLayer* curLayer = posZOrderList->at(i);
-                rebuildCompositingLayerTreeForLayerAndScrollParents(curLayer, childList, visited, scrollParentChildLists, depth + 1);
+                rebuildCompositingLayerTree(curLayer, childList, depth + 1);
             }
         }
     }
@@ -1248,7 +1235,7 @@
         frameViewDidScroll();
         updateOverflowControlsLayers();
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
         if (m_layerForOverhangAreas)
             m_layerForOverhangAreas->setSize(frameView->frameRect().size());
 #endif
@@ -1353,9 +1340,10 @@
     // The true root layer is not included in the dump, so if we want to report
     // its repaint rects, they must be included here.
     if (flags & LayerTreeIncludesRepaintRects) {
-        String layerTreeTextWithRootRepaintRects = m_renderView->frameView()->trackedRepaintRectsAsText();
+        StringBuilder layerTreeTextWithRootRepaintRects;
+        layerTreeTextWithRootRepaintRects.append(m_renderView->frameView()->trackedRepaintRectsAsText());
         layerTreeTextWithRootRepaintRects.append(layerTreeText);
-        return layerTreeTextWithRootRepaintRects;
+        return layerTreeTextWithRootRepaintRects.toString();
     }
 
     return layerTreeText;
@@ -1394,29 +1382,9 @@
     return true;
 }
 
-// The purpose of this function is to ensure that we call updateLayerTreeGeometry on layer's
-// scroll parent (if it has one) before we call it on layer. This is necessary because updating
-// layer tree geometry for layer will use values we computed for its scroll parent.
-void RenderLayerCompositor::updateLayerTreeGeometryForLayerAndScrollParents(RenderLayer* layer, HashSet<RenderLayer*>& visited, int depth)
-{
-    ASSERT(layer->zIndex() >= 0 || !visited.contains(layer));
-    if (visited.contains(layer))
-        return;
-
-    if (requiresCompositingForOverflowScrollingParent(layer)) {
-        RenderLayer* scrollParent = layer->ancestorScrollingLayer();
-        if (!visited.contains(scrollParent))
-            updateLayerTreeGeometryForLayerAndScrollParents(scrollParent, visited, depth);
-    }
-
-    updateLayerTreeGeometry(layer, visited, depth);
-}
-
 // This just updates layer geometry without changing the hierarchy.
-void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer, HashSet<RenderLayer*>& visited, int depth)
+void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer* layer, int depth)
 {
-    visited.add(layer);
-
     if (RenderLayerBacking* layerBacking = layer->backing()) {
         // The compositing state of all our children has been updated already, so now
         // we can compute and cache the composited bounds for this layer.
@@ -1444,52 +1412,32 @@
     LayerListMutationDetector mutationChecker(layer);
 #endif
 
-    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
-        size_t listSize = normalFlowList->size();
-        for (size_t i = 0; i < listSize; ++i)
-            updateLayerTreeGeometry(normalFlowList->at(i), visited, depth + 1);
-    }
-
     if (layer->isStackingContainer()) {
         if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
             size_t listSize = negZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateLayerTreeGeometryForLayerAndScrollParents(negZOrderList->at(i), visited, depth + 1);
+                updateLayerTreeGeometry(negZOrderList->at(i), depth + 1);
         }
     }
 
+    if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
+        size_t listSize = normalFlowList->size();
+        for (size_t i = 0; i < listSize; ++i)
+            updateLayerTreeGeometry(normalFlowList->at(i), depth + 1);
+    }
+
     if (layer->isStackingContainer()) {
         if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
             size_t listSize = posZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateLayerTreeGeometryForLayerAndScrollParents(posZOrderList->at(i), visited, depth + 1);
+                updateLayerTreeGeometry(posZOrderList->at(i), depth + 1);
         }
     }
 }
 
-// The purpose of this function is to ensure that we call updateCompositingDescendantGeometry on layer's
-// scroll parent (if it has one) before we call it on layer. This is necessary because updating
-// layer tree geometry for layer will use values we computed for its scroll parent.
-void RenderLayerCompositor::updateCompositingDescendantGeometryForLayerAndScrollParents(RenderLayer* compositingAncestor, RenderLayer* layer, HashSet<RenderLayer*>& visited, bool compositedChildrenOnly)
-{
-    ASSERT(layer->zIndex() >= 0 || !visited.contains(layer));
-    if (visited.contains(layer))
-        return;
-
-    if (requiresCompositingForOverflowScrollingParent(layer)) {
-        RenderLayer* scrollParent = layer->ancestorScrollingLayer();
-        if (!visited.contains(scrollParent))
-            updateCompositingDescendantGeometryForLayerAndScrollParents(compositingAncestor, scrollParent, visited, compositedChildrenOnly);
-    }
-
-    updateCompositingDescendantGeometry(compositingAncestor, layer, visited, compositedChildrenOnly);
-}
-
 // Recurs down the RenderLayer tree until its finds the compositing descendants of compositingAncestor and updates their geometry.
-void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer* layer, HashSet<RenderLayer*>& visited, bool compositedChildrenOnly)
+void RenderLayerCompositor::updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer* layer, bool compositedChildrenOnly)
 {
-    visited.add(layer);
-
     if (layer != compositingAncestor) {
         if (RenderLayerBacking* layerBacking = layer->backing()) {
             layerBacking->updateCompositedBounds();
@@ -1506,7 +1454,7 @@
     }
 
     if (layer->reflectionLayer())
-        updateCompositingDescendantGeometry(compositingAncestor, layer->reflectionLayer(), visited, compositedChildrenOnly);
+        updateCompositingDescendantGeometry(compositingAncestor, layer->reflectionLayer(), compositedChildrenOnly);
 
     if (!layer->hasCompositingDescendant())
         return;
@@ -1519,21 +1467,21 @@
         if (Vector<RenderLayer*>* negZOrderList = layer->negZOrderList()) {
             size_t listSize = negZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateCompositingDescendantGeometryForLayerAndScrollParents(compositingAncestor, negZOrderList->at(i), visited, compositedChildrenOnly);
+                updateCompositingDescendantGeometry(compositingAncestor, negZOrderList->at(i), compositedChildrenOnly);
         }
     }
 
     if (Vector<RenderLayer*>* normalFlowList = layer->normalFlowList()) {
         size_t listSize = normalFlowList->size();
         for (size_t i = 0; i < listSize; ++i)
-            updateCompositingDescendantGeometryForLayerAndScrollParents(compositingAncestor, normalFlowList->at(i), visited, compositedChildrenOnly);
+            updateCompositingDescendantGeometry(compositingAncestor, normalFlowList->at(i), compositedChildrenOnly);
     }
 
     if (layer->isStackingContainer()) {
         if (Vector<RenderLayer*>* posZOrderList = layer->posZOrderList()) {
             size_t listSize = posZOrderList->size();
             for (size_t i = 0; i < listSize; ++i)
-                updateCompositingDescendantGeometryForLayerAndScrollParents(compositingAncestor, posZOrderList->at(i), visited, compositedChildrenOnly);
+                updateCompositingDescendantGeometry(compositingAncestor, posZOrderList->at(i), compositedChildrenOnly);
         }
     }
 }
@@ -1660,7 +1608,7 @@
         const IntRect& documentRect = m_renderView->documentRect();
         m_rootContentLayer->setSize(documentRect.size());
         m_rootContentLayer->setPosition(documentRect.location());
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
         if (m_layerForOverhangShadow)
             ScrollbarTheme::theme()->updateOverhangShadowLayer(m_layerForOverhangShadow.get(), m_rootContentLayer.get());
 #endif
@@ -1878,11 +1826,7 @@
     if (!layer->isComposited() || !layer->parent())
         return false;
 
-    // Scroll children use their scrolling ancestor as their clip root.
-    RenderLayer* compositingAncestor = requiresCompositingForOverflowScrollingParent(layer)
-        ? layer->ancestorScrollingLayer()
-        : layer->ancestorCompositingLayer();
-
+    const RenderLayer* compositingAncestor = layer->ancestorCompositingLayer();
     if (!compositingAncestor)
         return false;
 
@@ -1941,6 +1885,11 @@
 
 bool RenderLayerCompositor::requiresCompositingForVideo(RenderObject* renderer) const
 {
+    if (RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() && renderer->isVideo()) {
+        HTMLMediaElement* media = toHTMLMediaElement(renderer->node());
+        return media->isFullscreen();
+    }
+
     if (!(m_compositingTriggers & ChromeClient::VideoTrigger))
         return false;
 
@@ -2261,7 +2210,7 @@
         transformedClip.moveBy(scrollCorner.location());
         m_renderView->frameView()->paintScrollCorner(&context, transformedClip);
         context.restore();
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     } else if (graphicsLayer == layerForOverhangAreas()) {
         ScrollView* view = m_renderView->frameView();
         view->calculateAndPaintOverhangBackground(&context, clip);
@@ -2314,6 +2263,9 @@
 
     if (GraphicsLayer* maskLayer = graphicsLayer->maskLayer())
         resetTrackedRepaintRectsRecursive(maskLayer);
+
+    if (GraphicsLayer* clippingMaskLayer = graphicsLayer->contentsClippingMaskLayer())
+        resetTrackedRepaintRectsRecursive(clippingMaskLayer);
 }
 
 void RenderLayerCompositor::resetTrackedRepaintRects()
@@ -2366,7 +2318,7 @@
     return shouldCompositeOverflowControls(view) && view->isScrollCornerVisible();
 }
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
 bool RenderLayerCompositor::requiresOverhangLayers() const
 {
     // We don't want a layer if this is a subframe.
@@ -2384,7 +2336,7 @@
 
 void RenderLayerCompositor::updateOverflowControlsLayers()
 {
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     if (requiresOverhangLayers()) {
         if (!m_layerForOverhangAreas) {
             m_layerForOverhangAreas = GraphicsLayer::create(graphicsLayerFactory(), this);
@@ -2513,7 +2465,7 @@
 
     detachRootLayer();
 
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     if (m_layerForOverhangAreas) {
         m_layerForOverhangAreas->removeFromParent();
         m_layerForOverhangAreas = nullptr;
@@ -2815,7 +2767,7 @@
     String name;
     if (graphicsLayer == m_rootContentLayer.get()) {
         name = "Content Root Layer";
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     } else if (graphicsLayer == m_layerForOverhangAreas.get()) {
         name = "Overhang Areas Layer";
     } else if (graphicsLayer == m_layerForOverhangAreas.get()) {
diff --git a/Source/core/rendering/RenderLayerCompositor.h b/Source/core/rendering/RenderLayerCompositor.h
index 7b80638..218928b 100644
--- a/Source/core/rendering/RenderLayerCompositor.h
+++ b/Source/core/rendering/RenderLayerCompositor.h
@@ -99,10 +99,7 @@
     bool updateLayerCompositingState(RenderLayer*, CompositingChangeRepaint = CompositingChangeRepaintNow);
 
     // Update the geometry for compositing children of compositingAncestor.
-    void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer*, HashSet<RenderLayer*>& visited, bool compositedChildrenOnly);
-
-    // Ensures that scroll parents have been processed before recurring into updateCompositedDescendantGeometry for the current layer.
-    void updateCompositingDescendantGeometryForLayerAndScrollParents(RenderLayer* compositingAncestor, RenderLayer*, HashSet<RenderLayer*>& visited, bool compositedChildrenOnly);
+    void updateCompositingDescendantGeometry(RenderLayer* compositingAncestor, RenderLayer*, bool compositedChildrenOnly);
 
     // Whether layer's backing needs a graphics layer to do clipping by an ancestor (non-stacking-context parent with overflow).
     bool clippedByAncestor(const RenderLayer*) const;
@@ -186,7 +183,7 @@
     GraphicsLayer* layerForHorizontalScrollbar() const { return m_layerForHorizontalScrollbar.get(); }
     GraphicsLayer* layerForVerticalScrollbar() const { return m_layerForVerticalScrollbar.get(); }
     GraphicsLayer* layerForScrollCorner() const { return m_layerForScrollCorner.get(); }
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     GraphicsLayer* layerForOverhangAreas() const { return m_layerForOverhangAreas.get(); }
 
     GraphicsLayer* updateLayerForTopOverhangArea(bool wantsLayer);
@@ -244,16 +241,10 @@
     void computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer*, OverlapMap*, struct CompositingState&, bool& layersChanged, bool& descendantHas3DTransform, Vector<RenderLayer*>& unclippedDescendants);
 
     // Recurses down the tree, parenting descendant compositing layers and collecting an array of child layers for the current compositing layer.
-    void rebuildCompositingLayerTree(RenderLayer*, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, HashSet<RenderLayer*>& visited, int depth);
-
-    // Ensures that scroll parents have been processed before recurring into rebuildCompositingLayerTree for the current layer.
-    void rebuildCompositingLayerTreeForLayerAndScrollParents(RenderLayer*, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, HashSet<RenderLayer*>& visited, HashMap<RenderLayer*, Vector<GraphicsLayer*> >& childGraphicsLayersOfScrollParents, int depth);
+    void rebuildCompositingLayerTree(RenderLayer*, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth);
 
     // Recurses down the tree, updating layer geometry only.
-    void updateLayerTreeGeometry(RenderLayer*, HashSet<RenderLayer*>& visited, int depth);
-
-    // Ensures that scroll parents have been processed before recurring into updateLayerTree for the current layer.
-    void updateLayerTreeGeometryForLayerAndScrollParents(RenderLayer*, HashSet<RenderLayer*>& visited, int depth);
+    void updateLayerTreeGeometry(RenderLayer*, int depth);
 
     // Hook compositing layers together
     void setCompositingParent(RenderLayer* childLayer, RenderLayer* parentLayer);
@@ -307,7 +298,7 @@
     bool requiresHorizontalScrollbarLayer() const;
     bool requiresVerticalScrollbarLayer() const;
     bool requiresScrollCornerLayer() const;
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     bool requiresOverhangLayers() const;
 #endif
 
@@ -358,7 +349,7 @@
     OwnPtr<GraphicsLayer> m_layerForHorizontalScrollbar;
     OwnPtr<GraphicsLayer> m_layerForVerticalScrollbar;
     OwnPtr<GraphicsLayer> m_layerForScrollCorner;
-#if ENABLE(RUBBER_BANDING)
+#if USE(RUBBER_BANDING)
     OwnPtr<GraphicsLayer> m_layerForOverhangAreas;
     OwnPtr<GraphicsLayer> m_layerForOverhangShadow;
 #endif
diff --git a/Source/core/rendering/RenderLayerModelObject.cpp b/Source/core/rendering/RenderLayerModelObject.cpp
index dda32af..2019c7c 100644
--- a/Source/core/rendering/RenderLayerModelObject.cpp
+++ b/Source/core/rendering/RenderLayerModelObject.cpp
@@ -206,5 +206,10 @@
     }
 }
 
+RenderLayerBacking* RenderLayerModelObject::backing() const
+{
+    return m_layer ? m_layer->backing() : 0;
+}
+
 } // namespace WebCore
 
diff --git a/Source/core/rendering/RenderLayerModelObject.h b/Source/core/rendering/RenderLayerModelObject.h
index 959853b..414fe36 100644
--- a/Source/core/rendering/RenderLayerModelObject.h
+++ b/Source/core/rendering/RenderLayerModelObject.h
@@ -28,6 +28,7 @@
 namespace WebCore {
 
 class RenderLayer;
+class RenderLayerBacking;
 class ScrollableArea;
 
 class RenderLayerModelObject : public RenderObject {
@@ -55,6 +56,8 @@
     // This is null for anonymous renderers.
     ContainerNode* node() const { return toContainerNode(RenderObject::node()); }
 
+    RenderLayerBacking* backing() const;
+
 protected:
     void ensureLayer();
 
diff --git a/Source/core/rendering/RenderLayerScrollableArea.cpp b/Source/core/rendering/RenderLayerScrollableArea.cpp
index 08d919c..e3ee6e6 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.cpp
+++ b/Source/core/rendering/RenderLayerScrollableArea.cpp
@@ -44,6 +44,7 @@
 #include "config.h"
 #include "core/rendering/RenderLayer.h"
 
+#include "core/css/PseudoStyleRequest.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/editing/FrameSelection.h"
 #include "core/inspector/InspectorInstrumentation.h"
@@ -56,6 +57,7 @@
 #include "core/platform/graphics/GraphicsLayer.h"
 #include "core/rendering/RenderLayerCompositor.h"
 #include "core/rendering/RenderScrollbar.h"
+#include "core/rendering/RenderScrollbarPart.h"
 #include "core/rendering/RenderView.h"
 
 namespace WebCore {
@@ -64,6 +66,7 @@
     : m_layer(layer)
     , m_scrollDimensionsDirty(true)
     , m_inOverflowRelayout(false)
+    , m_scrollCorner(0)
 {
     ScrollableArea::setConstrainsScrollingToContentEdge(false);
 
@@ -100,6 +103,9 @@
 
     destroyScrollbar(HorizontalScrollbar);
     destroyScrollbar(VerticalScrollbar);
+
+    if (m_scrollCorner)
+        m_scrollCorner->destroy();
 }
 
 ScrollableArea* RenderLayerScrollableArea::enclosingScrollableArea() const
@@ -166,6 +172,13 @@
 
 void RenderLayerScrollableArea::invalidateScrollCornerRect(const IntRect& rect)
 {
+    if (GraphicsLayer* layer = layerForScrollCorner()) {
+        layer->setNeedsDisplayInRect(rect);
+        return;
+    }
+
+    if (m_scrollCorner)
+        m_scrollCorner->repaintRectangle(rect);
     m_layer->invalidateScrollCornerRect(rect);
 }
 
@@ -586,6 +599,8 @@
         m_hBar->styleChanged();
     if (m_vBar)
         m_vBar->styleChanged();
+
+    updateScrollCornerStyle();
 }
 
 IntSize RenderLayerScrollableArea::clampScrollOffset(const IntSize& scrollOffset) const
@@ -778,6 +793,26 @@
         hBarRect.move(offsetFromRoot);
         horizontalScrollbar->setFrameRect(hBarRect);
     }
+
+    const IntRect& scrollCorner = scrollCornerRect();
+    if (m_scrollCorner)
+        m_scrollCorner->setFrameRect(scrollCorner);
+}
+
+void RenderLayerScrollableArea::updateScrollCornerStyle()
+{
+    RenderObject* actualRenderer = rendererForScrollbar(renderer());
+    RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer->getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->style()) : PassRefPtr<RenderStyle>(0);
+    if (corner) {
+        if (!m_scrollCorner) {
+            m_scrollCorner = RenderScrollbarPart::createAnonymous(&renderer()->document());
+            m_scrollCorner->setParent(renderer());
+        }
+        m_scrollCorner->setStyle(corner.release());
+    } else if (m_scrollCorner) {
+        m_scrollCorner->destroy();
+        m_scrollCorner = 0;
+    }
 }
 
 // FIXME: Move m_cachedOverlayScrollbarOffset.
@@ -818,6 +853,42 @@
         m_hBar->paint(context, damageRect);
     if (m_vBar && !layerForVerticalScrollbar())
         m_vBar->paint(context, damageRect);
+
+    if (layerForScrollCorner())
+        return;
+
+    // We fill our scroll corner with white if we have a scrollbar that doesn't run all the way up to the
+    // edge of the box.
+    IntPoint adjustedPaintOffset = paintOffset;
+    if (paintingOverlayControls)
+        adjustedPaintOffset = m_layer->m_cachedOverlayScrollbarOffset;
+
+    paintScrollCorner(context, adjustedPaintOffset, damageRect);
+}
+
+void RenderLayerScrollableArea::paintScrollCorner(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
+{
+    ASSERT(renderer()->isBox());
+
+    IntRect absRect = scrollCornerRect();
+    absRect.moveBy(paintOffset);
+    if (!absRect.intersects(damageRect))
+        return;
+
+    if (context->updatingControlTints()) {
+        updateScrollCornerStyle();
+        return;
+    }
+
+    if (m_scrollCorner) {
+        m_scrollCorner->paintIntoRect(context, paintOffset, absRect);
+        return;
+    }
+
+    // We don't want to paint white if we have overlay scrollbars, since we need
+    // to see what is behind it.
+    if (!hasOverlayScrollbars())
+        context->fillRect(absRect, Color::white);
 }
 
 bool RenderLayerScrollableArea::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint, const IntRect& resizeControlRect)
@@ -848,6 +919,8 @@
         }
     }
 
+    // FIXME: We should hit test the m_scrollCorner and pass it back through the result.
+
     return false;
 }
 
diff --git a/Source/core/rendering/RenderLayerScrollableArea.h b/Source/core/rendering/RenderLayerScrollableArea.h
index ea9153e..05e06d3 100644
--- a/Source/core/rendering/RenderLayerScrollableArea.h
+++ b/Source/core/rendering/RenderLayerScrollableArea.h
@@ -60,6 +60,7 @@
 
 class RenderLayer;
 class RenderLayerModelObject;
+class RenderScrollbarPart;
 
 class RenderLayerScrollableArea FINAL : public ScrollableArea {
     // FIXME: Remove once the bits from RenderLayer have been moved here.
@@ -119,7 +120,10 @@
     void updateAfterLayout();
     void updateAfterStyleChange(const RenderStyle*);
 
-    bool hasScrollbar() { return m_hBar || m_vBar; }
+    bool hasScrollbar() const { return m_hBar || m_vBar; }
+
+    // FIXME: This should be removed.
+    bool hasScrollCorner() const { return m_scrollCorner; }
 
 private:
     bool hasHorizontalOverflow() const;
@@ -156,7 +160,9 @@
     int horizontalScrollbarHeight(OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
 
     void positionOverflowControls(const IntSize& offsetFromRoot);
+    void updateScrollCornerStyle();
     void paintOverflowControls(GraphicsContext*, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls);
+    void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& damageRect);
     bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint, const IntRect&);
 
     RenderLayerModelObject* renderer() const;
@@ -175,6 +181,9 @@
     // For areas with overflow, we have a pair of scrollbars.
     RefPtr<Scrollbar> m_hBar;
     RefPtr<Scrollbar> m_vBar;
+
+    // Renderers to hold our custom scroll corner.
+    RenderScrollbarPart* m_scrollCorner;
 };
 
 } // Namespace WebCore
diff --git a/Source/core/rendering/RenderListBox.cpp b/Source/core/rendering/RenderListBox.cpp
index 8dedc00..1abdb9a 100644
--- a/Source/core/rendering/RenderListBox.cpp
+++ b/Source/core/rendering/RenderListBox.cpp
@@ -36,7 +36,7 @@
 #include "core/css/CSSFontSelector.h"
 #include "core/css/resolver/StyleResolver.h"
 #include "core/dom/Document.h"
-#include "core/dom/DocumentEventQueue.h"
+#include "core/events/DocumentEventQueue.h"
 #include "core/dom/NodeRenderStyle.h"
 #include "core/editing/FrameSelection.h"
 #include "core/html/HTMLOptGroupElement.h"
diff --git a/Source/core/rendering/RenderMenuList.cpp b/Source/core/rendering/RenderMenuList.cpp
index bb7451e..df13d20 100644
--- a/Source/core/rendering/RenderMenuList.cpp
+++ b/Source/core/rendering/RenderMenuList.cpp
@@ -388,7 +388,7 @@
     HTMLElement* listItem = select->listItems()[listIndex];
     ASSERT(listItem);
     if (listItem->attached()) {
-        if (AccessibilityMenuList* menuList = static_cast<AccessibilityMenuList*>(document().axObjectCache()->get(this)))
+        if (AccessibilityMenuList* menuList = toAccessibilityMenuList(document().axObjectCache()->get(this)))
             menuList->didUpdateActiveOption(optionIndex);
     }
 }
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 4f87cef..a821287 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -2723,6 +2723,15 @@
     return hasLayer() && toRenderLayerModelObject(this)->layer()->isComposited();
 }
 
+bool RenderObject::canResize() const
+{
+    // We need a special case for <iframe> because they never have
+    // hasOverflowClip(). However, they do "implicitly" clip their contents, so
+    // we want to allow resizing them also.
+    return (hasOverflowClip() || isRenderIFrame()) && style()->resize() != RESIZE_NONE;
+}
+
+
 bool RenderObject::hitTest(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter hitTestFilter)
 {
     bool inside = false;
@@ -3297,6 +3306,8 @@
     return false;
 }
 
+// FIXME: This should really use local coords
+// Works on absolute coords - expensive to call
 bool RenderObject::isContainedInParentBoundingBox() const
 {
     if (!parent())
@@ -3306,6 +3317,11 @@
     return parentRect.contains(absoluteBoundingBoxRect());
 }
 
+bool RenderObject::isRelayoutBoundaryForInspector() const
+{
+    return objectIsRelayoutBoundary(this);
+}
+
 } // namespace WebCore
 
 #ifndef NDEBUG
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 272d765..69e7c07 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -139,7 +139,8 @@
 // Base class for all rendering tree objects.
 class RenderObject : public ImageResourceClient {
     friend class RenderBlock;
-    friend class RenderLayer;
+    friend class RenderLayer; // For setParent.
+    friend class RenderLayerScrollableArea; // For setParent.
     friend class RenderObjectChildList;
 public:
     // Anonymous objects should pass the document as their node, and they will then automatically be
@@ -244,6 +245,7 @@
         for (const RenderObject* renderer = this; renderer; renderer = renderer->nextInPreOrder())
             renderer->assertRendererLaidOut();
     }
+
 #endif
 
     // Obtains the nearest enclosing block (including this block) that contributes a first-line style to our inline
@@ -698,6 +700,11 @@
 
     bool isComposited() const;
 
+    // FIXME: This should be moved to RenderBox once the scrolling code
+    // has been completely separated from RenderLayer and made to assume
+    // it talks to a RenderBox, not just a RenderObject.
+    bool canResize() const;
+
     bool hitTest(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestFilter = HitTestAll);
     virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&);
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
@@ -988,6 +995,8 @@
 
     RespectImageOrientationEnum shouldRespectImageOrientation() const;
 
+    bool isRelayoutBoundaryForInspector() const;
+
 protected:
     inline bool layerCreationAllowedForSubtree() const;
 
diff --git a/Source/core/rendering/RenderReplaced.cpp b/Source/core/rendering/RenderReplaced.cpp
index 900fa7d..f5b2bc4 100644
--- a/Source/core/rendering/RenderReplaced.cpp
+++ b/Source/core/rendering/RenderReplaced.cpp
@@ -119,11 +119,14 @@
         return;
     }
 
+    if (paintInfo.phase == PaintPhaseClippingMask && (!hasLayer() || !layer()->hasCompositedClippingMask()))
+        return;
+
     LayoutRect paintRect = LayoutRect(adjustedPaintOffset, size());
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
         paintOutline(paintInfo, paintRect);
 
-    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren())
+    if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection && !canHaveChildren() && paintInfo.phase != PaintPhaseClippingMask)
         return;
 
     if (!paintInfo.shouldPaintWithinRoot(this))
@@ -152,7 +155,11 @@
     }
 
     if (!completelyClippedOut) {
-        paintReplaced(paintInfo, adjustedPaintOffset);
+        if (paintInfo.phase == PaintPhaseClippingMask) {
+            paintClippingMask(paintInfo, adjustedPaintOffset);
+        } else {
+            paintReplaced(paintInfo, adjustedPaintOffset);
+        }
 
         if (style()->hasBorderRadius())
             paintInfo.context->restore();
@@ -170,7 +177,7 @@
 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseOutline && paintInfo.phase != PaintPhaseSelfOutline
-            && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseMask)
+        && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != PaintPhaseMask && paintInfo.phase != PaintPhaseClippingMask)
         return false;
 
     if (!paintInfo.shouldPaintWithinRoot(this))
@@ -316,7 +323,7 @@
     LayoutRect contentRect = contentBoxRect();
     ObjectFit objectFit = style()->objectFit();
 
-    if (objectFit == ObjectFitFill) {
+    if (objectFit == ObjectFitFill && style()->objectPosition() == RenderStyle::initialObjectPosition()) {
         if (!isVideo() || RuntimeEnabledFeatures::objectFitPositionEnabled())
             return contentRect;
         objectFit = ObjectFitContain;
@@ -339,13 +346,13 @@
         finalRect.setSize(intrinsicSize);
         break;
     case ObjectFitFill:
+        break;
+    default:
         ASSERT_NOT_REACHED();
     }
 
-    // FIXME: This is where object-position should be taken into account, but since it's not
-    // implemented yet, assume the initial value of "50% 50%".
-    LayoutUnit xOffset = (contentRect.width() - finalRect.width()) / 2;
-    LayoutUnit yOffset = (contentRect.height() - finalRect.height()) / 2;
+    LayoutUnit xOffset = minimumValueForLength(style()->objectPosition().x(), contentRect.width() - finalRect.width(), view());
+    LayoutUnit yOffset = minimumValueForLength(style()->objectPosition().y(), contentRect.height() - finalRect.height(), view());
     finalRect.move(xOffset, yOffset);
 
     return finalRect;
diff --git a/Source/core/rendering/RenderTable.cpp b/Source/core/rendering/RenderTable.cpp
index 2979a16..ead0702 100644
--- a/Source/core/rendering/RenderTable.cpp
+++ b/Source/core/rendering/RenderTable.cpp
@@ -30,6 +30,7 @@
 #include "core/dom/Document.h"
 #include "core/html/HTMLTableElement.h"
 #include "core/page/FrameView.h"
+#include "core/platform/graphics/GraphicsContextStateSaver.h"
 #include "core/rendering/AutoTableLayout.h"
 #include "core/rendering/FixedTableLayout.h"
 #include "core/rendering/HitTestResult.h"
@@ -200,15 +201,15 @@
 
 void RenderTable::addCaption(const RenderTableCaption* caption)
 {
-    ASSERT(m_captions.find(caption) == notFound);
+    ASSERT(m_captions.find(caption) == kNotFound);
     m_captions.append(const_cast<RenderTableCaption*>(caption));
 }
 
 void RenderTable::removeCaption(const RenderTableCaption* oldCaption)
 {
     size_t index = m_captions.find(oldCaption);
-    ASSERT(index != notFound);
-    if (index == notFound)
+    ASSERT(index != kNotFound);
+    if (index == kNotFound)
         return;
 
     m_captions.remove(index);
@@ -718,14 +719,15 @@
 
     LayoutRect rect(paintOffset, size());
     subtractCaptionRect(rect);
+    paintBoxDecorationsWithRect(paintInfo, paintOffset, rect);
+}
 
-    BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(paintInfo.context);
-    if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance))
-        paintBoxShadow(paintInfo, rect, style(), Normal);
+void RenderTable::paintBackgroundWithBorderAndBoxShadow(PaintInfo& paintInfo, const LayoutRect& rect, BackgroundBleedAvoidance bleedAvoidance)
+{
     paintBackground(paintInfo, rect, bleedAvoidance);
     paintBoxShadow(paintInfo, rect, style(), Inset);
 
-    if (style()->hasBorder() && !collapseBorders())
+    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && !style()->hasAppearance() && style()->hasBorder() && !collapseBorders())
         paintBorder(paintInfo, rect, style());
 }
 
diff --git a/Source/core/rendering/RenderTable.h b/Source/core/rendering/RenderTable.h
index 686d943..d21fdd6 100644
--- a/Source/core/rendering/RenderTable.h
+++ b/Source/core/rendering/RenderTable.h
@@ -276,6 +276,7 @@
     virtual void paint(PaintInfo&, const LayoutPoint&);
     virtual void paintObject(PaintInfo&, const LayoutPoint&);
     virtual void paintBoxDecorations(PaintInfo&, const LayoutPoint&);
+    virtual void paintBackgroundWithBorderAndBoxShadow(PaintInfo&, const LayoutRect&, BackgroundBleedAvoidance) OVERRIDE;
     virtual void paintMask(PaintInfo&, const LayoutPoint&);
     virtual void layout();
     virtual bool supportsPartialLayout() const OVERRIDE { return false; }
diff --git a/Source/core/rendering/RenderTableSection.cpp b/Source/core/rendering/RenderTableSection.cpp
index b49f47f..4845ec9 100644
--- a/Source/core/rendering/RenderTableSection.cpp
+++ b/Source/core/rendering/RenderTableSection.cpp
@@ -253,6 +253,27 @@
     cell->setCol(table()->effColToCol(col));
 }
 
+bool RenderTableSection::rowHasOnlySpanningCells(unsigned row)
+{
+    unsigned totalCols = m_grid[row].row.size();
+
+    if (!totalCols)
+        return false;
+
+    for (unsigned col = 0; col < totalCols; col++) {
+        const CellStruct& rowSpanCell = cellAt(row, col);
+
+        // Empty cell is not a valid cell so it is not a rowspan cell.
+        if (rowSpanCell.cells.isEmpty())
+            return false;
+
+        if (rowSpanCell.cells[0]->rowSpan() == 1)
+            return false;
+    }
+
+    return true;
+}
+
 void RenderTableSection::populateSpanningRowsHeightFromCell(RenderTableCell* cell, struct SpanningRowsHeight& spanningRowsHeight)
 {
     const unsigned rowSpan = cell->rowSpan();
@@ -264,7 +285,11 @@
     spanningRowsHeight.totalRowsHeight = 0;
     for (unsigned row = 0; row < rowSpan; row++) {
         unsigned actualRow = row + rowIndex;
+
         spanningRowsHeight.rowHeight[row] = m_rowPos[actualRow + 1] - m_rowPos[actualRow] - borderSpacingForRow(actualRow);
+        if (!spanningRowsHeight.rowHeight[row])
+            spanningRowsHeight.rowWithOnlySpanningCells |= rowHasOnlySpanningCells(actualRow);
+
         spanningRowsHeight.totalRowsHeight += spanningRowsHeight.rowHeight[row];
         spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing -= borderSpacingForRow(actualRow);
     }
@@ -395,6 +420,78 @@
     return false;
 }
 
+bool RenderTableSection::isHeightNeededForRowHavingOnlySpanningCells(unsigned row)
+{
+    unsigned totalCols = m_grid[row].row.size();
+
+    if (!totalCols)
+        return false;
+
+    for (unsigned col = 0; col < totalCols; col++) {
+        const CellStruct& rowSpanCell = cellAt(row, col);
+
+        if (rowSpanCell.cells.size()) {
+            RenderTableCell* cell = rowSpanCell.cells[0];
+            const unsigned rowIndex = cell->rowIndex();
+            const unsigned rowSpan = cell->rowSpan();
+            int totalRowSpanCellHeight = 0;
+
+            for (unsigned row = 0; row < rowSpan; row++) {
+                unsigned actualRow = row + rowIndex;
+                totalRowSpanCellHeight += m_rowPos[actualRow + 1] - m_rowPos[actualRow];
+            }
+            totalRowSpanCellHeight -= borderSpacingForRow(rowIndex + rowSpan - 1);
+
+            if (totalRowSpanCellHeight < cell->logicalHeightForRowSizing())
+                return true;
+        }
+    }
+
+    return false;
+}
+
+unsigned RenderTableSection::calcRowHeightHavingOnlySpanningCells(unsigned row)
+{
+    ASSERT(rowHasOnlySpanningCells(row));
+
+    unsigned totalCols = m_grid[row].row.size();
+
+    if (!totalCols)
+        return 0;
+
+    unsigned rowHeight = 0;
+
+    for (unsigned col = 0; col < totalCols; col++) {
+        const CellStruct& rowSpanCell = cellAt(row, col);
+        if (rowSpanCell.cells.size() && rowSpanCell.cells[0]->rowSpan() > 1)
+            rowHeight = max(rowHeight, rowSpanCell.cells[0]->logicalHeightForRowSizing() / rowSpanCell.cells[0]->rowSpan());
+    }
+
+    return rowHeight;
+}
+
+void RenderTableSection::updateRowsHeightHavingOnlySpanningCells(RenderTableCell* cell, struct SpanningRowsHeight& spanningRowsHeight)
+{
+    ASSERT(spanningRowsHeight.rowHeight.size());
+
+    int accumulatedPositionIncrease = 0;
+    const unsigned rowSpan = cell->rowSpan();
+    const unsigned rowIndex = cell->rowIndex();
+
+    ASSERT(rowSpan == spanningRowsHeight.rowHeight.size());
+
+    for (unsigned row = 0; row < spanningRowsHeight.rowHeight.size(); row++) {
+        unsigned actualRow = row + rowIndex;
+        if (!spanningRowsHeight.rowHeight[row] && rowHasOnlySpanningCells(actualRow) && isHeightNeededForRowHavingOnlySpanningCells(actualRow)) {
+            spanningRowsHeight.rowHeight[row] = calcRowHeightHavingOnlySpanningCells(actualRow);
+            accumulatedPositionIncrease += spanningRowsHeight.rowHeight[row];
+        }
+        m_rowPos[actualRow + 1] += accumulatedPositionIncrease;
+    }
+
+    spanningRowsHeight.totalRowsHeight += accumulatedPositionIncrease;
+}
+
 // Distribute rowSpan cell height in rows those comes in rowSpan cell based on the ratio of row's height if
 // 1. RowSpan cell height is greater then the total height of rows in rowSpan cell
 void RenderTableSection::distributeRowSpanHeightToRows(SpanningRenderTableCells& rowSpanCells)
@@ -444,8 +541,13 @@
 
         populateSpanningRowsHeightFromCell(cell, spanningRowsHeight);
 
-        if (!spanningRowsHeight.totalRowsHeight || spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing <= spanningRowsHeight.totalRowsHeight)
+        if (spanningRowsHeight.rowWithOnlySpanningCells)
+            updateRowsHeightHavingOnlySpanningCells(cell, spanningRowsHeight);
+
+        if (!spanningRowsHeight.totalRowsHeight || spanningRowsHeight.spanningCellHeightIgnoringBorderSpacing <= spanningRowsHeight.totalRowsHeight) {
+            extraHeightToPropagate = m_rowPos[rowIndex + rowSpan] - originalBeforePosition;
             continue;
+        }
 
         int totalPercent = 0;
         int totalAutoRowsHeight = 0;
diff --git a/Source/core/rendering/RenderTableSection.h b/Source/core/rendering/RenderTableSection.h
index 2707d74..c7b0bc0 100644
--- a/Source/core/rendering/RenderTableSection.h
+++ b/Source/core/rendering/RenderTableSection.h
@@ -129,12 +129,14 @@
         SpanningRowsHeight()
             : totalRowsHeight(0)
             , spanningCellHeightIgnoringBorderSpacing(0)
+            , rowWithOnlySpanningCells(false)
         {
         }
 
         Vector<int> rowHeight;
         int totalRowsHeight;
         int spanningCellHeightIgnoringBorderSpacing;
+        bool rowWithOnlySpanningCells;
     };
 
     const BorderValue& borderAdjoiningTableStart() const
@@ -241,6 +243,11 @@
 
     void ensureRows(unsigned);
 
+    bool rowHasOnlySpanningCells(unsigned);
+    unsigned calcRowHeightHavingOnlySpanningCells(unsigned);
+    void updateRowsHeightHavingOnlySpanningCells(RenderTableCell*, struct SpanningRowsHeight&);
+    bool isHeightNeededForRowHavingOnlySpanningCells(unsigned);
+
     void populateSpanningRowsHeightFromCell(RenderTableCell*, struct SpanningRowsHeight&);
     void distributeExtraRowSpanHeightToPercentRows(RenderTableCell*, int, int&, Vector<int>&);
     void distributeExtraRowSpanHeightToAutoRows(RenderTableCell*, int, int&, Vector<int>&);
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index 6e1703a..b5f82e1 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -330,10 +330,10 @@
             // Change the height and y position (or width and x for vertical text)
             // because selectionRect uses selection-specific values.
             if (box->isHorizontal()) {
-                r.setHeight(box->logicalHeight());
+                r.setHeight(box->height());
                 r.setY(box->y());
             } else {
-                r.setWidth(box->logicalWidth());
+                r.setWidth(box->width());
                 r.setX(box->x());
             }
         }
@@ -1366,7 +1366,7 @@
         return;
 
     int lastTypedCharacterOffsetToReveal = -1;
-    String revealedText;
+    StringBuilder revealedText;
     SecureTextTimer* secureTextTimer = gSecureTextTimers ? gSecureTextTimers->get(this) : 0;
     if (secureTextTimer && secureTextTimer->isActive()) {
         lastTypedCharacterOffsetToReveal = secureTextTimer->lastTypedCharacterOffset();
@@ -1376,7 +1376,7 @@
 
     m_text.fill(mask);
     if (lastTypedCharacterOffsetToReveal >= 0) {
-        m_text.replace(lastTypedCharacterOffsetToReveal, 1, revealedText);
+        m_text.replace(lastTypedCharacterOffsetToReveal, 1, revealedText.toString());
         // m_text may be updated later before timer fires. We invalidate the lastTypedCharacterOffset to avoid inconsistency.
         secureTextTimer->invalidate();
     }
diff --git a/Source/core/rendering/RenderTextControlSingleLine.cpp b/Source/core/rendering/RenderTextControlSingleLine.cpp
index 3d3985a..4725026 100644
--- a/Source/core/rendering/RenderTextControlSingleLine.cpp
+++ b/Source/core/rendering/RenderTextControlSingleLine.cpp
@@ -53,6 +53,16 @@
 {
 }
 
+inline Element* RenderTextControlSingleLine::containerElement() const
+{
+    return inputElement()->userAgentShadowRoot()->getElementById(ShadowElementNames::textFieldContainer());
+}
+
+inline Element* RenderTextControlSingleLine::editingViewPortElement() const
+{
+    return inputElement()->userAgentShadowRoot()->getElementById(ShadowElementNames::editingViewPort());
+}
+
 inline HTMLElement* RenderTextControlSingleLine::innerSpinButtonElement() const
 {
     return toHTMLElement(inputElement()->userAgentShadowRoot()->getElementById(ShadowElementNames::spinButton()));
@@ -60,7 +70,7 @@
 
 RenderStyle* RenderTextControlSingleLine::textBaseStyle() const
 {
-    HTMLElement* viewPort = editingViewPortElement();
+    Element* viewPort = editingViewPortElement();
     return viewPort ? viewPort->renderer()->style() : style();
 }
 
@@ -118,7 +128,7 @@
 
     RenderBlockFlow::layoutBlock(false);
 
-    HTMLElement* container = containerElement();
+    Element* container = containerElement();
     RenderBox* containerRenderer = container ? container->renderBox() : 0;
 
     // Set the text block height
@@ -212,7 +222,7 @@
     //  - we hit a node inside the inner text element,
     //  - we hit the <input> element (e.g. we're over the border or padding), or
     //  - we hit regions not in any decoration buttons.
-    HTMLElement* container = containerElement();
+    Element* container = containerElement();
     if (result.innerNode()->isDescendantOf(innerTextElement()) || result.innerNode() == node() || (container && container == result.innerNode())) {
         LayoutPoint pointInParent = locationInContainer.point();
         if (container && editingViewPortElement()) {
@@ -233,12 +243,12 @@
 
     // We may have set the width and the height in the old style in layout().
     // Reset them now to avoid getting a spurious layout hint.
-    HTMLElement* viewPort = editingViewPortElement();
+    Element* viewPort = editingViewPortElement();
     if (RenderObject* viewPortRenderer = viewPort ? viewPort->renderer() : 0) {
         viewPortRenderer->style()->setHeight(Length());
         viewPortRenderer->style()->setWidth(Length());
     }
-    HTMLElement* container = containerElement();
+    Element* container = containerElement();
     if (RenderObject* containerRenderer = container ? container->renderer() : 0) {
         containerRenderer->style()->setHeight(Length());
         containerRenderer->style()->setWidth(Length());
diff --git a/Source/core/rendering/RenderTextControlSingleLine.h b/Source/core/rendering/RenderTextControlSingleLine.h
index 8a9a986..3e0ba87 100644
--- a/Source/core/rendering/RenderTextControlSingleLine.h
+++ b/Source/core/rendering/RenderTextControlSingleLine.h
@@ -42,8 +42,8 @@
 protected:
     virtual void centerContainerIfNeeded(RenderBox*) const { }
     virtual LayoutUnit computeLogicalHeightLimit() const;
-    HTMLElement* containerElement() const;
-    HTMLElement* editingViewPortElement() const;
+    Element* containerElement() const;
+    Element* editingViewPortElement() const;
     HTMLInputElement* inputElement() const;
     virtual void updateFromElement() OVERRIDE;
 
@@ -84,16 +84,6 @@
     LayoutUnit m_desiredInnerTextLogicalHeight;
 };
 
-inline HTMLElement* RenderTextControlSingleLine::containerElement() const
-{
-    return inputElement()->containerElement();
-}
-
-inline HTMLElement* RenderTextControlSingleLine::editingViewPortElement() const
-{
-    return inputElement()->editingViewPortElement();
-}
-
 inline RenderTextControlSingleLine* toRenderTextControlSingleLine(RenderObject* object)
 {
     ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isTextField());
diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
index 3af370b..87c69d0 100644
--- a/Source/core/rendering/RenderTheme.cpp
+++ b/Source/core/rendering/RenderTheme.cpp
@@ -34,7 +34,7 @@
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLMeterElement.h"
 #include "core/html/HTMLOptionElement.h"
-#include "core/html/InputTypeNames.h"
+#include "core/html/forms/InputTypeNames.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html/shadow/MediaControlElements.h"
 #include "core/html/shadow/ShadowElementNames.h"
@@ -497,7 +497,7 @@
     if (RuntimeEnabledFeatures::dialogElementEnabled()) {
         runtimeCSS.appendLiteral("dialog:not([open]) { display: none; }");
         runtimeCSS.appendLiteral("dialog { position: absolute; left: 0; right: 0; width: -webkit-fit-content; height: -webkit-fit-content; margin: auto; border: solid; padding: 1em; background: white; color: black;}");
-        runtimeCSS.appendLiteral("dialog::backdrop { background: rgba(0,0,0,0.1); }");
+        runtimeCSS.appendLiteral("dialog::backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.1); }");
     }
 
     return runtimeCSS.toString();
@@ -827,7 +827,7 @@
     if (!node || !node->active() || !node->isElementNode()
         || !toElement(node)->isSpinButtonElement())
         return false;
-    SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
+    SpinButtonElement* element = toSpinButtonElement(node);
     return element->upDownState() == SpinButtonElement::Up;
 }
 
@@ -846,7 +846,7 @@
         return false;
     if (!node->isElementNode() || !toElement(node)->isSpinButtonElement())
         return node->hovered();
-    SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
+    SpinButtonElement* element = toSpinButtonElement(node);
     return element->hovered() && element->upDownState() != SpinButtonElement::Indeterminate;
 }
 
@@ -855,7 +855,7 @@
     Node* node = o->node();
     if (!node || !node->isElementNode() || !toElement(node)->isSpinButtonElement())
         return false;
-    SpinButtonElement* element = static_cast<SpinButtonElement*>(node);
+    SpinButtonElement* element = toSpinButtonElement(node);
     return element->upDownState() == SpinButtonElement::Up;
 }
 
diff --git a/Source/core/rendering/RenderView.cpp b/Source/core/rendering/RenderView.cpp
index c18c9d0..474aff6 100644
--- a/Source/core/rendering/RenderView.cpp
+++ b/Source/core/rendering/RenderView.cpp
@@ -705,6 +705,27 @@
     }
 }
 
+// When exploring the RenderTree looking for the nodes involved in the Selection, sometimes it's
+// required to change the traversing direction because the "start" position is below the "end" one.
+static inline RenderObject* getNextOrPrevRenderObjectBasedOnDirection(const RenderObject* o, const RenderObject* stop, bool& continueExploring, bool& exploringBackwards)
+{
+    RenderObject* next;
+    if (exploringBackwards) {
+        next = o->previousInPreOrder();
+        continueExploring = next && !(next)->isRenderView();
+    } else {
+        next = o->nextInPreOrder();
+        continueExploring = next && next != stop;
+        exploringBackwards = !next && (next != stop);
+        if (exploringBackwards) {
+            next = stop->previousInPreOrder();
+            continueExploring = next && !next->isRenderView();
+        }
+    }
+
+    return next;
+}
+
 void RenderView::setSelection(RenderObject* start, int startPos, RenderObject* end, int endPos, SelectionRepaintMode blockRepaintMode)
 {
     // Make sure both our start and end objects are defined.
@@ -717,9 +738,6 @@
         m_selectionEnd == end && m_selectionEndPos == endPos)
         return;
 
-    if ((start && end) && (start->flowThreadContainingBlock() != end->flowThreadContainingBlock()))
-        return;
-
     // Record the old selected objects.  These will be used later
     // when we compare against the new selected objects.
     int oldStartPos = m_selectionStartPos;
@@ -739,7 +757,9 @@
 
     RenderObject* os = m_selectionStart;
     RenderObject* stop = rendererAfterPosition(m_selectionEnd, m_selectionEndPos);
-    while (os && os != stop) {
+    bool exploringBackwards = false;
+    bool continueExploring = os && (os != stop);
+    while (continueExploring) {
         if ((os->canBeSelectionLeaf() || os == m_selectionStart || os == m_selectionEnd) && os->selectionState() != SelectionNone) {
             // Blocks are responsible for painting line gaps and margin gaps.  They must be examined as well.
             oldSelectedObjects.set(os, adoptPtr(new RenderSelectionInfo(os, true)));
@@ -755,7 +775,7 @@
             }
         }
 
-        os = os->nextInPreOrder();
+        os = getNextOrPrevRenderObjectBasedOnDirection(os, stop, continueExploring, exploringBackwards);
     }
 
     // Now clear the selection.
@@ -794,7 +814,9 @@
     // Now that the selection state has been updated for the new objects, walk them again and
     // put them in the new objects list.
     o = start;
-    while (o && o != stop) {
+    exploringBackwards = false;
+    continueExploring = o && (o != stop);
+    while (continueExploring) {
         if ((o->canBeSelectionLeaf() || o == start || o == end) && o->selectionState() != SelectionNone) {
             newSelectedObjects.set(o, adoptPtr(new RenderSelectionInfo(o, true)));
             RenderBlock* cb = o->containingBlock();
@@ -807,7 +829,7 @@
             }
         }
 
-        o = o->nextInPreOrder();
+        o = getNextOrPrevRenderObjectBasedOnDirection(o, stop, continueExploring, exploringBackwards);
     }
 
     if (!m_frameView || blockRepaintMode == RepaintNothing)
diff --git a/Source/core/rendering/RenderWidget.cpp b/Source/core/rendering/RenderWidget.cpp
index 51f879a..8a076db 100644
--- a/Source/core/rendering/RenderWidget.cpp
+++ b/Source/core/rendering/RenderWidget.cpp
@@ -301,7 +301,7 @@
         paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor());
     }
 
-    if (hasLayer() && layer()->canResize())
+    if (canResize())
         layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
 }
 
diff --git a/Source/core/rendering/animation/WebAnimationProvider.cpp b/Source/core/rendering/animation/WebAnimationProvider.cpp
new file mode 100644
index 0000000..79a5ccb
--- /dev/null
+++ b/Source/core/rendering/animation/WebAnimationProvider.cpp
@@ -0,0 +1,214 @@
+/*
+ * 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
+ * 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. ``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
+ * 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.
+ */
+
+#include "config.h"
+
+#include "core/rendering/animation/WebAnimationProvider.h"
+
+#include "core/platform/animation/AnimationTranslationUtil.h"
+#include "core/platform/animation/CSSAnimationData.h"
+#include "core/rendering/style/KeyframeList.h"
+#include "core/rendering/style/RenderStyle.h"
+#include "public/platform/WebAnimation.h"
+#include "wtf/text/StringBuilder.h"
+
+using WebKit::WebAnimation;
+
+namespace WebCore {
+
+namespace {
+
+String animationNameForTransition(AnimatedPropertyID property)
+{
+    // | is not a valid identifier character in CSS, so this can never conflict with a keyframe identifier.
+    StringBuilder id;
+    id.appendLiteral("-|transition");
+    id.appendNumber(static_cast<int>(property));
+    id.append('-');
+    return id.toString();
+}
+
+AnimatedPropertyID cssToGraphicsLayerProperty(CSSPropertyID cssProperty)
+{
+    switch (cssProperty) {
+    case CSSPropertyWebkitTransform:
+        return AnimatedPropertyWebkitTransform;
+    case CSSPropertyOpacity:
+        return AnimatedPropertyOpacity;
+    case CSSPropertyBackgroundColor:
+        return AnimatedPropertyInvalid; // Chromium compositor cannot accelerate background color yet.
+    case CSSPropertyWebkitFilter:
+        return AnimatedPropertyInvalid; // Chromium compositor cannot accelerate filter yet.
+    default:
+        // It's fine if we see other css properties here; they are just not accelerated.
+        break;
+    }
+    return AnimatedPropertyInvalid;
+}
+
+} // namespace
+
+WebAnimations::WebAnimations()
+{
+}
+
+WebAnimations::~WebAnimations()
+{
+}
+
+// Copy constructor is needed to use this struct as a return value. It actually moves the ownership, not copy.
+WebAnimations::WebAnimations(const WebAnimations& other)
+{
+    ASSERT(isEmpty());
+    m_transformAnimation.swap(const_cast<OwnPtr<WebAnimation>& >(other.m_transformAnimation));
+    m_opacityAnimation.swap(const_cast<OwnPtr<WebAnimation>& >(other.m_opacityAnimation));
+    m_filterAnimation.swap(const_cast<OwnPtr<WebAnimation>& >(other.m_filterAnimation));
+    ASSERT(other.isEmpty());
+}
+
+bool WebAnimations::isEmpty() const
+{
+    return !m_transformAnimation && !m_opacityAnimation && !m_filterAnimation;
+}
+
+WebAnimationProvider::WebAnimationProvider()
+{
+}
+
+WebAnimationProvider::~WebAnimationProvider()
+{
+}
+
+int WebAnimationProvider::getWebAnimationId(const String& animationName) const
+{
+    if (!m_animationIdMap.contains(animationName))
+        return 0;
+    return m_animationIdMap.get(animationName);
+}
+
+int WebAnimationProvider::getWebAnimationId(CSSPropertyID property) const
+{
+    AnimatedPropertyID animatedProperty = cssToGraphicsLayerProperty(property);
+    if (animatedProperty == AnimatedPropertyInvalid)
+        return 0;
+    return getWebAnimationId(animationNameForTransition(animatedProperty));
+}
+
+WebAnimations WebAnimationProvider::startAnimation(double timeOffset, const CSSAnimationData* anim, const KeyframeList& keyframes, bool hasTransform, const IntSize& boxSize)
+{
+    ASSERT(hasTransform || boxSize.isEmpty());
+    bool hasOpacity = keyframes.containsProperty(CSSPropertyOpacity);
+    bool hasFilter = keyframes.containsProperty(CSSPropertyWebkitFilter);
+
+    if (!hasOpacity && !hasTransform && !hasFilter)
+        return WebAnimations();
+
+    KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
+    KeyframeValueList opacityVector(AnimatedPropertyOpacity);
+    KeyframeValueList filterVector(AnimatedPropertyWebkitFilter);
+
+    size_t numKeyframes = keyframes.size();
+    for (size_t i = 0; i < numKeyframes; ++i) {
+        const KeyframeValue& currentKeyframe = keyframes[i];
+        const RenderStyle* keyframeStyle = currentKeyframe.style();
+        double key = currentKeyframe.key();
+
+        if (!keyframeStyle)
+            continue;
+
+        // Get timing function.
+        RefPtr<TimingFunction> tf = KeyframeValue::timingFunction(keyframeStyle, keyframes.animationName());
+
+        bool isFirstOrLastKeyframe = !key || key == 1;
+        if ((hasTransform && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitTransform))
+            transformVector.insert(adoptPtr(new TransformAnimationValue(key, &(keyframeStyle->transform()), tf)));
+
+        if ((hasOpacity && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyOpacity))
+            opacityVector.insert(adoptPtr(new FloatAnimationValue(key, keyframeStyle->opacity(), tf)));
+
+        if ((hasFilter && isFirstOrLastKeyframe) || currentKeyframe.containsProperty(CSSPropertyWebkitFilter))
+            filterVector.insert(adoptPtr(new FilterAnimationValue(key, &(keyframeStyle->filter()), tf)));
+    }
+    WebAnimations resultAnimations;
+    if (hasTransform)
+        resultAnimations.m_transformAnimation = createWebAnimationAndStoreId(transformVector, boxSize, anim, keyframes.animationName(), timeOffset);
+    if (hasOpacity)
+        resultAnimations.m_opacityAnimation = createWebAnimationAndStoreId(opacityVector, IntSize(), anim, keyframes.animationName(), timeOffset);
+    if (hasFilter)
+        resultAnimations.m_filterAnimation = createWebAnimationAndStoreId(filterVector, IntSize(), anim, keyframes.animationName(), timeOffset);
+
+    return resultAnimations;
+}
+
+WebAnimations WebAnimationProvider::startTransition(double timeOffset, CSSPropertyID property, const RenderStyle* fromStyle, const RenderStyle* toStyle, bool hasTransform, bool hasFilter, const IntSize& boxSize, float fromOpacity, float toOpacity)
+{
+    ASSERT(property != CSSPropertyInvalid);
+    ASSERT(property == CSSPropertyOpacity || (!fromOpacity && !toOpacity));
+
+    WebAnimations resultAnimations;
+    if (property == CSSPropertyOpacity) {
+        const CSSAnimationData* opacityAnim = toStyle->transitionForProperty(CSSPropertyOpacity);
+        if (opacityAnim && !opacityAnim->isEmptyOrZeroDuration()) {
+            KeyframeValueList opacityVector(AnimatedPropertyOpacity);
+            opacityVector.insert(adoptPtr(new FloatAnimationValue(0, fromOpacity)));
+            opacityVector.insert(adoptPtr(new FloatAnimationValue(1, toOpacity)));
+            resultAnimations.m_opacityAnimation = createWebAnimationAndStoreId(opacityVector, IntSize(), opacityAnim, animationNameForTransition(AnimatedPropertyOpacity), timeOffset);
+        }
+    }
+    if (property == CSSPropertyWebkitTransform && hasTransform) {
+        const CSSAnimationData* transformAnim = toStyle->transitionForProperty(CSSPropertyWebkitTransform);
+        if (transformAnim && !transformAnim->isEmptyOrZeroDuration()) {
+            KeyframeValueList transformVector(AnimatedPropertyWebkitTransform);
+            transformVector.insert(adoptPtr(new TransformAnimationValue(0, &fromStyle->transform())));
+            transformVector.insert(adoptPtr(new TransformAnimationValue(1, &toStyle->transform())));
+            resultAnimations.m_transformAnimation = createWebAnimationAndStoreId(transformVector, boxSize, transformAnim, animationNameForTransition(AnimatedPropertyWebkitTransform), timeOffset);
+        }
+    }
+    if (property == CSSPropertyWebkitFilter && hasFilter) {
+        const CSSAnimationData* filterAnim = toStyle->transitionForProperty(CSSPropertyWebkitFilter);
+        if (filterAnim && !filterAnim->isEmptyOrZeroDuration()) {
+            KeyframeValueList filterVector(AnimatedPropertyWebkitFilter);
+            filterVector.insert(adoptPtr(new FilterAnimationValue(0, &fromStyle->filter())));
+            filterVector.insert(adoptPtr(new FilterAnimationValue(1, &toStyle->filter())));
+            resultAnimations.m_filterAnimation = createWebAnimationAndStoreId(filterVector, IntSize(), filterAnim, animationNameForTransition(AnimatedPropertyWebkitFilter), timeOffset);
+        }
+    }
+
+    return resultAnimations;
+}
+
+PassOwnPtr<WebAnimation> WebAnimationProvider::createWebAnimationAndStoreId(const KeyframeValueList& values, const IntSize& boxSize, const CSSAnimationData* animation, const String& animationName, double timeOffset)
+{
+    int animationId = getWebAnimationId(animationName);
+    OwnPtr<WebAnimation> webAnimation(createWebAnimation(values, animation, animationId, timeOffset, boxSize));
+    if (!webAnimation)
+        return PassOwnPtr<WebAnimation>();
+
+    if (!animationId)
+        m_animationIdMap.set(animationName, webAnimation->id());
+    return webAnimation.release();
+}
+
+} // namespace WebCore
diff --git a/Source/core/rendering/animation/WebAnimationProvider.h b/Source/core/rendering/animation/WebAnimationProvider.h
new file mode 100644
index 0000000..c13f38a
--- /dev/null
+++ b/Source/core/rendering/animation/WebAnimationProvider.h
@@ -0,0 +1,76 @@
+/*
+ * 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
+ * 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. ``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
+ * 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.
+ */
+
+#ifndef WebAnimationProvider_h
+#define WebAnimationProvider_h
+
+#include "CSSPropertyNames.h"
+#include "core/platform/animation/KeyframeValueList.h"
+#include "wtf/HashMap.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/text/WTFString.h"
+
+namespace WebKit {
+class WebAnimation;
+}
+
+namespace WebCore {
+class CSSAnimationData;
+class IntSize;
+class KeyframeList;
+class RenderStyle;
+
+struct WebAnimations {
+    WebAnimations();
+    ~WebAnimations();
+    WebAnimations(const WebAnimations&);
+    bool isEmpty() const;
+    OwnPtr<WebKit::WebAnimation> m_transformAnimation;
+    OwnPtr<WebKit::WebAnimation> m_opacityAnimation;
+    OwnPtr<WebKit::WebAnimation> m_filterAnimation;
+};
+
+class WebAnimationProvider {
+    WTF_MAKE_NONCOPYABLE(WebAnimationProvider); WTF_MAKE_FAST_ALLOCATED;
+public:
+    WebAnimationProvider();
+    ~WebAnimationProvider();
+
+    int getWebAnimationId(const String& animationName) const;
+    int getWebAnimationId(CSSPropertyID) const;
+    WebAnimations startAnimation(double timeOffset, const CSSAnimationData*, const KeyframeList&, bool hasTransform, const IntSize& boxSize);
+    WebAnimations startTransition(double timeOffset, CSSPropertyID, const RenderStyle* fromStyle, const RenderStyle* toStyle, bool hasTransform, bool hasFilter, const IntSize& boxSize, float fromOpacity, float toOpacity);
+
+private:
+    PassOwnPtr<WebKit::WebAnimation> createWebAnimationAndStoreId(const KeyframeValueList&, const IntSize& boxSize, const CSSAnimationData*, const String& animationName, double timeOffset);
+
+    typedef HashMap<String, int> AnimationIdMap;
+    AnimationIdMap m_animationIdMap;
+};
+
+} // namespace WebCore
+
+#endif // WebAnimationProvider_h
diff --git a/Source/core/rendering/shapes/ShapeInfo.h b/Source/core/rendering/shapes/ShapeInfo.h
index 7ad3fea..3468ccc 100644
--- a/Source/core/rendering/shapes/ShapeInfo.h
+++ b/Source/core/rendering/shapes/ShapeInfo.h
@@ -96,7 +96,7 @@
 
     LayoutUnit shapeContainingBlockHeight() const { return (m_renderer->style()->boxSizing() == CONTENT_BOX) ? (m_shapeLogicalSize.height() + m_renderer->borderAndPaddingLogicalHeight()) : m_shapeLogicalSize.height(); }
 
-    bool lineOverlapsShapeBounds() const { return logicalLineTop() < shapeLogicalBottom() && shapeLogicalTop() <= logicalLineBottom(); }
+    virtual bool lineOverlapsShapeBounds() const = 0;
 
     void dirtyShapeSize() { m_shape.clear(); }
     bool shapeSizeDirty() { return !m_shape.get(); }
diff --git a/Source/core/rendering/shapes/ShapeInsideInfo.h b/Source/core/rendering/shapes/ShapeInsideInfo.h
index 02d8907..a18af4c 100644
--- a/Source/core/rendering/shapes/ShapeInsideInfo.h
+++ b/Source/core/rendering/shapes/ShapeInsideInfo.h
@@ -66,6 +66,16 @@
 
     static bool isEnabledFor(const RenderBlock* renderer);
 
+    bool computeSegmentsForLine(LayoutSize lineOffset, LayoutUnit lineHeight)
+    {
+        bool result = computeSegmentsForLine(lineOffset.height(), lineHeight);
+        for (size_t i = 0; i < m_segments.size(); i++) {
+            m_segments[i].logicalLeft -= lineOffset.width();
+            m_segments[i].logicalRight -= lineOffset.width();
+        }
+        return result;
+    }
+
     virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) OVERRIDE
     {
         m_segmentRanges.clear();
@@ -95,6 +105,12 @@
     void setNeedsLayout(bool value) { m_needsLayout = value; }
     bool needsLayout() { return m_needsLayout; }
 
+    virtual bool lineOverlapsShapeBounds() const OVERRIDE
+    {
+        // The <= test is to handle the case of a zero height line or a zero height shape.
+        return logicalLineTop() < shapeLogicalBottom() && shapeLogicalTop() <= logicalLineBottom();
+    }
+
 protected:
     virtual LayoutRect computedShapeLogicalBoundingBox() const OVERRIDE { return computedShape()->shapePaddingLogicalBoundingBox(); }
     virtual ShapeValue* shapeValue() const OVERRIDE;
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
index e2cc9de..2cff8f8 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.cpp
@@ -30,6 +30,8 @@
 #include "config.h"
 #include "core/rendering/shapes/ShapeOutsideInfo.h"
 
+#include "core/rendering/FloatingObjects.h"
+#include "core/rendering/RenderBlock.h"
 #include "core/rendering/RenderBox.h"
 
 namespace WebCore {
@@ -51,9 +53,10 @@
     return false;
 }
 
-bool ShapeOutsideInfo::computeSegmentsForContainingBlockLine(LayoutUnit lineTop, LayoutUnit floatTop, LayoutUnit lineHeight)
+bool ShapeOutsideInfo::computeSegmentsForContainingBlockLine(const RenderBlock* containingBlock, const FloatingObject* floatingObject, LayoutUnit lineTop, LayoutUnit lineHeight)
 {
-    LayoutUnit lineTopInShapeCoordinates = lineTop - floatTop + logicalTopOffset();
+    LayoutUnit shapeTop = floatingObject->logicalTop(containingBlock->isHorizontalWritingMode()) + std::max(LayoutUnit(), containingBlock->marginBeforeForChild(m_renderer));
+    LayoutUnit lineTopInShapeCoordinates = lineTop - shapeTop + logicalTopOffset();
     return computeSegmentsForLine(lineTopInShapeCoordinates, lineHeight);
 }
 
diff --git a/Source/core/rendering/shapes/ShapeOutsideInfo.h b/Source/core/rendering/shapes/ShapeOutsideInfo.h
index 0d1af35..d5f50fc 100644
--- a/Source/core/rendering/shapes/ShapeOutsideInfo.h
+++ b/Source/core/rendering/shapes/ShapeOutsideInfo.h
@@ -35,19 +35,27 @@
 
 namespace WebCore {
 
+class RenderBlock;
 class RenderBox;
+class FloatingObject;
 
 class ShapeOutsideInfo FINAL : public ShapeInfo<RenderBox>, public MappedInfo<RenderBox, ShapeOutsideInfo> {
 public:
     LayoutUnit leftSegmentMarginBoxDelta() const { return m_leftSegmentMarginBoxDelta; }
     LayoutUnit rightSegmentMarginBoxDelta() const { return m_rightSegmentMarginBoxDelta; }
 
-    bool computeSegmentsForContainingBlockLine(LayoutUnit lineTop, LayoutUnit floatTop, LayoutUnit lineHeight);
+    bool computeSegmentsForContainingBlockLine(const RenderBlock*, const FloatingObject*, LayoutUnit lineTop, LayoutUnit lineHeight);
     virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) OVERRIDE;
 
     static PassOwnPtr<ShapeOutsideInfo> createInfo(const RenderBox* renderer) { return adoptPtr(new ShapeOutsideInfo(renderer)); }
     static bool isEnabledFor(const RenderBox*);
 
+    virtual bool lineOverlapsShapeBounds() const OVERRIDE
+    {
+        return (logicalLineTop() < shapeLogicalBottom() && shapeLogicalTop() < logicalLineBottom())
+            || logicalLineTop() == shapeLogicalTop(); // case of zero height line or zero height shape
+    }
+
 protected:
     virtual LayoutRect computedShapeLogicalBoundingBox() const OVERRIDE { return computedShape()->shapeMarginLogicalBoundingBox(); }
     virtual ShapeValue* shapeValue() const OVERRIDE;
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp
index 659d99e..ece4c74 100644
--- a/Source/core/rendering/style/RenderStyle.cpp
+++ b/Source/core/rendering/style/RenderStyle.cpp
@@ -663,6 +663,7 @@
         || rareNonInheritedData->userDrag != other->rareNonInheritedData->userDrag
         || rareNonInheritedData->m_borderFit != other->rareNonInheritedData->m_borderFit
         || rareNonInheritedData->m_objectFit != other->rareNonInheritedData->m_objectFit
+        || rareNonInheritedData->m_objectPosition != other->rareNonInheritedData->m_objectPosition
         || rareInheritedData->m_imageRendering != other->rareInheritedData->m_imageRendering)
         return StyleDifferenceRepaint;
 
@@ -837,6 +838,19 @@
     return false;
 }
 
+EIsolation RenderStyle::isolation() const
+{
+    if (RuntimeEnabledFeatures::cssCompositingEnabled())
+        return static_cast<EIsolation>(rareNonInheritedData->m_isolation);
+    return IsolationAuto;
+}
+
+void RenderStyle::setIsolation(EIsolation v)
+{
+    if (RuntimeEnabledFeatures::cssCompositingEnabled())
+        rareNonInheritedData.access()->m_isolation = v;
+}
+
 inline bool requireTransformOrigin(const Vector<RefPtr<TransformOperation> >& transformOperations, RenderStyle::ApplyTransformOrigin applyOrigin)
 {
     // transform-origin brackets the transform with translate operations.
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index 290cf26..ce0e752 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -829,6 +829,7 @@
     TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
 
     ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
+    LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPosition; }
 
     // Return true if any transform related property (currently transform, transformStyle3D or perspective)
     // indicates that we are transforming
@@ -907,6 +908,9 @@
     void setBlendMode(BlendMode v);
     bool hasBlendMode() const;
 
+    EIsolation isolation() const;
+    void setIsolation(EIsolation v);
+
     bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); }
 
     TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); }
@@ -1264,6 +1268,7 @@
     bool setTextOrientation(TextOrientation);
 
     void setObjectFit(ObjectFit f) { SET_VAR(rareNonInheritedData, m_objectFit, f); }
+    void setObjectPosition(LengthPoint position) { SET_VAR(rareNonInheritedData, m_objectPosition, position); }
 
     void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
 
@@ -1474,6 +1479,7 @@
     static TextCombine initialTextCombine() { return TextCombineNone; }
     static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
     static ObjectFit initialObjectFit() { return ObjectFitFill; }
+    static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
     static EDisplay initialDisplay() { return INLINE; }
     static EEmptyCell initialEmptyCells() { return SHOW; }
     static EFloat initialFloating() { return NoFloat; }
@@ -1642,6 +1648,7 @@
     static Color initialTapHighlightColor();
     static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
     static BlendMode initialBlendMode() { return BlendModeNormal; }
+    static EIsolation initialIsolation() { return IsolationAuto; }
 private:
     void setVisitedLinkColor(const Color&);
     void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v); }
diff --git a/Source/core/rendering/style/RenderStyleConstants.h b/Source/core/rendering/style/RenderStyleConstants.h
index e96f5d8..59c4ab8 100644
--- a/Source/core/rendering/style/RenderStyleConstants.h
+++ b/Source/core/rendering/style/RenderStyleConstants.h
@@ -511,6 +511,8 @@
 
 enum TouchAction { TouchActionAuto, TouchActionNone };
 
+enum EIsolation { IsolationAuto, IsolationIsolate };
+
 // Reasonable maximum to prevent insane font sizes from causing crashes on some platforms (such as Windows).
 static const float maximumAllowedFontSize = 1000000.0f;
 
diff --git a/Source/core/rendering/style/StylePendingImage.h b/Source/core/rendering/style/StylePendingImage.h
index 3633d15..dd5acc7 100644
--- a/Source/core/rendering/style/StylePendingImage.h
+++ b/Source/core/rendering/style/StylePendingImage.h
@@ -49,7 +49,7 @@
     CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? toCSSImageValue(m_value) : 0; }
     CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
     CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
-    CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
+    CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? toCSSImageSetValue(m_value) : 0; }
 
     virtual LayoutSize imageSize(const RenderObject*, float /*multiplier*/) const OVERRIDE { return LayoutSize(); }
     virtual bool imageHasRelativeWidth() const { return false; }
diff --git a/Source/core/rendering/style/StyleRareNonInheritedData.cpp b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
index bb79aab..5428546 100644
--- a/Source/core/rendering/style/StyleRareNonInheritedData.cpp
+++ b/Source/core/rendering/style/StyleRareNonInheritedData.cpp
@@ -48,6 +48,7 @@
     , m_clipPath(RenderStyle::initialClipPath())
     , m_visitedLinkBackgroundColor(RenderStyle::initialBackgroundColor())
     , m_order(RenderStyle::initialOrder())
+    , m_objectPosition(RenderStyle::initialObjectPosition())
     , m_flowThread(RenderStyle::initialFlowThread())
     , m_regionThread(RenderStyle::initialRegionThread())
     , m_regionFragment(RenderStyle::initialRegionFragment())
@@ -76,6 +77,7 @@
     , m_effectiveBlendMode(RenderStyle::initialBlendMode())
     , m_touchAction(RenderStyle::initialTouchAction())
     , m_objectFit(RenderStyle::initialObjectFit())
+    , m_isolation(RenderStyle::initialIsolation())
 {
     m_maskBoxImage.setMaskDefaults();
 }
@@ -121,6 +123,7 @@
     , m_visitedLinkBorderTopColor(o.m_visitedLinkBorderTopColor)
     , m_visitedLinkBorderBottomColor(o.m_visitedLinkBorderBottomColor)
     , m_order(o.m_order)
+    , m_objectPosition(o.m_objectPosition)
     , m_flowThread(o.m_flowThread)
     , m_regionThread(o.m_regionThread)
     , m_regionFragment(o.m_regionFragment)
@@ -149,6 +152,7 @@
     , m_effectiveBlendMode(o.m_effectiveBlendMode)
     , m_touchAction(o.m_touchAction)
     , m_objectFit(o.m_objectFit)
+    , m_isolation(o.m_isolation)
 {
 }
 
@@ -197,6 +201,7 @@
         && m_visitedLinkBorderTopColor == o.m_visitedLinkBorderTopColor
         && m_visitedLinkBorderBottomColor == o.m_visitedLinkBorderBottomColor
         && m_order == o.m_order
+        && m_objectPosition == o.m_objectPosition
         && m_flowThread == o.m_flowThread
         && m_regionThread == o.m_regionThread
         && m_regionFragment == o.m_regionFragment
@@ -224,7 +229,8 @@
         && m_effectiveBlendMode == o.m_effectiveBlendMode
         && m_hasAspectRatio == o.m_hasAspectRatio
         && m_touchAction == o.m_touchAction
-        && m_objectFit == o.m_objectFit;
+        && m_objectFit == o.m_objectFit
+        && m_isolation == o.m_isolation;
 }
 
 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const
diff --git a/Source/core/rendering/style/StyleRareNonInheritedData.h b/Source/core/rendering/style/StyleRareNonInheritedData.h
index 07c7bd3..eadba19 100644
--- a/Source/core/rendering/style/StyleRareNonInheritedData.h
+++ b/Source/core/rendering/style/StyleRareNonInheritedData.h
@@ -25,6 +25,7 @@
 #ifndef StyleRareNonInheritedData_h
 #define StyleRareNonInheritedData_h
 
+#include "core/platform/LengthPoint.h"
 #include "core/rendering/ClipPathOperation.h"
 #include "core/rendering/style/BasicShapes.h"
 #include "core/rendering/style/CounterDirectives.h"
@@ -143,6 +144,8 @@
 
     int m_order;
 
+    LengthPoint m_objectPosition;
+
     AtomicString m_flowThread;
     AtomicString m_regionThread;
     unsigned m_regionFragment : 1; // RegionFragment
@@ -182,6 +185,8 @@
 
     unsigned m_objectFit : 3; // ObjectFit
 
+    unsigned m_isolation : 1; // Isolation
+
 private:
     StyleRareNonInheritedData();
     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
diff --git a/Source/core/rendering/svg/RenderSVGForeignObject.cpp b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
index 6f0507a..2506ee4 100644
--- a/Source/core/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/core/rendering/svg/RenderSVGForeignObject.cpp
@@ -123,7 +123,7 @@
     ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
 
     LayoutRepainter repainter(*this, SVGRenderSupport::checkForSVGRepaintDuringLayout(this));
-    SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
+    SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node());
 
     bool updateCachedBoundariesInParents = false;
     if (m_needsTransformUpdate) {
diff --git a/Source/core/rendering/svg/RenderSVGInlineText.cpp b/Source/core/rendering/svg/RenderSVGInlineText.cpp
index 521d6a5..cc612ca 100644
--- a/Source/core/rendering/svg/RenderSVGInlineText.cpp
+++ b/Source/core/rendering/svg/RenderSVGInlineText.cpp
@@ -110,7 +110,7 @@
     if (!box || !box->isInlineTextBox())
         return LayoutRect();
 
-    InlineTextBox* textBox = static_cast<InlineTextBox*>(box);
+    InlineTextBox* textBox = toInlineTextBox(box);
     if (static_cast<unsigned>(caretOffset) < textBox->start() || static_cast<unsigned>(caretOffset) > textBox->start() + textBox->len())
         return LayoutRect();
 
diff --git a/Source/core/rendering/svg/RenderSVGText.cpp b/Source/core/rendering/svg/RenderSVGText.cpp
index 24eb0a0..cc43f25 100644
--- a/Source/core/rendering/svg/RenderSVGText.cpp
+++ b/Source/core/rendering/svg/RenderSVGText.cpp
@@ -198,7 +198,7 @@
     SVGTextLayoutAttributes* attributes = 0;
     for (size_t i = 0; i < size; ++i) {
         attributes = newLayoutAttributes[i];
-        if (m_layoutAttributes.find(attributes) == notFound) {
+        if (m_layoutAttributes.find(attributes) == kNotFound) {
             // Every time this is invoked, there's only a single new entry in the newLayoutAttributes list, compared to the old in m_layoutAttributes.
             bool stopAfterNext = false;
             SVGTextLayoutAttributes* previous = 0;
@@ -218,7 +218,7 @@
 #ifndef NDEBUG
     // Verify that m_layoutAttributes only differs by a maximum of one entry.
     for (size_t i = 0; i < size; ++i)
-        ASSERT(m_layoutAttributes.find(newLayoutAttributes[i]) != notFound || newLayoutAttributes[i] == attributes);
+        ASSERT(m_layoutAttributes.find(newLayoutAttributes[i]) != kNotFound || newLayoutAttributes[i] == attributes);
 #endif
 
     m_layoutAttributes = newLayoutAttributes;
@@ -272,7 +272,7 @@
         affectedAttributes.append(next);
 
     size_t position = m_layoutAttributes.find(text->layoutAttributes());
-    ASSERT(position != notFound);
+    ASSERT(position != kNotFound);
     m_layoutAttributes.remove(position);
 }
 
diff --git a/Source/core/rendering/svg/SVGTextQuery.cpp b/Source/core/rendering/svg/SVGTextQuery.cpp
index c04fcf5..32674ab 100644
--- a/Source/core/rendering/svg/SVGTextQuery.cpp
+++ b/Source/core/rendering/svg/SVGTextQuery.cpp
@@ -94,7 +94,7 @@
             if (!child->renderer()->node())
                 continue;
 
-            collectTextBoxesInFlowBox(static_cast<InlineFlowBox*>(child));
+            collectTextBoxesInFlowBox(toInlineFlowBox(child));
             continue;
         }
 
diff --git a/Source/core/scripts/action_makenames.py b/Source/core/scripts/action_makenames.py
index 224abd6..7687a81 100644
--- a/Source/core/scripts/action_makenames.py
+++ b/Source/core/scripts/action_makenames.py
@@ -120,7 +120,7 @@
         if inputBasename in ('make_names.pl', 'make_event_factory.pl', 'make_dom_exceptions.pl', 'make_settings.pl'):
             assert makeNamesInput == None
             makeNamesInput = inputAbs
-        elif inputBasename.endswith('TagNames.in') or inputBasename.endswith('tags.in'):
+        elif inputBasename.endswith('TagNames.in'):
             assert tagInput == None
             tagInput = inputAbsPosix
         elif inputBasename.endswith('AttributeNames.in') or inputBasename.endswith('attrs.in'):
diff --git a/Source/core/scripts/make_event_factory.py b/Source/core/scripts/make_event_factory.py
index ace45ab..cdf2c35 100644
--- a/Source/core/scripts/make_event_factory.py
+++ b/Source/core/scripts/make_event_factory.py
@@ -39,7 +39,7 @@
 
 IMPLEMENTATION_TEMPLATE = """%(license)s
 #include "config.h"
-#include "%(class_name)sFactory.h"
+#include "core/events/%(class_name)sFactory.h"
 
 #include "%(class_name)sHeaders.h"
 #include "RuntimeEnabledFeatures.h"
diff --git a/Source/core/scripts/make_names.pl b/Source/core/scripts/make_names.pl
index 1748ca6..88ea51e 100755
--- a/Source/core/scripts/make_names.pl
+++ b/Source/core/scripts/make_names.pl
@@ -801,12 +801,12 @@
 
 print F <<END
 
-#include "ContextFeatures.h"
-#include "CustomElement.h"
-#include "CustomElementRegistrationContext.h"
-#include "Document.h"
 #include "RuntimeEnabledFeatures.h"
-#include "Settings.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/CustomElement.h"
+#include "core/dom/CustomElementRegistrationContext.h"
+#include "core/dom/Document.h"
+#include "core/page/Settings.h"
 
 namespace WebCore {
 
@@ -1063,10 +1063,10 @@
 
     print F <<END
 
-#include "ContextFeatures.h"
-#include "Document.h"
 #include "RuntimeEnabledFeatures.h"
-#include "Settings.h"
+#include "core/dom/ContextFeatures.h"
+#include "core/dom/Document.h"
+#include "core/page/Settings.h"
 
 #include "V8$parameters{namespace}Element.h"
 
diff --git a/Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index c6182dd..4be798f 100644
--- a/Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -492,7 +492,7 @@
 }
 {%- endmacro %}
 
-{{ apply_value_number("CSSPropertyWebkitMarqueeRepetition", "CSSValueInfinite") }}
+{{ apply_value_number("CSSPropertyInternalMarqueeRepetition", "CSSValueInfinite") }}
 
 {%- macro apply_value_shape(property_id) %}
 {{ declare_value_function(property_id) }}
diff --git a/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl b/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
index 257dae4..69086e1 100644
--- a/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
+++ b/Source/core/scripts/templates/StylePropertyShorthand.cpp.tmpl
@@ -63,23 +63,28 @@
     }
 }
 
-typedef HashMap<CSSPropertyID, Vector<StylePropertyShorthand> > longhandsMap;
 const Vector<StylePropertyShorthand> matchingShorthandsForLonghand(CSSPropertyID propertyID)
 {
-    DEFINE_STATIC_LOCAL(longhandsMap, map, ());
-    if (map.isEmpty()) {
+    switch (propertyID) {
 {%- for longhand_id, shorthands in longhands_dictionary.items() %}
-
-        Vector<StylePropertyShorthand, {{ shorthands|length }}> {{ longhand_id }}Shorthands;
+    case {{ longhand_id }}: {
+{%- if shorthands|length == 1 %}
+    {% for shorthand in shorthands -%}
+       return Vector<StylePropertyShorthand>(1, {{ shorthand.camel_case_name }}Shorthand());
+    {%- endfor %}
+{%- else %}
+        Vector<StylePropertyShorthand> vectorShorthands;
+        vectorShorthands.reserveInitialCapacity({{ shorthands|length }});
         {% for shorthand in shorthands -%}
-            {{ longhand_id }}Shorthands.uncheckedAppend({{ shorthand.camel_case_name }}Shorthand());
+        vectorShorthands.uncheckedAppend({{ shorthand.camel_case_name }}Shorthand());
         {% endfor -%}
-        // FIXME: the explicit Vector conversion copies into a temporary and is
-        // wasteful.
-        map.set({{ longhand_id }}, Vector<StylePropertyShorthand>({{ longhand_id }}Shorthands));
-{%- endfor %}
+        return vectorShorthands;
+{% endif %}
     }
-    return map.get(propertyID);
+{%- endfor %}
+    default:
+        return Vector<StylePropertyShorthand>();
+    }
 }
 
 } // namespace WebCore
diff --git a/Source/core/storage/StorageEvent.cpp b/Source/core/storage/StorageEvent.cpp
index 255b7fe..86b3434 100644
--- a/Source/core/storage/StorageEvent.cpp
+++ b/Source/core/storage/StorageEvent.cpp
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "core/storage/StorageEvent.h"
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/storage/Storage.h"
 
 namespace WebCore {
diff --git a/Source/core/storage/StorageEvent.h b/Source/core/storage/StorageEvent.h
index a4e8ffc..9580632 100644
--- a/Source/core/storage/StorageEvent.h
+++ b/Source/core/storage/StorageEvent.h
@@ -26,7 +26,7 @@
 #ifndef StorageEvent_h
 #define StorageEvent_h
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "wtf/text/WTFString.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGAElement.cpp b/Source/core/svg/SVGAElement.cpp
index 84fa34d..cc18a60 100644
--- a/Source/core/svg/SVGAElement.cpp
+++ b/Source/core/svg/SVGAElement.cpp
@@ -29,9 +29,9 @@
 #include "core/dom/Attr.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/KeyboardEvent.h"
-#include "core/dom/MouseEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/KeyboardEvent.h"
+#include "core/events/MouseEvent.h"
 #include "core/html/HTMLAnchorElement.h"
 #include "core/html/HTMLFormElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
diff --git a/Source/core/svg/SVGAltGlyphElement.cpp b/Source/core/svg/SVGAltGlyphElement.cpp
index 691b8f4..8ed0841 100644
--- a/Source/core/svg/SVGAltGlyphElement.cpp
+++ b/Source/core/svg/SVGAltGlyphElement.cpp
@@ -57,7 +57,7 @@
 
 void SVGAltGlyphElement::setGlyphRef(const AtomicString&, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 const AtomicString& SVGAltGlyphElement::glyphRef() const
@@ -67,7 +67,7 @@
 
 void SVGAltGlyphElement::setFormat(const AtomicString&, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 const AtomicString& SVGAltGlyphElement::format() const
diff --git a/Source/core/svg/SVGAngle.cpp b/Source/core/svg/SVGAngle.cpp
index e88d5da..90ee200 100644
--- a/Source/core/svg/SVGAngle.cpp
+++ b/Source/core/svg/SVGAngle.cpp
@@ -163,7 +163,7 @@
     bool success = value.is8Bit() ? parseValue<LChar>(value, valueInSpecifiedUnits, unitType)
                                   : parseValue<UChar>(value, valueInSpecifiedUnits, unitType);
     if (!success) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
@@ -174,7 +174,7 @@
 void SVGAngle::newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits, ExceptionState& es)
 {
     if (unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -187,7 +187,7 @@
 void SVGAngle::convertToSpecifiedUnits(unsigned short unitType, ExceptionState& es)
 {
     if (unitType == SVG_ANGLETYPE_UNKNOWN || m_unitType == SVG_ANGLETYPE_UNKNOWN || unitType > SVG_ANGLETYPE_GRAD) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
diff --git a/Source/core/svg/svgattrs.in b/Source/core/svg/SVGAttributeNames.in
similarity index 100%
rename from Source/core/svg/svgattrs.in
rename to Source/core/svg/SVGAttributeNames.in
diff --git a/Source/core/svg/SVGColor.cpp b/Source/core/svg/SVGColor.cpp
index 5253f89..5beba01 100644
--- a/Source/core/svg/SVGColor.cpp
+++ b/Source/core/svg/SVGColor.cpp
@@ -58,17 +58,17 @@
 {
     // The whole SVGColor interface is deprecated in SVG 1.1 (2nd edition).
     // The setters are the most problematic part so we remove the support for those first.
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 void SVGColor::setRGBColorICCColor(const String&, const String&, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 void SVGColor::setColor(unsigned short, const String&, const String&, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 String SVGColor::customCssText() const
diff --git a/Source/core/svg/SVGDocument.cpp b/Source/core/svg/SVGDocument.cpp
index c82b6e7..d9bfe18 100644
--- a/Source/core/svg/SVGDocument.cpp
+++ b/Source/core/svg/SVGDocument.cpp
@@ -23,7 +23,7 @@
 
 #include "SVGNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/page/FrameView.h"
 #include "core/rendering/RenderView.h"
 #include "core/svg/SVGElement.h"
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp
index 2649482..19a8b99 100644
--- a/Source/core/svg/SVGElement.cpp
+++ b/Source/core/svg/SVGElement.cpp
@@ -35,7 +35,7 @@
 #include "core/dom/DOMImplementation.h"
 #include "core/dom/Document.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/rendering/RenderObject.h"
 #include "core/rendering/svg/RenderSVGResourceContainer.h"
@@ -1025,9 +1025,7 @@
 
 bool SVGElement::hasFocusEventListeners() const
 {
-    // FIXME: EventTarget::hasEventListeners should be const.
-    SVGElement* mutableThis = const_cast<SVGElement*>(this);
-    return mutableThis->hasEventListeners(eventNames().focusinEvent) || mutableThis->hasEventListeners(eventNames().focusoutEvent);
+    return hasEventListeners(eventNames().focusinEvent) || hasEventListeners(eventNames().focusoutEvent);
 }
 
 bool SVGElement::isKeyboardFocusable() const
diff --git a/Source/core/svg/SVGElementInstance.cpp b/Source/core/svg/SVGElementInstance.cpp
index e93740c..5132de1 100644
--- a/Source/core/svg/SVGElementInstance.cpp
+++ b/Source/core/svg/SVGElementInstance.cpp
@@ -24,9 +24,9 @@
 #include "core/svg/SVGElementInstance.h"
 
 #include "core/dom/ContainerNodeAlgorithms.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/svg/SVGElement.h"
 #include "core/svg/SVGElementInstanceList.h"
 #include "core/svg/SVGUseElement.h"
diff --git a/Source/core/svg/SVGElementInstance.h b/Source/core/svg/SVGElementInstance.h
index ba364f3..721fd81 100644
--- a/Source/core/svg/SVGElementInstance.h
+++ b/Source/core/svg/SVGElementInstance.h
@@ -22,7 +22,7 @@
 #define SVGElementInstance_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/platform/TreeShared.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGFontFaceElement.cpp b/Source/core/svg/SVGFontFaceElement.cpp
index 430dfb9..55945a5 100644
--- a/Source/core/svg/SVGFontFaceElement.cpp
+++ b/Source/core/svg/SVGFontFaceElement.cpp
@@ -311,7 +311,7 @@
 
         unsigned srcLength = srcList ? srcList->length() : 0;
         for (unsigned i = 0; i < srcLength; i++) {
-            if (CSSFontFaceSrcValue* item = static_cast<CSSFontFaceSrcValue*>(srcList->itemWithoutBoundsCheck(i)))
+            if (CSSFontFaceSrcValue* item = toCSSFontFaceSrcValue(srcList->itemWithoutBoundsCheck(i)))
                 item->setSVGFontFaceElement(this);
         }
     }
diff --git a/Source/core/svg/SVGForeignObjectElement.h b/Source/core/svg/SVGForeignObjectElement.h
index 48dcd35..83018a8 100644
--- a/Source/core/svg/SVGForeignObjectElement.h
+++ b/Source/core/svg/SVGForeignObjectElement.h
@@ -20,6 +20,7 @@
 #ifndef SVGForeignObjectElement_h
 #define SVGForeignObjectElement_h
 
+#include "SVGNames.h"
 #include "core/svg/SVGAnimatedBoolean.h"
 #include "core/svg/SVGAnimatedLength.h"
 #include "core/svg/SVGExternalResourcesRequired.h"
@@ -57,6 +58,12 @@
     END_DECLARE_ANIMATED_PROPERTIES
 };
 
+inline SVGForeignObjectElement* toSVGForeignObjectElement(Node* node)
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(SVGNames::foreignObjectTag));
+    return static_cast<SVGForeignObjectElement*>(node);
+}
+
 } // namespace WebCore
 
 #endif
diff --git a/Source/core/svg/SVGImageLoader.cpp b/Source/core/svg/SVGImageLoader.cpp
index 6b503e2..fc405f6 100644
--- a/Source/core/svg/SVGImageLoader.cpp
+++ b/Source/core/svg/SVGImageLoader.cpp
@@ -22,8 +22,8 @@
 
 #include "core/svg/SVGImageLoader.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/fetch/ImageResource.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/svg/SVGImageElement.h"
diff --git a/Source/core/svg/SVGLength.cpp b/Source/core/svg/SVGLength.cpp
index 4f78c90..b4843b5 100644
--- a/Source/core/svg/SVGLength.cpp
+++ b/Source/core/svg/SVGLength.cpp
@@ -258,7 +258,7 @@
         parseValueInternal<UChar>(string, convertedNumber, type);
 
     if (!success) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
@@ -274,7 +274,7 @@
 void SVGLength::newValueSpecifiedUnits(unsigned short type, float value, ExceptionState& es)
 {
     if (type == LengthTypeUnknown || type > LengthTypePC) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -285,7 +285,7 @@
 void SVGLength::convertToSpecifiedUnits(unsigned short type, const SVGLengthContext& context, ExceptionState& es)
 {
     if (type == LengthTypeUnknown || type > LengthTypePC) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
diff --git a/Source/core/svg/SVGLengthContext.cpp b/Source/core/svg/SVGLengthContext.cpp
index 1c8ed6a..445bf84 100644
--- a/Source/core/svg/SVGLengthContext.cpp
+++ b/Source/core/svg/SVGLengthContext.cpp
@@ -98,7 +98,7 @@
 
     switch (fromUnit) {
     case LengthTypeUnknown:
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     case LengthTypeNumber:
         return value;
@@ -130,7 +130,7 @@
 {
     switch (toUnit) {
     case LengthTypeUnknown:
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     case LengthTypeNumber:
         return value;
@@ -163,7 +163,7 @@
     float width = 0;
     float height = 0;
     if (!determineViewport(width, height)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -185,7 +185,7 @@
     float width = 0;
     float height = 0;
     if (!determineViewport(width, height)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -223,13 +223,13 @@
 {
     RenderStyle* style = renderStyleForLengthResolving(m_context);
     if (!style) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
     float fontSize = style->specifiedFontSize();
     if (!fontSize) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -240,7 +240,7 @@
 {
     RenderStyle* style = renderStyleForLengthResolving(m_context);
     if (!style) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -251,7 +251,7 @@
 {
     RenderStyle* style = renderStyleForLengthResolving(m_context);
     if (!style) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -259,7 +259,7 @@
     // if this causes problems in real world cases maybe it would be best to remove this
     float xHeight = ceilf(style->fontMetrics().xHeight());
     if (!xHeight) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -270,7 +270,7 @@
 {
     RenderStyle* style = renderStyleForLengthResolving(m_context);
     if (!style) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
diff --git a/Source/core/svg/SVGLocatable.cpp b/Source/core/svg/SVGLocatable.cpp
index c3354c9..5262edd 100644
--- a/Source/core/svg/SVGLocatable.cpp
+++ b/Source/core/svg/SVGLocatable.cpp
@@ -104,7 +104,7 @@
     if (target && target->isSVGGraphicsElement()) {
         AffineTransform targetCTM = toSVGGraphicsElement(target)->getCTM(styleUpdateStrategy);
         if (!targetCTM.isInvertible()) {
-            es.throwDOMException(InvalidStateError);
+            es.throwUninformativeAndGenericDOMException(InvalidStateError);
             return ctm;
         }
         ctm = targetCTM.inverse() * ctm;
diff --git a/Source/core/svg/SVGMatrix.h b/Source/core/svg/SVGMatrix.h
index 7451d32..e892b2d 100644
--- a/Source/core/svg/SVGMatrix.h
+++ b/Source/core/svg/SVGMatrix.h
@@ -110,7 +110,7 @@
             // FIXME: This used to have a more specific error message:
             // "An attempt was made to invert a matrix that is not invertible."
             // When switching to SVG2 style exceptions we lost this information.
-            es.throwDOMException(InvalidStateError);
+            es.throwUninformativeAndGenericDOMException(InvalidStateError);
         }
 
         return transform;
@@ -119,7 +119,7 @@
     SVGMatrix rotateFromVector(double x, double y, ExceptionState& es)
     {
         if (!x || !y)
-            es.throwDOMException(InvalidAccessError);
+            es.throwUninformativeAndGenericDOMException(InvalidAccessError);
 
         AffineTransform copy = *this;
         copy.rotateFromVector(x, y);
diff --git a/Source/core/svg/SVGPaint.cpp b/Source/core/svg/SVGPaint.cpp
index ae2b955..538845d 100644
--- a/Source/core/svg/SVGPaint.cpp
+++ b/Source/core/svg/SVGPaint.cpp
@@ -65,7 +65,7 @@
 
 void SVGPaint::setPaint(unsigned short, const String&, const String&, const String&, ExceptionState& es)
 {
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 String SVGPaint::customCssText() const
diff --git a/Source/core/svg/SVGPreserveAspectRatio.cpp b/Source/core/svg/SVGPreserveAspectRatio.cpp
index 5e425e3..7870071 100644
--- a/Source/core/svg/SVGPreserveAspectRatio.cpp
+++ b/Source/core/svg/SVGPreserveAspectRatio.cpp
@@ -40,7 +40,7 @@
 void SVGPreserveAspectRatio::setAlign(unsigned short align, ExceptionState& es)
 {
     if (align == SVG_PRESERVEASPECTRATIO_UNKNOWN || align > SVG_PRESERVEASPECTRATIO_XMAXYMAX) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
@@ -50,7 +50,7 @@
 void SVGPreserveAspectRatio::setMeetOrSlice(unsigned short meetOrSlice, ExceptionState& es)
 {
     if (meetOrSlice == SVG_MEETORSLICE_UNKNOWN || meetOrSlice > SVG_MEETORSLICE_SLICE) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return;
     }
 
diff --git a/Source/core/svg/SVGSVGElement.cpp b/Source/core/svg/SVGSVGElement.cpp
index 4f4638c..93cdcd7 100644
--- a/Source/core/svg/SVGSVGElement.cpp
+++ b/Source/core/svg/SVGSVGElement.cpp
@@ -29,8 +29,8 @@
 #include "core/css/CSSHelper.h"
 #include "core/dom/Document.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/NodeTraversal.h"
 #include "core/dom/StaticNodeList.h"
 #include "core/editing/FrameSelection.h"
diff --git a/Source/core/svg/SVGScriptElement.cpp b/Source/core/svg/SVGScriptElement.cpp
index c7d8482..fc9f3cb 100644
--- a/Source/core/svg/SVGScriptElement.cpp
+++ b/Source/core/svg/SVGScriptElement.cpp
@@ -27,7 +27,7 @@
 #include "bindings/v8/ScriptEventListener.h"
 #include "core/dom/Attribute.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ScriptLoader.h"
 #include "core/svg/SVGElementInstance.h"
 #include "core/svg/properties/SVGAnimatedStaticPropertyTearOff.h"
diff --git a/Source/core/svg/svgtags.in b/Source/core/svg/SVGTagNames.in
similarity index 100%
rename from Source/core/svg/svgtags.in
rename to Source/core/svg/SVGTagNames.in
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp
index 4f7a3a8..35deceb 100644
--- a/Source/core/svg/SVGTextContentElement.cpp
+++ b/Source/core/svg/SVGTextContentElement.cpp
@@ -119,7 +119,7 @@
 
     unsigned numberOfChars = getNumberOfChars();
     if (charnum >= numberOfChars) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0.0f;
     }
 
@@ -134,7 +134,7 @@
     document().updateLayoutIgnorePendingStylesheets();
 
     if (charnum > getNumberOfChars()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return FloatPoint();
     }
 
@@ -146,7 +146,7 @@
     document().updateLayoutIgnorePendingStylesheets();
 
     if (charnum > getNumberOfChars()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return FloatPoint();
     }
 
@@ -158,7 +158,7 @@
     document().updateLayoutIgnorePendingStylesheets();
 
     if (charnum > getNumberOfChars()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return SVGRect();
     }
 
@@ -170,7 +170,7 @@
     document().updateLayoutIgnorePendingStylesheets();
 
     if (charnum > getNumberOfChars()) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return 0.0f;
     }
 
@@ -187,7 +187,7 @@
 {
     unsigned numberOfChars = getNumberOfChars();
     if (charnum >= numberOfChars) {
-        es.throwDOMException(IndexSizeError);
+        es.throwUninformativeAndGenericDOMException(IndexSizeError);
         return;
     }
 
diff --git a/Source/core/svg/SVGURIReference.cpp b/Source/core/svg/SVGURIReference.cpp
index 4152c15..f51aa1c 100644
--- a/Source/core/svg/SVGURIReference.cpp
+++ b/Source/core/svg/SVGURIReference.cpp
@@ -46,7 +46,7 @@
 String SVGURIReference::fragmentIdentifierFromIRIString(const String& url, const Document& document)
 {
     size_t start = url.find('#');
-    if (start == notFound)
+    if (start == kNotFound)
         return emptyString();
 
     KURL base = start ? KURL(document.baseURI(), url.substring(0, start)) : document.baseURI();
@@ -59,7 +59,7 @@
 static inline KURL urlFromIRIStringWithFragmentIdentifier(const String& url, const Document& document, String& fragmentIdentifier)
 {
     size_t startOfFragmentIdentifier = url.find('#');
-    if (startOfFragmentIdentifier == notFound)
+    if (startOfFragmentIdentifier == kNotFound)
         return KURL();
 
     // Exclude the '#' character when determining the fragmentIdentifier.
diff --git a/Source/core/svg/SVGUseElement.cpp b/Source/core/svg/SVGUseElement.cpp
index 68fbe2f..6449f66 100644
--- a/Source/core/svg/SVGUseElement.cpp
+++ b/Source/core/svg/SVGUseElement.cpp
@@ -31,7 +31,7 @@
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
 #include "core/dom/ElementTraversal.h"
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/shadow/ElementShadow.h"
 #include "core/dom/shadow/ShadowRoot.h"
 #include "core/fetch/DocumentResource.h"
diff --git a/Source/core/svg/SVGViewSpec.cpp b/Source/core/svg/SVGViewSpec.cpp
index 7a188cc..64b4885 100644
--- a/Source/core/svg/SVGViewSpec.cpp
+++ b/Source/core/svg/SVGViewSpec.cpp
@@ -106,7 +106,7 @@
 void SVGViewSpec::setZoomAndPan(unsigned short, ExceptionState& es)
 {
     // SVGViewSpec and all of its content is read-only.
-    es.throwDOMException(NoModificationAllowedError);
+    es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
 }
 
 void SVGViewSpec::setTransformString(const String& transform)
diff --git a/Source/core/svg/SVGZoomEvent.cpp b/Source/core/svg/SVGZoomEvent.cpp
index f5403d6..055b86c 100644
--- a/Source/core/svg/SVGZoomEvent.cpp
+++ b/Source/core/svg/SVGZoomEvent.cpp
@@ -22,7 +22,7 @@
 #include "config.h"
 
 
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/svg/SVGZoomEvent.h"
 
 namespace WebCore {
diff --git a/Source/core/svg/SVGZoomEvent.h b/Source/core/svg/SVGZoomEvent.h
index 9aecc4d..59d31ae 100644
--- a/Source/core/svg/SVGZoomEvent.h
+++ b/Source/core/svg/SVGZoomEvent.h
@@ -22,7 +22,7 @@
 #ifndef SVGZoomEvent_h
 #define SVGZoomEvent_h
 
-#include "core/dom/UIEvent.h"
+#include "core/events/UIEvent.h"
 #include "core/svg/SVGPoint.h"
 #include "core/svg/SVGRect.h"
 
diff --git a/Source/core/svg/animation/SMILTimeContainer.cpp b/Source/core/svg/animation/SMILTimeContainer.cpp
index 174c99f..0849327 100644
--- a/Source/core/svg/animation/SMILTimeContainer.cpp
+++ b/Source/core/svg/animation/SMILTimeContainer.cpp
@@ -93,7 +93,7 @@
     AnimationsVector* scheduled = m_scheduledAnimations.get(key);
     ASSERT(scheduled);
     size_t idx = scheduled->find(animation);
-    ASSERT(idx != notFound);
+    ASSERT(idx != kNotFound);
     scheduled->remove(idx);
 }
 
diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp
index 2e852a6..f5a6b57 100644
--- a/Source/core/svg/animation/SVGSMILElement.cpp
+++ b/Source/core/svg/animation/SVGSMILElement.cpp
@@ -30,8 +30,8 @@
 #include "XLinkNames.h"
 #include "bindings/v8/ExceptionStatePlaceholder.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventSender.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventSender.h"
 #include "core/platform/FloatConversion.h"
 #include "core/svg/SVGDocumentExtensions.h"
 #include "core/svg/SVGSVGElement.h"
@@ -377,7 +377,7 @@
         if (!ok)
             return SMILTime::unresolved();
         result += parse.substring(6).toDouble(&ok);
-    } else if (doublePointOne == 2 && doublePointTwo == notFound && parse.length() >= 5) {
+    } else if (doublePointOne == 2 && doublePointTwo == kNotFound && parse.length() >= 5) {
         result += parse.substring(0, 2).toUIntStrict(&ok) * 60;
         if (!ok)
             return SMILTime::unresolved();
@@ -402,14 +402,14 @@
     double sign = 1.;
     bool ok;
     size_t pos = parseString.find('+');
-    if (pos == notFound) {
+    if (pos == kNotFound) {
         pos = parseString.find('-');
-        if (pos != notFound)
+        if (pos != kNotFound)
             sign = -1.;
     }
     String conditionString;
     SMILTime offset = 0;
-    if (pos == notFound)
+    if (pos == kNotFound)
         conditionString = parseString;
     else {
         conditionString = parseString.left(pos).stripWhiteSpace();
@@ -425,7 +425,7 @@
 
     String baseID;
     String nameString;
-    if (pos == notFound)
+    if (pos == kNotFound)
         nameString = conditionString;
     else {
         baseID = conditionString.left(pos);
diff --git a/Source/core/svg/properties/SVGListProperty.h b/Source/core/svg/properties/SVGListProperty.h
index 7760b8d..c326795 100644
--- a/Source/core/svg/properties/SVGListProperty.h
+++ b/Source/core/svg/properties/SVGListProperty.h
@@ -52,7 +52,7 @@
     bool canAlterList(ExceptionState& es) const
     {
         if (m_role == AnimValRole) {
-            es.throwDOMException(NoModificationAllowedError);
+            es.throwUninformativeAndGenericDOMException(NoModificationAllowedError);
             return false;
         }
 
@@ -172,7 +172,7 @@
     bool canGetItem(unsigned index, ExceptionState& es)
     {
         if (index >= m_values->size()) {
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return false;
         }
 
@@ -274,7 +274,7 @@
             return false;
 
         if (index >= m_values->size()) {
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return false;
         }
 
@@ -295,7 +295,7 @@
 
         if (m_values->isEmpty()) {
             // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return ListItemType();
         }
 
@@ -329,7 +329,7 @@
         if (m_values->isEmpty()) {
             ASSERT(m_wrappers->isEmpty());
             // 'passNewItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace.
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return 0;
         }
 
@@ -353,7 +353,7 @@
             return false;
 
         if (index >= m_values->size()) {
-            es.throwDOMException(IndexSizeError);
+            es.throwUninformativeAndGenericDOMException(IndexSizeError);
             return false;
         }
 
diff --git a/Source/core/svg/properties/SVGTransformListPropertyTearOff.h b/Source/core/svg/properties/SVGTransformListPropertyTearOff.h
index b306456..d57f887 100644
--- a/Source/core/svg/properties/SVGTransformListPropertyTearOff.h
+++ b/Source/core/svg/properties/SVGTransformListPropertyTearOff.h
@@ -43,7 +43,7 @@
     {
         ASSERT(m_values);
         if (!matrix) {
-            es.throwDOMException(TypeMismatchError);
+            es.throwUninformativeAndGenericDOMException(TypeMismatchError);
             return 0;
         }
         return SVGPropertyTearOff<SVGTransform>::create(m_values->createSVGTransformFromMatrix(matrix->propertyReference()));
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index 33c45eb..4d62633 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -38,19 +38,19 @@
 
 #define InternalSettingsGuardForSettingsReturn(returnValue) \
     if (!settings()) { \
-        es.throwDOMException(InvalidAccessError); \
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError); \
         return returnValue; \
     }
 
 #define InternalSettingsGuardForSettings()  \
     if (!settings()) { \
-        es.throwDOMException(InvalidAccessError); \
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError); \
         return; \
     }
 
 #define InternalSettingsGuardForPage() \
     if (!page()) { \
-        es.throwDOMException(InvalidAccessError); \
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError); \
         return; \
     }
 
@@ -294,7 +294,7 @@
     else if (equalIgnoringCase(editingBehavior, "android"))
         settings()->setEditingBehaviorType(EditingAndroidBehavior);
     else
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
 }
 
 void InternalSettings::setLangAttributeAwareFormControlUIEnabled(bool enabled)
diff --git a/Source/core/testing/Internals.cpp b/Source/core/testing/Internals.cpp
index 52f3499..ac656d8 100644
--- a/Source/core/testing/Internals.cpp
+++ b/Source/core/testing/Internals.cpp
@@ -72,11 +72,11 @@
 #include "core/fetch/ResourceFetcher.h"
 #include "core/history/BackForwardController.h"
 #include "core/history/HistoryItem.h"
-#include "core/html/FormController.h"
 #include "core/html/HTMLInputElement.h"
 #include "core/html/HTMLMediaElement.h"
 #include "core/html/HTMLSelectElement.h"
 #include "core/html/HTMLTextAreaElement.h"
+#include "core/html/forms/FormController.h"
 #include "core/html/shadow/HTMLContentElement.h"
 #include "core/inspector/InspectorClient.h"
 #include "core/inspector/InspectorConsoleAgent.h"
@@ -295,7 +295,7 @@
 {
     Document* document = contextDocument();
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -305,7 +305,7 @@
 bool Internals::isValidContentSelect(Element* insertionPoint, ExceptionState& es)
 {
     if (!insertionPoint || !insertionPoint->isInsertionPoint()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return false;
     }
 
@@ -315,7 +315,7 @@
 Node* Internals::treeScopeRootNode(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -325,7 +325,7 @@
 Node* Internals::parentTreeScope(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     const TreeScope* parentTreeScope = node->treeScope().parentTreeScope();
@@ -335,7 +335,7 @@
 bool Internals::hasSelectorForIdInShadow(Element* host, const String& idValue, ExceptionState& es)
 {
     if (!host || !host->shadow()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -345,7 +345,7 @@
 bool Internals::hasSelectorForClassInShadow(Element* host, const String& className, ExceptionState& es)
 {
     if (!host || !host->shadow()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -355,7 +355,7 @@
 bool Internals::hasSelectorForAttributeInShadow(Element* host, const String& attributeName, ExceptionState& es)
 {
     if (!host || !host->shadow()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -365,7 +365,7 @@
 bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& pseudoClass, ExceptionState& es)
 {
     if (!host || !host->shadow()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -392,7 +392,7 @@
 unsigned short Internals::compareTreeScopePosition(const Node* node1, const Node* node2, ExceptionState& es) const
 {
     if (!node1 || !node2) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     const TreeScope* treeScope1 = node1->isDocumentNode() ? static_cast<const TreeScope*>(toDocument(node1)) :
@@ -400,7 +400,7 @@
     const TreeScope* treeScope2 = node2->isDocumentNode() ? static_cast<const TreeScope*>(toDocument(node2)) :
         node2->isShadowRoot() ? static_cast<const TreeScope*>(toShadowRoot(node2)) : 0;
     if (!treeScope1 || !treeScope2) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     return treeScope1->comparePosition(*treeScope2);
@@ -419,7 +419,7 @@
 void Internals::suspendAnimations(Document* document, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -435,7 +435,7 @@
 void Internals::resumeAnimations(Document* document, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -451,7 +451,7 @@
 void Internals::pauseAnimations(double pauseTime, ExceptionState& es)
 {
     if (pauseTime < 0) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -466,7 +466,7 @@
     if (root && root->isShadowRoot())
         return toShadowRoot(root)->containsShadowElements();
 
-    es.throwDOMException(InvalidAccessError);
+    es.throwUninformativeAndGenericDOMException(InvalidAccessError);
     return 0;
 }
 
@@ -475,14 +475,14 @@
     if (root && root->isShadowRoot())
         return toShadowRoot(root)->containsContentElements();
 
-    es.throwDOMException(InvalidAccessError);
+    es.throwUninformativeAndGenericDOMException(InvalidAccessError);
     return 0;
 }
 
 size_t Internals::countElementShadow(const Node* root, ExceptionState& es) const
 {
     if (!root || !root->isShadowRoot()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     return toShadowRoot(root)->childShadowRootCount();
@@ -491,7 +491,7 @@
 bool Internals::attached(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return false;
     }
 
@@ -501,7 +501,7 @@
 Node* Internals::nextSiblingByWalker(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     ComposedTreeWalker walker(node);
@@ -512,7 +512,7 @@
 Node* Internals::firstChildByWalker(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     ComposedTreeWalker walker(node);
@@ -523,7 +523,7 @@
 Node* Internals::lastChildByWalker(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     ComposedTreeWalker walker(node);
@@ -534,7 +534,7 @@
 Node* Internals::nextNodeByWalker(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     ComposedTreeWalker walker(node);
@@ -545,7 +545,7 @@
 Node* Internals::previousNodeByWalker(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
     ComposedTreeWalker walker(node);
@@ -556,13 +556,13 @@
 String Internals::elementRenderTreeAsText(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
     String representation = externalRepresentation(element);
     if (representation.isEmpty()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -574,14 +574,14 @@
     if (scope && (scope->isElementNode() || scope->isShadowRoot()))
         return scope->numberOfScopedHTMLStyleChildren();
 
-    es.throwDOMException(InvalidAccessError);
+    es.throwUninformativeAndGenericDOMException(InvalidAccessError);
     return 0;
 }
 
 PassRefPtr<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Node* node, ExceptionState& es) const
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -592,7 +592,7 @@
 ShadowRoot* Internals::ensureShadowRoot(Element* host, ExceptionState& es)
 {
     if (!host) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -612,7 +612,7 @@
 ShadowRoot* Internals::youngestShadowRoot(Element* host, ExceptionState& es)
 {
     if (!host) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -624,7 +624,7 @@
 ShadowRoot* Internals::oldestShadowRoot(Element* host, ExceptionState& es)
 {
     if (!host) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -636,7 +636,7 @@
 ShadowRoot* Internals::youngerShadowRoot(Node* shadow, ExceptionState& es)
 {
     if (!shadow || !shadow->isShadowRoot()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -646,7 +646,7 @@
 ShadowRoot* Internals::olderShadowRoot(Node* shadow, ExceptionState& es)
 {
     if (!shadow || !shadow->isShadowRoot()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -656,7 +656,7 @@
 String Internals::shadowRootType(const Node* root, ExceptionState& es) const
 {
     if (!root || !root->isShadowRoot()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -674,7 +674,7 @@
 Element* Internals::includerFor(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -686,7 +686,7 @@
 String Internals::shadowPseudoId(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -696,7 +696,7 @@
 void Internals::setShadowPseudoId(Element* element, const String& id, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -724,12 +724,12 @@
 {
     HistoryItem* mainItem = frame()->loader()->history()->previousItem();
     if (!mainItem) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return Vector<String>();
     }
     String uniqueName = frame()->tree()->uniqueName();
     if (mainItem->target() != uniqueName && !mainItem->childItemWithTarget(uniqueName)) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return Vector<String>();
     }
     return mainItem->target() == uniqueName ? mainItem->documentState() : mainItem->childItemWithTarget(uniqueName)->documentState();
@@ -739,7 +739,7 @@
 {
     HistoryItem* mainItem = frame()->loader()->history()->previousItem();
     if (!mainItem) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     String uniqueName = frame()->tree()->uniqueName();
@@ -748,7 +748,7 @@
     else if (HistoryItem* subItem = mainItem->childItemWithTarget(uniqueName))
         subItem->setDocumentState(state);
     else
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
 }
 
 void Internals::enableMockSpeechSynthesizer()
@@ -787,7 +787,7 @@
 {
     Document* document = contextDocument();
     if (!document || !document->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return ClientRect::create();
     }
 
@@ -798,7 +798,7 @@
 {
     Document* document = contextDocument();
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return ClientRect::create();
     }
 
@@ -808,7 +808,7 @@
 PassRefPtr<ClientRect> Internals::boundingBox(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return ClientRect::create();
     }
 
@@ -822,7 +822,7 @@
 PassRefPtr<ClientRectList> Internals::inspectorHighlightRects(Document* document, ExceptionState& es)
 {
     if (!document || !document->page()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return ClientRectList::create();
     }
 
@@ -834,13 +834,13 @@
 unsigned Internals::markerCountForNode(Node* node, const String& markerType, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     DocumentMarker::MarkerTypes markerTypes = 0;
     if (!markerTypesFrom(markerType, markerTypes)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -850,7 +850,7 @@
 unsigned Internals::activeMarkerCountForNode(Node* node, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -870,13 +870,13 @@
 DocumentMarker* Internals::markerAt(Node* node, const String& markerType, unsigned index, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     DocumentMarker::MarkerTypes markerTypes = 0;
     if (!markerTypesFrom(markerType, markerTypes)) {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
@@ -911,7 +911,7 @@
 void Internals::setMarkersActive(Node* node, unsigned startOffset, unsigned endOffset, bool active, ExceptionState& es)
 {
     if (!node) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -921,7 +921,7 @@
 void Internals::setScrollViewPosition(Document* document, long x, long y, ExceptionState& es)
 {
     if (!document || !document->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -939,7 +939,7 @@
 void Internals::setPagination(Document* document, const String& mode, int gap, int pageLength, ExceptionState& es)
 {
     if (!document || !document->page()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     Page* page = document->page();
@@ -956,7 +956,7 @@
     else if (mode == "BottomToTopPaginated")
         pagination.mode = Pagination::BottomToTopPaginated;
     else {
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return;
     }
 
@@ -968,7 +968,7 @@
 String Internals::viewportAsText(Document* document, float, int availableWidth, int availableHeight, ExceptionState& es)
 {
     if (!document || !document->page()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
     Page* page = document->page();
@@ -1005,7 +1005,7 @@
 bool Internals::wasLastChangeUserEdit(Element* textField, ExceptionState& es)
 {
     if (!textField) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return false;
     }
 
@@ -1016,33 +1016,33 @@
     if (textField->tagName() == "TEXTAREA")
         return toHTMLTextAreaElement(textField)->lastChangeWasUserEdit();
 
-    es.throwDOMException(InvalidNodeTypeError);
+    es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
     return false;
 }
 
 bool Internals::elementShouldAutoComplete(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return false;
     }
 
     if (element->hasTagName(inputTag))
         return toHTMLInputElement(element)->shouldAutocomplete();
 
-    es.throwDOMException(InvalidNodeTypeError);
+    es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
     return false;
 }
 
 String Internals::suggestedValue(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
     if (!element->hasTagName(inputTag)) {
-        es.throwDOMException(InvalidNodeTypeError);
+        es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
         return String();
     }
 
@@ -1052,12 +1052,12 @@
 void Internals::setSuggestedValue(Element* element, const String& value, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
     if (!element->hasTagName(inputTag)) {
-        es.throwDOMException(InvalidNodeTypeError);
+        es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
         return;
     }
 
@@ -1067,12 +1067,12 @@
 void Internals::setEditingValue(Element* element, const String& value, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
     if (!element->hasTagName(inputTag)) {
-        es.throwDOMException(InvalidNodeTypeError);
+        es.throwUninformativeAndGenericDOMException(InvalidNodeTypeError);
         return;
     }
 
@@ -1082,7 +1082,7 @@
 void Internals::setAutofilled(Element* element, bool enabled, ExceptionState& es)
 {
     if (!element->hasTagName(inputTag)) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     toHTMLInputElement(element)->setAutofilled(enabled);
@@ -1091,7 +1091,7 @@
 void Internals::scrollElementToRect(Element* element, long x, long y, long w, long h, ExceptionState& es)
 {
     if (!element || !element->document().view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     FrameView* frameView = element->document().view();
@@ -1101,7 +1101,7 @@
 void Internals::paintControlTints(Document* document, ExceptionState& es)
 {
     if (!document || !document->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -1112,7 +1112,7 @@
 PassRefPtr<Range> Internals::rangeFromLocationAndLength(Element* scope, int rangeLocation, int rangeLength, ExceptionState& es)
 {
     if (!scope) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1125,7 +1125,7 @@
 unsigned Internals::locationFromRange(Element* scope, const Range* range, ExceptionState& es)
 {
     if (!scope || !range) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1141,7 +1141,7 @@
 unsigned Internals::lengthFromRange(Element* scope, const Range* range, ExceptionState& es)
 {
     if (!scope || !range) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1157,7 +1157,7 @@
 String Internals::rangeAsText(const Range* range, ExceptionState& es)
 {
     if (!range) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1167,7 +1167,7 @@
 PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1189,7 +1189,7 @@
 Node* Internals::touchNodeAdjustedToBestClickableNode(long x, long y, long width, long height, Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1207,7 +1207,7 @@
 PassRefPtr<DOMPoint> Internals::touchPositionAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1229,7 +1229,7 @@
 Node* Internals::touchNodeAdjustedToBestContextMenuNode(long x, long y, long width, long height, Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1247,7 +1247,7 @@
 PassRefPtr<ClientRect> Internals::bestZoomableAreaForTouchPoint(long x, long y, long width, long height, Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1271,7 +1271,7 @@
     SpellCheckRequester* requester = spellCheckRequester(document);
 
     if (!requester) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return -1;
     }
 
@@ -1283,7 +1283,7 @@
     SpellCheckRequester* requester = spellCheckRequester(document);
 
     if (!requester) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return -1;
     }
 
@@ -1303,7 +1303,7 @@
 unsigned Internals::wheelEventHandlerCount(Document* document, ExceptionState& es)
 {
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1313,7 +1313,7 @@
 unsigned Internals::touchEventHandlerCount(Document* document, ExceptionState& es)
 {
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1428,7 +1428,7 @@
 PassRefPtr<LayerRectList> Internals::touchEventTargetLayerRects(Document* document, ExceptionState& es)
 {
     if (!document || !document->view() || !document->page() || document != contextDocument()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1453,7 +1453,7 @@
     unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent, ExceptionState& es) const
 {
     if (!document || !document->frame() || !document->frame()->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1626,7 +1626,7 @@
 {
     Page* page = contextDocument()->frame()->page();
     if (!page) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     page->inspectorController().setResourcesDataSizeLimitsFromInternals(maximumResourcesContentSize, maximumSingleResourceContentSize);
@@ -1658,7 +1658,7 @@
 bool Internals::isPageBoxVisible(Document* document, int pageNumber, ExceptionState& es)
 {
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return false;
     }
 
@@ -1678,7 +1678,7 @@
 static PassRefPtr<NodeList> paintOrderList(Element* element, ExceptionState& es, RenderLayer::PaintOrderListType type)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1686,13 +1686,13 @@
 
     RenderObject* renderer = element->renderer();
     if (!renderer || !renderer->isBox()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     RenderLayer* layer = toRenderBox(renderer)->layer();
     if (!layer) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1714,7 +1714,7 @@
 bool Internals::scrollsWithRespectTo(Element* element1, Element* element2, ExceptionState& es)
 {
     if (!element1 || !element2) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1723,14 +1723,14 @@
     RenderObject* renderer1 = element1->renderer();
     RenderObject* renderer2 = element2->renderer();
     if (!renderer1 || !renderer2 || !renderer1->isBox() || !renderer2->isBox()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     RenderLayer* layer1 = toRenderBox(renderer1)->layer();
     RenderLayer* layer2 = toRenderBox(renderer2)->layer();
     if (!layer1 || !layer2) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1740,7 +1740,7 @@
 bool Internals::isUnclippedDescendant(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1748,13 +1748,13 @@
 
     RenderObject* renderer = element->renderer();
     if (!renderer || !renderer->isBox()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     RenderLayer* layer = toRenderBox(renderer)->layer();
     if (!layer) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1764,7 +1764,7 @@
 String Internals::layerTreeAsText(Document* document, unsigned flags, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1774,7 +1774,7 @@
 String Internals::elementLayerTreeAsText(Element* element, unsigned flags, ExceptionState& es) const
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1782,7 +1782,7 @@
 
     RenderObject* renderer = element->renderer();
     if (!renderer || !renderer->isBox()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1800,19 +1800,19 @@
 static RenderLayer* getRenderLayerForElement(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     RenderObject* renderer = element->renderer();
     if (!renderer || !renderer->isBox()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
     RenderLayer* layer = toRenderBox(renderer)->layer();
     if (!layer) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1822,7 +1822,7 @@
 void Internals::setNeedsCompositedScrolling(Element* element, unsigned needsCompositedScrolling, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -1832,48 +1832,10 @@
         layer->setForceNeedsCompositedScrolling(static_cast<RenderLayer::ForceNeedsCompositedScrollingMode>(needsCompositedScrolling));
 }
 
-bool Internals::isScrollParent(Element* child, Element* parent, ExceptionState& es)
-{
-    RenderLayer* childLayer = getRenderLayerForElement(child, es);
-    RenderLayer* parentLayer = getRenderLayerForElement(parent, es);
-    return childLayer && parentLayer && childLayer->scrollParent() == parentLayer;
-}
-
-bool Internals::isClipParent(Element* child, Element* parent, ExceptionState& es)
-{
-    RenderLayer* childLayer = getRenderLayerForElement(child, es);
-    RenderLayer* parentLayer = getRenderLayerForElement(parent, es);
-    return childLayer && parentLayer && childLayer->clipParent() == parentLayer;
-}
-
-PassRefPtr<ClientRect> Internals::scrollClip(Element* element, ExceptionState& es)
-{
-    RenderLayer* layer = getRenderLayerForElement(element, es);
-    if (!layer || !layer->backing() || !layer->backing()->scrollingLayer())
-        return ClientRect::create();
-
-    return ClientRect::create(
-        FloatRect(
-            layer->backing()->scrollingLayer()->boundsOrigin(),
-            layer->backing()->scrollingLayer()->size()));
-}
-
-PassRefPtr<ClientRect> Internals::ancestorScrollClip(Element* element, ExceptionState& es)
-{
-    RenderLayer* layer = getRenderLayerForElement(element, es);
-    if (!layer || !layer->backing() || !layer->backing()->ancestorScrollClippingLayer())
-        return ClientRect::create();
-
-    return ClientRect::create(
-        FloatRect(
-            layer->backing()->ancestorScrollClippingLayer()->boundsOrigin(),
-            layer->backing()->ancestorScrollClippingLayer()->size()));
-}
-
 String Internals::repaintRectsAsText(Document* document, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1888,7 +1850,7 @@
 String Internals::mainThreadScrollingReasons(Document* document, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -1902,7 +1864,7 @@
 PassRefPtr<ClientRectList> Internals::nonFastScrollableRects(Document* document, ExceptionState& es) const
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -1916,7 +1878,7 @@
 void Internals::garbageCollectDocumentResources(Document* document, ExceptionState& es) const
 {
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -2012,7 +1974,7 @@
 String Internals::pageProperty(String propertyName, int pageNumber, ExceptionState& es) const
 {
     if (!frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -2022,7 +1984,7 @@
 String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft, ExceptionState& es) const
 {
     if (!frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -2033,7 +1995,7 @@
 {
     Document* document = contextDocument();
     if (!document || !document->page()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     Page* page = document->page();
@@ -2043,7 +2005,7 @@
 void Internals::setIsCursorVisible(Document* document, bool isVisible, ExceptionState& es)
 {
     if (!document || !document->page()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
     document->page()->setIsCursorVisible(isVisible);
@@ -2106,7 +2068,7 @@
 void Internals::startTrackingRepaints(Document* document, ExceptionState& es)
 {
     if (!document || !document->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -2117,7 +2079,7 @@
 void Internals::stopTrackingRepaints(Document* document, ExceptionState& es)
 {
     if (!document || !document->view()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return;
     }
 
@@ -2181,7 +2143,7 @@
 String Internals::getCurrentCursorInfo(Document* document, ExceptionState& es)
 {
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -2233,7 +2195,7 @@
 {
     Document* document = contextDocument();
     if (!document || !document->frame()) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return 0;
     }
 
@@ -2243,7 +2205,7 @@
 String Internals::markerTextForListItem(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
     return WebCore::markerTextForListItem(element);
@@ -2252,7 +2214,7 @@
 String Internals::getImageSourceURL(Element* element, ExceptionState& es)
 {
     if (!element) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
     return element->imageSourceURL();
@@ -2261,7 +2223,7 @@
 String Internals::baseURL(Document* document, ExceptionState& es)
 {
     if (!document) {
-        es.throwDOMException(InvalidAccessError);
+        es.throwUninformativeAndGenericDOMException(InvalidAccessError);
         return String();
     }
 
@@ -2288,7 +2250,7 @@
     RefPtr<GraphicsContext3D> sharedContext = SharedGraphicsContext3D::get();
     if (!sharedContext)
         return false;
-    sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
+    sharedContext->extensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CONTEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
     // To prevent tests that call loseSharedGraphicsContext3D from being
     // flaky, we call finish so that the context is guaranteed to be lost
     // synchronously (i.e. before returning).
diff --git a/Source/core/testing/Internals.h b/Source/core/testing/Internals.h
index d35185b..18350ec 100644
--- a/Source/core/testing/Internals.h
+++ b/Source/core/testing/Internals.h
@@ -225,12 +225,6 @@
 
     void setNeedsCompositedScrolling(Element*, unsigned value, ExceptionState&);
 
-    bool isScrollParent(Element* child, Element* parent, ExceptionState&);
-    bool isClipParent(Element* child, Element* parent, ExceptionState&);
-
-    PassRefPtr<ClientRect> scrollClip(Element*, ExceptionState&);
-    PassRefPtr<ClientRect> ancestorScrollClip(Element*, ExceptionState&);
-
     String repaintRectsAsText(Document*, ExceptionState&) const;
     String scrollingStateTreeAsText(Document*, ExceptionState&) const;
     String mainThreadScrollingReasons(Document*, ExceptionState&) const;
diff --git a/Source/core/testing/Internals.idl b/Source/core/testing/Internals.idl
index c663830..ed9b51d 100644
--- a/Source/core/testing/Internals.idl
+++ b/Source/core/testing/Internals.idl
@@ -172,6 +172,7 @@
     const unsigned short LAYER_TREE_INCLUDES_REPAINT_RECTS = 2;
     const unsigned short LAYER_TREE_INCLUDES_PAINTING_PHASES = 4;
     const unsigned short LAYER_TREE_INCLUDES_ROOT_LAYER = 8;
+    const unsigned short LAYER_TREE_INCLUDES_CLIP_AND_SCROLL_PARENTS = 16;
     [RaisesException] DOMString layerTreeAsText(Document document, optional unsigned short flags);
     [RaisesException] DOMString elementLayerTreeAsText(Element element, optional unsigned short flags);
 
@@ -187,12 +188,6 @@
     const unsigned short COMPOSITED_SCROLLING_ALWAYS_OFF = 2;
     [RaisesException] void setNeedsCompositedScrolling(Element element, unsigned short value);
 
-    [RaisesException] boolean isScrollParent(Element child, Element parent);
-    [RaisesException] boolean isClipParent(Element child, Element parent);
-
-    [RaisesException] ClientRect scrollClip(Element element);
-    [RaisesException] ClientRect ancestorScrollClip(Element element);
-
     [RaisesException] DOMString scrollingStateTreeAsText(Document document);
     [RaisesException] DOMString mainThreadScrollingReasons(Document document);
     [RaisesException] ClientRectList nonFastScrollableRects(Document document);
diff --git a/Source/core/tests/ArenaTestHelpers.h b/Source/core/tests/ArenaTestHelpers.h
index 0e60ca5..dd94743 100644
--- a/Source/core/tests/ArenaTestHelpers.h
+++ b/Source/core/tests/ArenaTestHelpers.h
@@ -54,7 +54,7 @@
     virtual void free(void* ptr)
     {
         size_t slot = m_allocatedRegions.find(ptr);
-        ASSERT_NE(slot, notFound);
+        ASSERT_NE(slot, kNotFound);
         m_allocatedRegions.remove(slot);
         PODArena::FastMallocAllocator::free(ptr);
     }
diff --git a/Source/core/webcore_derived.target.darwin-arm.mk b/Source/core/webcore_derived.target.darwin-arm.mk
index 788e6f4..5ae778d 100644
--- a/Source/core/webcore_derived.target.darwin-arm.mk
+++ b/Source/core/webcore_derived.target.darwin-arm.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -386,7 +385,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -400,7 +398,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -418,14 +416,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -453,13 +450,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -551,7 +544,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -565,7 +557,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -583,14 +575,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -618,13 +609,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_derived.target.darwin-mips.mk b/Source/core/webcore_derived.target.darwin-mips.mk
index a07f852..e7e881f 100644
--- a/Source/core/webcore_derived.target.darwin-mips.mk
+++ b/Source/core/webcore_derived.target.darwin-mips.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -386,7 +385,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -400,7 +398,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -418,14 +416,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -453,13 +450,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -551,7 +544,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -565,7 +557,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -583,14 +575,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -618,13 +609,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_derived.target.darwin-x86.mk b/Source/core/webcore_derived.target.darwin-x86.mk
index a458d90..abc1c41 100644
--- a/Source/core/webcore_derived.target.darwin-x86.mk
+++ b/Source/core/webcore_derived.target.darwin-x86.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -388,7 +387,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -402,7 +400,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -420,14 +418,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -455,13 +452,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -556,7 +549,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -570,7 +562,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -588,14 +580,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -623,13 +614,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_derived.target.linux-arm.mk b/Source/core/webcore_derived.target.linux-arm.mk
index 788e6f4..5ae778d 100644
--- a/Source/core/webcore_derived.target.linux-arm.mk
+++ b/Source/core/webcore_derived.target.linux-arm.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -386,7 +385,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -400,7 +398,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -418,14 +416,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -453,13 +450,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -551,7 +544,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -565,7 +557,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -583,14 +575,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -618,13 +609,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_derived.target.linux-mips.mk b/Source/core/webcore_derived.target.linux-mips.mk
index a07f852..e7e881f 100644
--- a/Source/core/webcore_derived.target.linux-mips.mk
+++ b/Source/core/webcore_derived.target.linux-mips.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -386,7 +385,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -400,7 +398,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -418,14 +416,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -453,13 +450,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -551,7 +544,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -565,7 +557,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -583,14 +575,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -618,13 +609,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_derived.target.linux-x86.mk b/Source/core/webcore_derived.target.linux-x86.mk
index a458d90..abc1c41 100644
--- a/Source/core/webcore_derived.target.linux-x86.mk
+++ b/Source/core/webcore_derived.target.linux-x86.mk
@@ -325,7 +325,6 @@
 	third_party/WebKit/Source/bindings/v8/custom/V8PerformanceEntryCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PopStateEventCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8PromiseCustom.cpp \
-	third_party/WebKit/Source/bindings/v8/custom/V8PromiseResolverCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionCustom.cpp \
 	third_party/WebKit/Source/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp \
@@ -388,7 +387,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -402,7 +400,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -420,14 +418,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -455,13 +452,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
@@ -556,7 +549,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -570,7 +562,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -588,14 +580,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -623,13 +614,9 @@
 	$(LOCAL_PATH)/third_party/WebKit \
 	$(LOCAL_PATH)/third_party/WebKit/Source \
 	$(LOCAL_PATH)/third_party/WebKit/Source/bindings/v8/custom \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/mediastream \
-	$(LOCAL_PATH)/third_party/WebKit/Source/modules/speech \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/dom \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/html/shadow \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/inspector \
-	$(LOCAL_PATH)/third_party/WebKit/Source/core/page \
 	$(LOCAL_PATH)/third_party/WebKit/Source/core/svg \
 	$(LOCAL_PATH)/third_party/khronos \
 	$(LOCAL_PATH)/gpu \
diff --git a/Source/core/webcore_dom.target.darwin-arm.mk b/Source/core/webcore_dom.target.darwin-arm.mk
index a08ce07..41e847d 100644
--- a/Source/core/webcore_dom.target.darwin-arm.mk
+++ b/Source/core/webcore_dom.target.darwin-arm.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -231,7 +230,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +243,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +261,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -387,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -401,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -419,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_dom.target.darwin-mips.mk b/Source/core/webcore_dom.target.darwin-mips.mk
index 7d2f2fb..50b92bd 100644
--- a/Source/core/webcore_dom.target.darwin-mips.mk
+++ b/Source/core/webcore_dom.target.darwin-mips.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -231,7 +230,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +243,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +261,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -387,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -401,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -419,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_dom.target.darwin-x86.mk b/Source/core/webcore_dom.target.darwin-x86.mk
index 5a5bbd4..b5b2123 100644
--- a/Source/core/webcore_dom.target.darwin-x86.mk
+++ b/Source/core/webcore_dom.target.darwin-x86.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -233,7 +232,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -247,7 +245,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -265,14 +263,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -392,7 +389,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -406,7 +402,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -424,14 +420,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_dom.target.linux-arm.mk b/Source/core/webcore_dom.target.linux-arm.mk
index a08ce07..41e847d 100644
--- a/Source/core/webcore_dom.target.linux-arm.mk
+++ b/Source/core/webcore_dom.target.linux-arm.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -231,7 +230,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +243,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +261,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -387,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -401,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -419,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_dom.target.linux-mips.mk b/Source/core/webcore_dom.target.linux-mips.mk
index 7d2f2fb..50b92bd 100644
--- a/Source/core/webcore_dom.target.linux-mips.mk
+++ b/Source/core/webcore_dom.target.linux-mips.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -231,7 +230,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +243,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +261,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -387,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -401,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -419,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_dom.target.linux-x86.mk b/Source/core/webcore_dom.target.linux-x86.mk
index 5a5bbd4..b5b2123 100644
--- a/Source/core/webcore_dom.target.linux-x86.mk
+++ b/Source/core/webcore_dom.target.linux-x86.mk
@@ -26,25 +26,20 @@
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp \
 	third_party/WebKit/Source/core/dom/Attr.cpp \
-	third_party/WebKit/Source/core/dom/BeforeTextInsertedEvent.cpp \
-	third_party/WebKit/Source/core/dom/BeforeUnloadEvent.cpp \
 	third_party/WebKit/Source/core/dom/CDATASection.cpp \
 	third_party/WebKit/Source/core/dom/CharacterData.cpp \
-	third_party/WebKit/Source/core/dom/CheckedRadioButtons.cpp \
 	third_party/WebKit/Source/core/dom/ChildListMutationScope.cpp \
 	third_party/WebKit/Source/core/dom/ChildNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClassNodeList.cpp \
 	third_party/WebKit/Source/core/dom/ClientRect.cpp \
 	third_party/WebKit/Source/core/dom/ClientRectList.cpp \
 	third_party/WebKit/Source/core/dom/Clipboard.cpp \
-	third_party/WebKit/Source/core/dom/ClipboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/Comment.cpp \
-	third_party/WebKit/Source/core/dom/CompositionEvent.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNode.cpp \
 	third_party/WebKit/Source/core/dom/ContainerNodeAlgorithms.cpp \
-	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/ContextFeatures.cpp \
 	third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp \
+	third_party/WebKit/Source/core/dom/ContextLifecycleObserver.cpp \
 	third_party/WebKit/Source/core/dom/CustomElement.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackDispatcher.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementCallbackInvocation.cpp \
@@ -56,70 +51,52 @@
 	third_party/WebKit/Source/core/dom/CustomElementRegistrationContext.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementRegistry.cpp \
 	third_party/WebKit/Source/core/dom/CustomElementUpgradeCandidateMap.cpp \
-	third_party/WebKit/Source/core/dom/CustomEvent.cpp \
-	third_party/WebKit/Source/core/dom/DOMError.cpp \
-	third_party/WebKit/Source/core/dom/DOMException.cpp \
-	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
-	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
-	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
-	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
-	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DatasetDOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DataTransferItem.cpp \
 	third_party/WebKit/Source/core/dom/DecodedDataDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
 	third_party/WebKit/Source/core/dom/DeviceOrientationController.cpp \
 	third_party/WebKit/Source/core/dom/Document.cpp \
-	third_party/WebKit/Source/core/dom/DocumentEventQueue.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFragment.cpp \
 	third_party/WebKit/Source/core/dom/DocumentFullscreen.cpp \
 	third_party/WebKit/Source/core/dom/DocumentInit.cpp \
 	third_party/WebKit/Source/core/dom/DocumentLifecycleObserver.cpp \
-	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentMarker.cpp \
+	third_party/WebKit/Source/core/dom/DocumentMarkerController.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedList.cpp \
 	third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp \
 	third_party/WebKit/Source/core/dom/DocumentParser.cpp \
 	third_party/WebKit/Source/core/dom/DocumentSharedObjectPool.cpp \
 	third_party/WebKit/Source/core/dom/DocumentStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/DocumentType.cpp \
+	third_party/WebKit/Source/core/dom/DOMError.cpp \
+	third_party/WebKit/Source/core/dom/DOMException.cpp \
+	third_party/WebKit/Source/core/dom/DOMImplementation.cpp \
+	third_party/WebKit/Source/core/dom/DOMNamedFlowCollection.cpp \
+	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringList.cpp \
+	third_party/WebKit/Source/core/dom/DOMStringMap.cpp \
+	third_party/WebKit/Source/core/dom/DOMTokenList.cpp \
 	third_party/WebKit/Source/core/dom/Element.cpp \
 	third_party/WebKit/Source/core/dom/ElementRareData.cpp \
-	third_party/WebKit/Source/core/dom/ErrorEvent.cpp \
-	third_party/WebKit/Source/core/dom/Event.cpp \
-	third_party/WebKit/Source/core/dom/EventContext.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatchMediator.cpp \
-	third_party/WebKit/Source/core/dom/EventDispatcher.cpp \
-	third_party/WebKit/Source/core/dom/EventRetargeter.cpp \
-	third_party/WebKit/Source/core/dom/EventListenerMap.cpp \
-	third_party/WebKit/Source/core/dom/EventNames.cpp \
-	third_party/WebKit/Source/core/dom/EventPathWalker.cpp \
-	third_party/WebKit/Source/core/dom/EventTarget.cpp \
-	third_party/WebKit/Source/core/dom/FocusEvent.cpp \
 	third_party/WebKit/Source/core/dom/FullscreenElementStack.cpp \
-	third_party/WebKit/Source/core/dom/GenericEventQueue.cpp \
-	third_party/WebKit/Source/core/dom/GestureEvent.cpp \
 	third_party/WebKit/Source/core/dom/IconURL.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserver.cpp \
 	third_party/WebKit/Source/core/dom/IdTargetObserverRegistry.cpp \
-	third_party/WebKit/Source/core/dom/KeyboardEvent.cpp \
 	third_party/WebKit/Source/core/dom/LiveNodeList.cpp \
 	third_party/WebKit/Source/core/dom/MessageChannel.cpp \
-	third_party/WebKit/Source/core/dom/MessageEvent.cpp \
 	third_party/WebKit/Source/core/dom/MessagePort.cpp \
 	third_party/WebKit/Source/core/dom/MessagePortChannel.cpp \
 	third_party/WebKit/Source/core/dom/Microtask.cpp \
-	third_party/WebKit/Source/core/dom/MouseEvent.cpp \
-	third_party/WebKit/Source/core/dom/MouseRelatedEvent.cpp \
-	third_party/WebKit/Source/core/dom/MutationEvent.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserver.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp \
 	third_party/WebKit/Source/core/dom/MutationObserverRegistration.cpp \
 	third_party/WebKit/Source/core/dom/MutationRecord.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlow.cpp \
 	third_party/WebKit/Source/core/dom/NamedFlowCollection.cpp \
-	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodeMap.cpp \
 	third_party/WebKit/Source/core/dom/NamedNodesCollection.cpp \
+	third_party/WebKit/Source/core/dom/NameNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Node.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilter.cpp \
 	third_party/WebKit/Source/core/dom/NodeFilterCondition.cpp \
@@ -129,28 +106,27 @@
 	third_party/WebKit/Source/core/dom/NodeRenderingContext.cpp \
 	third_party/WebKit/Source/core/dom/NodeRenderingTraversal.cpp \
 	third_party/WebKit/Source/core/dom/NodeTraversal.cpp \
-	third_party/WebKit/Source/core/dom/OverflowEvent.cpp \
-	third_party/WebKit/Source/core/dom/PageTransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/PendingScript.cpp \
-	third_party/WebKit/Source/core/dom/PopStateEvent.cpp \
 	third_party/WebKit/Source/core/dom/Position.cpp \
 	third_party/WebKit/Source/core/dom/PositionIterator.cpp \
-	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
-	third_party/WebKit/Source/core/dom/ProgressEvent.cpp \
 	third_party/WebKit/Source/core/dom/PostAttachCallbacks.cpp \
+	third_party/WebKit/Source/core/dom/ProcessingInstruction.cpp \
 	third_party/WebKit/Source/core/dom/PseudoElement.cpp \
 	third_party/WebKit/Source/core/dom/QualifiedName.cpp \
 	third_party/WebKit/Source/core/dom/Range.cpp \
-	third_party/WebKit/Source/core/dom/ResourceProgressEvent.cpp \
-	third_party/WebKit/Source/core/dom/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
+	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/ScriptExecutionContext.cpp \
 	third_party/WebKit/Source/core/dom/ScriptLoader.cpp \
 	third_party/WebKit/Source/core/dom/ScriptRunner.cpp \
-	third_party/WebKit/Source/core/dom/ScriptableDocumentParser.cpp \
-	third_party/WebKit/Source/core/dom/ScriptedAnimationController.cpp \
 	third_party/WebKit/Source/core/dom/SecurityContext.cpp \
 	third_party/WebKit/Source/core/dom/SelectorQuery.cpp \
-	third_party/WebKit/Source/core/dom/DOMSettableTokenList.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
+	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
+	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
+	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp \
 	third_party/WebKit/Source/core/dom/ShadowTreeStyleSheetCollection.cpp \
 	third_party/WebKit/Source/core/dom/SpaceSplitString.cpp \
 	third_party/WebKit/Source/core/dom/StaticNodeList.cpp \
@@ -161,36 +137,59 @@
 	third_party/WebKit/Source/core/dom/StyleSheetScopingNodeList.cpp \
 	third_party/WebKit/Source/core/dom/TagNodeList.cpp \
 	third_party/WebKit/Source/core/dom/Text.cpp \
-	third_party/WebKit/Source/core/dom/TextEvent.cpp \
 	third_party/WebKit/Source/core/dom/TextLinkColors.cpp \
 	third_party/WebKit/Source/core/dom/Touch.cpp \
 	third_party/WebKit/Source/core/dom/TouchController.cpp \
-	third_party/WebKit/Source/core/dom/TouchEvent.cpp \
 	third_party/WebKit/Source/core/dom/TouchList.cpp \
 	third_party/WebKit/Source/core/dom/TransformSourceLibxslt.cpp \
-	third_party/WebKit/Source/core/dom/TransitionEvent.cpp \
 	third_party/WebKit/Source/core/dom/Traversal.cpp \
 	third_party/WebKit/Source/core/dom/TreeScope.cpp \
 	third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp \
 	third_party/WebKit/Source/core/dom/TreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/UIEvent.cpp \
-	third_party/WebKit/Source/core/dom/UIEventWithKeyState.cpp \
 	third_party/WebKit/Source/core/dom/UserActionElementSet.cpp \
 	third_party/WebKit/Source/core/dom/UserGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/UserTypingGestureIndicator.cpp \
 	third_party/WebKit/Source/core/dom/ViewportArguments.cpp \
 	third_party/WebKit/Source/core/dom/VisitedLinkState.cpp \
-	third_party/WebKit/Source/core/dom/WebKitAnimationEvent.cpp \
 	third_party/WebKit/Source/core/dom/WheelController.cpp \
-	third_party/WebKit/Source/core/dom/WheelEvent.cpp \
-	third_party/WebKit/Source/core/dom/WindowEventContext.cpp \
-	third_party/WebKit/Source/core/dom/default/chromium/PlatformMessagePortChannelChromium.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ComposedTreeWalker.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ContentDistribution.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp \
-	third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp \
-	third_party/WebKit/Source/core/dom/shadow/SelectRuleFeatureSet.cpp \
-	third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+	third_party/WebKit/Source/core/events/BeforeTextInsertedEvent.cpp \
+	third_party/WebKit/Source/core/events/BeforeUnloadEvent.cpp \
+	third_party/WebKit/Source/core/events/ClipboardEvent.cpp \
+	third_party/WebKit/Source/core/events/CompositionEvent.cpp \
+	third_party/WebKit/Source/core/events/CustomEvent.cpp \
+	third_party/WebKit/Source/core/events/DocumentEventQueue.cpp \
+	third_party/WebKit/Source/core/events/ErrorEvent.cpp \
+	third_party/WebKit/Source/core/events/Event.cpp \
+	third_party/WebKit/Source/core/events/EventContext.cpp \
+	third_party/WebKit/Source/core/events/EventDispatcher.cpp \
+	third_party/WebKit/Source/core/events/EventDispatchMediator.cpp \
+	third_party/WebKit/Source/core/events/EventListenerMap.cpp \
+	third_party/WebKit/Source/core/events/EventNames.cpp \
+	third_party/WebKit/Source/core/events/EventPathWalker.cpp \
+	third_party/WebKit/Source/core/events/EventRetargeter.cpp \
+	third_party/WebKit/Source/core/events/EventTarget.cpp \
+	third_party/WebKit/Source/core/events/FocusEvent.cpp \
+	third_party/WebKit/Source/core/events/GenericEventQueue.cpp \
+	third_party/WebKit/Source/core/events/GestureEvent.cpp \
+	third_party/WebKit/Source/core/events/KeyboardEvent.cpp \
+	third_party/WebKit/Source/core/events/MessageEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseEvent.cpp \
+	third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp \
+	third_party/WebKit/Source/core/events/MutationEvent.cpp \
+	third_party/WebKit/Source/core/events/OverflowEvent.cpp \
+	third_party/WebKit/Source/core/events/PageTransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/PopStateEvent.cpp \
+	third_party/WebKit/Source/core/events/ProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ResourceProgressEvent.cpp \
+	third_party/WebKit/Source/core/events/ScopedEventQueue.cpp \
+	third_party/WebKit/Source/core/events/TextEvent.cpp \
+	third_party/WebKit/Source/core/events/TouchEvent.cpp \
+	third_party/WebKit/Source/core/events/TransitionEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEvent.cpp \
+	third_party/WebKit/Source/core/events/UIEventWithKeyState.cpp \
+	third_party/WebKit/Source/core/events/WebKitAnimationEvent.cpp \
+	third_party/WebKit/Source/core/events/WheelEvent.cpp \
+	third_party/WebKit/Source/core/events/WindowEventContext.cpp
 
 
 # Flags passed to both C and C++ files.
@@ -233,7 +232,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -247,7 +245,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -265,14 +263,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -392,7 +389,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -406,7 +402,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -424,14 +420,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.darwin-arm.mk b/Source/core/webcore_html.target.darwin-arm.mk
index 66e52be..45d9e7b 100644
--- a/Source/core/webcore_html.target.darwin-arm.mk
+++ b/Source/core/webcore_html.target.darwin-arm.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -326,7 +328,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -340,7 +341,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -358,14 +359,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -482,7 +482,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -496,7 +495,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -514,14 +513,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.darwin-mips.mk b/Source/core/webcore_html.target.darwin-mips.mk
index ec7fa84..cbfed54 100644
--- a/Source/core/webcore_html.target.darwin-mips.mk
+++ b/Source/core/webcore_html.target.darwin-mips.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -326,7 +328,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -340,7 +341,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -358,14 +359,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -482,7 +482,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -496,7 +495,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -514,14 +513,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.darwin-x86.mk b/Source/core/webcore_html.target.darwin-x86.mk
index b6542a6..2a795d6 100644
--- a/Source/core/webcore_html.target.darwin-x86.mk
+++ b/Source/core/webcore_html.target.darwin-x86.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -328,7 +330,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -342,7 +343,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -360,14 +361,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -487,7 +487,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -501,7 +500,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -519,14 +518,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.linux-arm.mk b/Source/core/webcore_html.target.linux-arm.mk
index 66e52be..45d9e7b 100644
--- a/Source/core/webcore_html.target.linux-arm.mk
+++ b/Source/core/webcore_html.target.linux-arm.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -326,7 +328,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -340,7 +341,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -358,14 +359,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -482,7 +482,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -496,7 +495,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -514,14 +513,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.linux-mips.mk b/Source/core/webcore_html.target.linux-mips.mk
index ec7fa84..cbfed54 100644
--- a/Source/core/webcore_html.target.linux-mips.mk
+++ b/Source/core/webcore_html.target.linux-mips.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -326,7 +328,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -340,7 +341,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -358,14 +359,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -482,7 +482,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -496,7 +495,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -514,14 +513,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_html.target.linux-x86.mk b/Source/core/webcore_html.target.linux-x86.mk
index b6542a6..2a795d6 100644
--- a/Source/core/webcore_html.target.linux-x86.mk
+++ b/Source/core/webcore_html.target.linux-x86.mk
@@ -24,26 +24,10 @@
 GYP_COPIED_SOURCE_ORIGIN_DIRS :=
 
 LOCAL_SRC_FILES := \
-	third_party/WebKit/Source/core/html/BaseButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseCheckableInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseChooserOnlyDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseClickableWithKeyInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseMultipleFieldsDateAndTimeInputType.cpp \
-	third_party/WebKit/Source/core/html/BaseTextInputType.cpp \
-	third_party/WebKit/Source/core/html/ButtonInputType.cpp \
-	third_party/WebKit/Source/core/html/CheckboxInputType.cpp \
 	third_party/WebKit/Source/core/html/ClassList.cpp \
-	third_party/WebKit/Source/core/html/ColorInputType.cpp \
 	third_party/WebKit/Source/core/html/DOMFormData.cpp \
 	third_party/WebKit/Source/core/html/DOMURL.cpp \
-	third_party/WebKit/Source/core/html/DateInputType.cpp \
-	third_party/WebKit/Source/core/html/DateTimeFieldsState.cpp \
-	third_party/WebKit/Source/core/html/DateTimeLocalInputType.cpp \
-	third_party/WebKit/Source/core/html/EmailInputType.cpp \
-	third_party/WebKit/Source/core/html/FileInputType.cpp \
 	third_party/WebKit/Source/core/html/FormAssociatedElement.cpp \
-	third_party/WebKit/Source/core/html/FormController.cpp \
 	third_party/WebKit/Source/core/html/FormDataList.cpp \
 	third_party/WebKit/Source/core/html/HTMLAllCollection.cpp \
 	third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp \
@@ -136,12 +120,8 @@
 	third_party/WebKit/Source/core/html/HTMLUListElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLVideoElement.cpp \
 	third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp \
-	third_party/WebKit/Source/core/html/HiddenInputType.cpp \
 	third_party/WebKit/Source/core/html/ImageData.cpp \
 	third_party/WebKit/Source/core/html/ImageDocument.cpp \
-	third_party/WebKit/Source/core/html/ImageInputType.cpp \
-	third_party/WebKit/Source/core/html/InputType.cpp \
-	third_party/WebKit/Source/core/html/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/LabelableElement.cpp \
 	third_party/WebKit/Source/core/html/LabelsNodeList.cpp \
 	third_party/WebKit/Source/core/html/LinkImport.cpp \
@@ -152,29 +132,12 @@
 	third_party/WebKit/Source/core/html/MediaFragmentURIParser.cpp \
 	third_party/WebKit/Source/core/html/MediaKeyEvent.cpp \
 	third_party/WebKit/Source/core/html/HTMLMediaSource.cpp \
-	third_party/WebKit/Source/core/html/MonthInputType.cpp \
-	third_party/WebKit/Source/core/html/NumberInputType.cpp \
-	third_party/WebKit/Source/core/html/PasswordInputType.cpp \
 	third_party/WebKit/Source/core/html/PluginDocument.cpp \
 	third_party/WebKit/Source/core/html/PublicURLManager.cpp \
-	third_party/WebKit/Source/core/html/RadioInputType.cpp \
 	third_party/WebKit/Source/core/html/RadioNodeList.cpp \
-	third_party/WebKit/Source/core/html/RangeInputType.cpp \
-	third_party/WebKit/Source/core/html/ResetInputType.cpp \
-	third_party/WebKit/Source/core/html/SearchInputType.cpp \
-	third_party/WebKit/Source/core/html/StepRange.cpp \
-	third_party/WebKit/Source/core/html/SubmitInputType.cpp \
-	third_party/WebKit/Source/core/html/TelephoneInputType.cpp \
 	third_party/WebKit/Source/core/html/TextDocument.cpp \
-	third_party/WebKit/Source/core/html/TextFieldInputType.cpp \
-	third_party/WebKit/Source/core/html/TextInputType.cpp \
-	third_party/WebKit/Source/core/html/TimeInputType.cpp \
 	third_party/WebKit/Source/core/html/TimeRanges.cpp \
-	third_party/WebKit/Source/core/html/URLInputType.cpp \
-	third_party/WebKit/Source/core/html/ValidationMessage.cpp \
 	third_party/WebKit/Source/core/html/ValidityState.cpp \
-	third_party/WebKit/Source/core/html/WeekInputType.cpp \
-	third_party/WebKit/Source/core/html/TypeAhead.cpp \
 	third_party/WebKit/Source/core/html/canvas/ANGLEInstancedArrays.cpp \
 	third_party/WebKit/Source/core/html/canvas/Canvas2DContextAttributes.cpp \
 	third_party/WebKit/Source/core/html/canvas/CanvasContextAttributes.cpp \
@@ -220,7 +183,45 @@
 	third_party/WebKit/Source/core/html/canvas/WebGLTexture.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLUniformLocation.cpp \
 	third_party/WebKit/Source/core/html/canvas/WebGLVertexArrayObjectOES.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseCheckableInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseChooserOnlyDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseClickableWithKeyInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/BaseTextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ButtonInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckboxInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/CheckedRadioButtons.cpp \
+	third_party/WebKit/Source/core/html/forms/ColorInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeFieldsState.cpp \
+	third_party/WebKit/Source/core/html/forms/DateTimeLocalInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/EmailInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FileInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/FormController.cpp \
+	third_party/WebKit/Source/core/html/forms/HiddenInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ImageInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputType.cpp \
+	third_party/WebKit/Source/core/html/forms/InputTypeNames.cpp \
 	third_party/WebKit/Source/core/html/forms/InputTypeView.cpp \
+	third_party/WebKit/Source/core/html/forms/MonthInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/NumberInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/PasswordInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RadioInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/RangeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ResetInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/SearchInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/StepRange.cpp \
+	third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TelephoneInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TextInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TimeInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/TypeAhead.cpp \
+	third_party/WebKit/Source/core/html/forms/URLInputType.cpp \
+	third_party/WebKit/Source/core/html/forms/ValidationMessage.cpp \
+	third_party/WebKit/Source/core/html/forms/WeekInputType.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp \
 	third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp \
 	third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp \
@@ -241,6 +242,7 @@
 	third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLSourceTracker.cpp \
+	third_party/WebKit/Source/core/html/parser/HTMLSrcsetParser.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTokenizer.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilder.cpp \
 	third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp \
@@ -328,7 +330,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -342,7 +343,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -360,14 +361,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -487,7 +487,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -501,7 +500,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -519,14 +518,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.darwin-arm.mk b/Source/core/webcore_platform.target.darwin-arm.mk
index 23464cb..084e252 100644
--- a/Source/core/webcore_platform.target.darwin-arm.mk
+++ b/Source/core/webcore_platform.target.darwin-arm.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -374,7 +373,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -388,7 +386,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -406,14 +404,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -531,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -545,7 +541,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -563,14 +559,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.darwin-mips.mk b/Source/core/webcore_platform.target.darwin-mips.mk
index ecfbaf5..c3e7f80 100644
--- a/Source/core/webcore_platform.target.darwin-mips.mk
+++ b/Source/core/webcore_platform.target.darwin-mips.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -374,7 +373,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -388,7 +386,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -406,14 +404,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -531,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -545,7 +541,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -563,14 +559,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.darwin-x86.mk b/Source/core/webcore_platform.target.darwin-x86.mk
index c5e4112..054e56d 100644
--- a/Source/core/webcore_platform.target.darwin-x86.mk
+++ b/Source/core/webcore_platform.target.darwin-x86.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -376,7 +375,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -390,7 +388,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -408,14 +406,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -536,7 +533,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -550,7 +546,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -568,14 +564,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.linux-arm.mk b/Source/core/webcore_platform.target.linux-arm.mk
index 23464cb..084e252 100644
--- a/Source/core/webcore_platform.target.linux-arm.mk
+++ b/Source/core/webcore_platform.target.linux-arm.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -374,7 +373,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -388,7 +386,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -406,14 +404,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -531,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -545,7 +541,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -563,14 +559,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.linux-mips.mk b/Source/core/webcore_platform.target.linux-mips.mk
index ecfbaf5..c3e7f80 100644
--- a/Source/core/webcore_platform.target.linux-mips.mk
+++ b/Source/core/webcore_platform.target.linux-mips.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -374,7 +373,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -388,7 +386,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -406,14 +404,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -531,7 +528,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -545,7 +541,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -563,14 +559,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform.target.linux-x86.mk b/Source/core/webcore_platform.target.linux-x86.mk
index c5e4112..054e56d 100644
--- a/Source/core/webcore_platform.target.linux-x86.mk
+++ b/Source/core/webcore_platform.target.linux-x86.mk
@@ -25,7 +25,6 @@
 
 LOCAL_SRC_FILES := \
 	third_party/WebKit/Source/core/platform/CalculationValue.cpp \
-	third_party/WebKit/Source/core/platform/Clock.cpp \
 	third_party/WebKit/Source/core/platform/ContentType.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenu.cpp \
 	third_party/WebKit/Source/core/platform/ContextMenuItem.cpp \
@@ -76,6 +75,7 @@
 	third_party/WebKit/Source/core/platform/Timer.cpp \
 	third_party/WebKit/Source/core/platform/UUID.cpp \
 	third_party/WebKit/Source/core/platform/Widget.cpp \
+	third_party/WebKit/Source/core/platform/animation/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationData.cpp \
 	third_party/WebKit/Source/core/platform/animation/CSSAnimationDataList.cpp \
 	third_party/WebKit/Source/core/platform/animation/KeyframeValueList.cpp \
@@ -129,7 +129,6 @@
 	third_party/WebKit/Source/core/platform/chromium/FramelessScrollView.cpp \
 	third_party/WebKit/Source/core/platform/chromium/HistogramSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/KeyCodeConversionAndroid.cpp \
-	third_party/WebKit/Source/core/platform/chromium/LanguageChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MemoryUsageSupportChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/MIMETypeRegistryChromium.cpp \
 	third_party/WebKit/Source/core/platform/chromium/PlatformKeyboardEventChromium.cpp \
@@ -188,7 +187,6 @@
 	third_party/WebKit/Source/core/platform/graphics/SurrogatePairAwareTextIterator.cpp \
 	third_party/WebKit/Source/core/platform/graphics/TextRun.cpp \
 	third_party/WebKit/Source/core/platform/graphics/WidthIterator.cpp \
-	third_party/WebKit/Source/core/platform/graphics/chromium/AnimationTranslationUtil.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/Canvas2DLayerManager.cpp \
 	third_party/WebKit/Source/core/platform/graphics/chromium/DeferredImageDecoder.cpp \
@@ -250,6 +248,7 @@
 	third_party/WebKit/Source/core/platform/graphics/harfbuzz/HarfBuzzShaper.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeSanitizer.cpp \
 	third_party/WebKit/Source/core/platform/graphics/opentype/OpenTypeVerticalData.cpp \
+	third_party/WebKit/Source/core/platform/graphics/skia/FontCacheSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontCustomPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/FontPlatformDataSkia.cpp \
 	third_party/WebKit/Source/core/platform/graphics/skia/GlyphPageTreeNodeSkia.cpp \
@@ -376,7 +375,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -390,7 +388,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -408,14 +406,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -536,7 +533,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -550,7 +546,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -568,14 +564,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.darwin-arm.mk b/Source/core/webcore_platform_geometry.target.darwin-arm.mk
index 81e0f2a..2e6273f 100644
--- a/Source/core/webcore_platform_geometry.target.darwin-arm.mk
+++ b/Source/core/webcore_platform_geometry.target.darwin-arm.mk
@@ -75,7 +75,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -89,7 +88,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -107,14 +106,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -231,7 +229,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +242,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +260,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.darwin-mips.mk b/Source/core/webcore_platform_geometry.target.darwin-mips.mk
index 50ab713..53c3b99 100644
--- a/Source/core/webcore_platform_geometry.target.darwin-mips.mk
+++ b/Source/core/webcore_platform_geometry.target.darwin-mips.mk
@@ -75,7 +75,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -89,7 +88,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -107,14 +106,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -231,7 +229,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +242,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +260,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.darwin-x86.mk b/Source/core/webcore_platform_geometry.target.darwin-x86.mk
index 3abff95..5af0ac3 100644
--- a/Source/core/webcore_platform_geometry.target.darwin-x86.mk
+++ b/Source/core/webcore_platform_geometry.target.darwin-x86.mk
@@ -77,7 +77,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -91,7 +90,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -109,14 +108,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -236,7 +234,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -250,7 +247,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -268,14 +265,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.linux-arm.mk b/Source/core/webcore_platform_geometry.target.linux-arm.mk
index 81e0f2a..2e6273f 100644
--- a/Source/core/webcore_platform_geometry.target.linux-arm.mk
+++ b/Source/core/webcore_platform_geometry.target.linux-arm.mk
@@ -75,7 +75,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -89,7 +88,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -107,14 +106,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -231,7 +229,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +242,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +260,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.linux-mips.mk b/Source/core/webcore_platform_geometry.target.linux-mips.mk
index 50ab713..53c3b99 100644
--- a/Source/core/webcore_platform_geometry.target.linux-mips.mk
+++ b/Source/core/webcore_platform_geometry.target.linux-mips.mk
@@ -75,7 +75,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -89,7 +88,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -107,14 +106,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -231,7 +229,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -245,7 +242,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -263,14 +260,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_platform_geometry.target.linux-x86.mk b/Source/core/webcore_platform_geometry.target.linux-x86.mk
index 3abff95..5af0ac3 100644
--- a/Source/core/webcore_platform_geometry.target.linux-x86.mk
+++ b/Source/core/webcore_platform_geometry.target.linux-x86.mk
@@ -77,7 +77,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -91,7 +90,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -109,14 +108,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -236,7 +234,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -250,7 +247,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -268,14 +265,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_prerequisites.target.darwin-arm.mk b/Source/core/webcore_prerequisites.target.darwin-arm.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.darwin-arm.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-arm.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_prerequisites.target.darwin-mips.mk b/Source/core/webcore_prerequisites.target.darwin-mips.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.darwin-mips.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-mips.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_prerequisites.target.darwin-x86.mk b/Source/core/webcore_prerequisites.target.darwin-x86.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.darwin-x86.mk
+++ b/Source/core/webcore_prerequisites.target.darwin-x86.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_prerequisites.target.linux-arm.mk b/Source/core/webcore_prerequisites.target.linux-arm.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.linux-arm.mk
+++ b/Source/core/webcore_prerequisites.target.linux-arm.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_prerequisites.target.linux-mips.mk b/Source/core/webcore_prerequisites.target.linux-mips.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.linux-mips.mk
+++ b/Source/core/webcore_prerequisites.target.linux-mips.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_prerequisites.target.linux-x86.mk b/Source/core/webcore_prerequisites.target.linux-x86.mk
index d1b5c61..9b63115 100644
--- a/Source/core/webcore_prerequisites.target.linux-x86.mk
+++ b/Source/core/webcore_prerequisites.target.linux-x86.mk
@@ -22,6 +22,7 @@
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_core_make_derived_sources_gyp)/make_derived_sources.stamp \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_wtf_wtf_gyp)/third_party_WebKit_Source_wtf_wtf_gyp.a \
 	$(call intermediates-dir-for,GYP,third_party_WebKit_Source_config_gyp)/config.stamp \
+	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_platform_blink_platform_gyp)/third_party_WebKit_Source_platform_blink_platform_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_WebKit_Source_weborigin_weborigin_gyp)/third_party_WebKit_Source_weborigin_weborigin_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,third_party_angle_dx11_src_translator_glsl_gyp)/third_party_angle_dx11_src_translator_glsl_gyp.a \
 	$(call intermediates-dir-for,STATIC_LIBRARIES,gpu_gles2_c_lib_gyp)/gpu_gles2_c_lib_gyp.a \
diff --git a/Source/core/webcore_remaining.target.darwin-arm.mk b/Source/core/webcore_remaining.target.darwin-arm.mk
index d76ddd1..8866fa8 100644
--- a/Source/core/webcore_remaining.target.darwin-arm.mk
+++ b/Source/core/webcore_remaining.target.darwin-arm.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -555,7 +554,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -569,7 +567,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -587,14 +585,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -712,7 +709,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -726,7 +722,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -744,14 +740,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_remaining.target.darwin-mips.mk b/Source/core/webcore_remaining.target.darwin-mips.mk
index 3a01fe0..8f3d77f 100644
--- a/Source/core/webcore_remaining.target.darwin-mips.mk
+++ b/Source/core/webcore_remaining.target.darwin-mips.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -555,7 +554,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -569,7 +567,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -587,14 +585,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -712,7 +709,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -726,7 +722,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -744,14 +740,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_remaining.target.darwin-x86.mk b/Source/core/webcore_remaining.target.darwin-x86.mk
index 96ac6d7..1bb045e 100644
--- a/Source/core/webcore_remaining.target.darwin-x86.mk
+++ b/Source/core/webcore_remaining.target.darwin-x86.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -557,7 +556,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -571,7 +569,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -589,14 +587,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -717,7 +714,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -731,7 +727,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -749,14 +745,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_remaining.target.linux-arm.mk b/Source/core/webcore_remaining.target.linux-arm.mk
index d76ddd1..8866fa8 100644
--- a/Source/core/webcore_remaining.target.linux-arm.mk
+++ b/Source/core/webcore_remaining.target.linux-arm.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -555,7 +554,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -569,7 +567,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -587,14 +585,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -712,7 +709,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -726,7 +722,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -744,14 +740,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_remaining.target.linux-mips.mk b/Source/core/webcore_remaining.target.linux-mips.mk
index 3a01fe0..8f3d77f 100644
--- a/Source/core/webcore_remaining.target.linux-mips.mk
+++ b/Source/core/webcore_remaining.target.linux-mips.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -555,7 +554,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -569,7 +567,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -587,14 +585,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -712,7 +709,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -726,7 +722,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -744,14 +740,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_remaining.target.linux-x86.mk b/Source/core/webcore_remaining.target.linux-x86.mk
index 96ac6d7..1bb045e 100644
--- a/Source/core/webcore_remaining.target.linux-x86.mk
+++ b/Source/core/webcore_remaining.target.linux-x86.mk
@@ -242,7 +242,6 @@
 	third_party/WebKit/Source/core/editing/VisibleSelection.cpp \
 	third_party/WebKit/Source/core/editing/VisibleUnits.cpp \
 	third_party/WebKit/Source/core/editing/WrapContentsInDummySpanCommand.cpp \
-	third_party/WebKit/Source/core/editing/chromium/EditorChromium.cpp \
 	third_party/WebKit/Source/core/editing/htmlediting.cpp \
 	third_party/WebKit/Source/core/editing/markup.cpp \
 	third_party/WebKit/Source/core/fetch/CachedMetadata.cpp \
@@ -557,7 +556,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -571,7 +569,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -589,14 +587,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -717,7 +714,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -731,7 +727,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -749,14 +745,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.darwin-arm.mk b/Source/core/webcore_rendering.target.darwin-arm.mk
index 073c918..676e4b0 100644
--- a/Source/core/webcore_rendering.target.darwin-arm.mk
+++ b/Source/core/webcore_rendering.target.darwin-arm.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -222,7 +223,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -236,7 +236,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -254,14 +254,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -378,7 +377,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -392,7 +390,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -410,14 +408,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.darwin-mips.mk b/Source/core/webcore_rendering.target.darwin-mips.mk
index 84cc4e8..6b03c3a 100644
--- a/Source/core/webcore_rendering.target.darwin-mips.mk
+++ b/Source/core/webcore_rendering.target.darwin-mips.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -222,7 +223,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -236,7 +236,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -254,14 +254,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -378,7 +377,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -392,7 +390,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -410,14 +408,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.darwin-x86.mk b/Source/core/webcore_rendering.target.darwin-x86.mk
index bd8b8d1..3239bd3 100644
--- a/Source/core/webcore_rendering.target.darwin-x86.mk
+++ b/Source/core/webcore_rendering.target.darwin-x86.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -225,7 +226,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -239,7 +239,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -257,14 +257,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -385,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -399,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -417,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.linux-arm.mk b/Source/core/webcore_rendering.target.linux-arm.mk
index 073c918..676e4b0 100644
--- a/Source/core/webcore_rendering.target.linux-arm.mk
+++ b/Source/core/webcore_rendering.target.linux-arm.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -222,7 +223,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -236,7 +236,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -254,14 +254,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -378,7 +377,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -392,7 +390,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -410,14 +408,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.linux-mips.mk b/Source/core/webcore_rendering.target.linux-mips.mk
index 84cc4e8..6b03c3a 100644
--- a/Source/core/webcore_rendering.target.linux-mips.mk
+++ b/Source/core/webcore_rendering.target.linux-mips.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -222,7 +223,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -236,7 +236,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -254,14 +254,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -378,7 +377,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -392,7 +390,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -410,14 +408,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_rendering.target.linux-x86.mk b/Source/core/webcore_rendering.target.linux-x86.mk
index bd8b8d1..3239bd3 100644
--- a/Source/core/webcore_rendering.target.linux-x86.mk
+++ b/Source/core/webcore_rendering.target.linux-x86.mk
@@ -145,6 +145,7 @@
 	third_party/WebKit/Source/core/rendering/ScrollBehavior.cpp \
 	third_party/WebKit/Source/core/rendering/SubtreeLayoutScope.cpp \
 	third_party/WebKit/Source/core/rendering/break_lines.cpp \
+	third_party/WebKit/Source/core/rendering/animation/WebAnimationProvider.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/PolygonShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RasterShape.cpp \
 	third_party/WebKit/Source/core/rendering/shapes/RectangleShape.cpp \
@@ -225,7 +226,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -239,7 +239,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -257,14 +257,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -385,7 +384,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -399,7 +397,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -417,14 +415,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.darwin-arm.mk b/Source/core/webcore_svg.target.darwin-arm.mk
index 359e389..1339d10 100644
--- a/Source/core/webcore_svg.target.darwin-arm.mk
+++ b/Source/core/webcore_svg.target.darwin-arm.mk
@@ -283,7 +283,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -297,7 +296,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -315,14 +314,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -439,7 +437,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -453,7 +450,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -471,14 +468,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.darwin-mips.mk b/Source/core/webcore_svg.target.darwin-mips.mk
index 83f5330..9e109f5 100644
--- a/Source/core/webcore_svg.target.darwin-mips.mk
+++ b/Source/core/webcore_svg.target.darwin-mips.mk
@@ -283,7 +283,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -297,7 +296,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -315,14 +314,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -439,7 +437,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -453,7 +450,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -471,14 +468,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.darwin-x86.mk b/Source/core/webcore_svg.target.darwin-x86.mk
index ca67226..6de279a 100644
--- a/Source/core/webcore_svg.target.darwin-x86.mk
+++ b/Source/core/webcore_svg.target.darwin-x86.mk
@@ -285,7 +285,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -299,7 +298,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -317,14 +316,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -444,7 +442,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -458,7 +455,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -476,14 +473,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.linux-arm.mk b/Source/core/webcore_svg.target.linux-arm.mk
index 359e389..1339d10 100644
--- a/Source/core/webcore_svg.target.linux-arm.mk
+++ b/Source/core/webcore_svg.target.linux-arm.mk
@@ -283,7 +283,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -297,7 +296,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -315,14 +314,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -439,7 +437,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -453,7 +450,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -471,14 +468,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.linux-mips.mk b/Source/core/webcore_svg.target.linux-mips.mk
index 83f5330..9e109f5 100644
--- a/Source/core/webcore_svg.target.linux-mips.mk
+++ b/Source/core/webcore_svg.target.linux-mips.mk
@@ -283,7 +283,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -297,7 +296,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -315,14 +314,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -439,7 +437,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -453,7 +450,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -471,14 +468,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/webcore_svg.target.linux-x86.mk b/Source/core/webcore_svg.target.linux-x86.mk
index ca67226..6de279a 100644
--- a/Source/core/webcore_svg.target.linux-x86.mk
+++ b/Source/core/webcore_svg.target.linux-x86.mk
@@ -285,7 +285,6 @@
 
 MY_DEFS_Debug := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -299,7 +298,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -317,14 +316,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
@@ -444,7 +442,6 @@
 
 MY_DEFS_Release := \
 	'-DANGLE_DX11' \
-	'-DWTF_VECTOR_INITIAL_SIZE=4' \
 	'-D_FILE_OFFSET_BITS=64' \
 	'-DNO_TCMALLOC' \
 	'-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \
@@ -458,7 +455,7 @@
 	'-DUSE_OPENSSL=1' \
 	'-DENABLE_EGLIMAGE=1' \
 	'-DCLD_VERSION=1' \
-	'-DWEBKIT_IMPLEMENTATION=1' \
+	'-DBLINK_IMPLEMENTATION=1' \
 	'-DINSIDE_WEBKIT' \
 	'-DENABLE_CSS3_TEXT=0' \
 	'-DENABLE_CSS_EXCLUSIONS=1' \
@@ -476,14 +473,13 @@
 	'-DENABLE_MEDIA_CAPTURE=1' \
 	'-DENABLE_ORIENTATION_EVENTS=1' \
 	'-DENABLE_NAVIGATOR_CONTENT_UTILS=0' \
-	'-DWTF_USE_NATIVE_FULLSCREEN_VIDEO=1' \
 	'-DENABLE_OPENTYPE_VERTICAL=1' \
 	'-DU_USING_ICU_NAMESPACE=0' \
 	'-DSK_ENABLE_INST_COUNT=0' \
 	'-DSK_SUPPORT_GPU=1' \
 	'-DGR_GL_CUSTOM_SETUP_HEADER="GrGLConfig_chrome.h"' \
+	'-DSK_ENABLE_LEGACY_API_ALIASING=1' \
 	'-DSK_BUILD_FOR_ANDROID' \
-	'-DUSE_CHROMIUM_SKIA' \
 	'-DSK_USE_POSIX_THREADS' \
 	'-DSK_DEFERRED_CANVAS_USES_FACTORIES=1' \
 	'-DCHROME_PNG_WRITE_SUPPORT' \
diff --git a/Source/core/workers/AbstractWorker.cpp b/Source/core/workers/AbstractWorker.cpp
index 0d3907d..d0d8be1 100644
--- a/Source/core/workers/AbstractWorker.cpp
+++ b/Source/core/workers/AbstractWorker.cpp
@@ -32,7 +32,7 @@
 #include "core/workers/AbstractWorker.h"
 
 #include "bindings/v8/ExceptionState.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/page/ContentSecurityPolicy.h"
diff --git a/Source/core/workers/AbstractWorker.h b/Source/core/workers/AbstractWorker.h
index de94684..4e77e8e 100644
--- a/Source/core/workers/AbstractWorker.h
+++ b/Source/core/workers/AbstractWorker.h
@@ -33,9 +33,9 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/RefCounted.h"
 #include "wtf/RefPtr.h"
diff --git a/Source/core/workers/SharedWorkerGlobalScope.cpp b/Source/core/workers/SharedWorkerGlobalScope.cpp
index 43254a1..e883936 100644
--- a/Source/core/workers/SharedWorkerGlobalScope.cpp
+++ b/Source/core/workers/SharedWorkerGlobalScope.cpp
@@ -32,8 +32,8 @@
 
 #include "core/workers/SharedWorkerGlobalScope.h"
 
-#include "core/dom/EventNames.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/MessageEvent.h"
 #include "core/inspector/ScriptCallStack.h"
 #include "core/page/DOMWindow.h"
 #include "core/workers/SharedWorkerThread.h"
@@ -43,10 +43,10 @@
 
 namespace WebCore {
 
-PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> port)
+PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> prpPort)
 {
-    RefPtr<MessagePort> sourcePort = port;
-    RefPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, sourcePort)), "", "", sourcePort);
+    RefPtr<MessagePort> port = prpPort;
+    RefPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, port)), String(), String(), port);
     event->initEvent(eventNames().connectEvent, false, false);
     return event.release();
 }
diff --git a/Source/core/workers/Worker.cpp b/Source/core/workers/Worker.cpp
index fd19c81..fc5b16a 100644
--- a/Source/core/workers/Worker.cpp
+++ b/Source/core/workers/Worker.cpp
@@ -30,9 +30,9 @@
 
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/Document.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/MessageEvent.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/page/DOMWindow.h"
diff --git a/Source/core/workers/Worker.h b/Source/core/workers/Worker.h
index 023578a..3f276d0 100644
--- a/Source/core/workers/Worker.h
+++ b/Source/core/workers/Worker.h
@@ -28,9 +28,9 @@
 #define Worker_h
 
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/MessagePort.h"
 #include "core/workers/AbstractWorker.h"
 #include "core/workers/WorkerScriptLoaderClient.h"
diff --git a/Source/core/workers/WorkerEventQueue.cpp b/Source/core/workers/WorkerEventQueue.cpp
index fef5b69..90638e3 100644
--- a/Source/core/workers/WorkerEventQueue.cpp
+++ b/Source/core/workers/WorkerEventQueue.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "core/workers/WorkerEventQueue.h"
 
-#include "core/dom/Event.h"
+#include "core/events/Event.h"
 #include "core/dom/ScriptExecutionContext.h"
 
 namespace WebCore {
diff --git a/Source/core/workers/WorkerEventQueue.h b/Source/core/workers/WorkerEventQueue.h
index fda0b93..525e297 100644
--- a/Source/core/workers/WorkerEventQueue.h
+++ b/Source/core/workers/WorkerEventQueue.h
@@ -27,7 +27,7 @@
 #ifndef WorkerEventQueue_h
 #define WorkerEventQueue_h
 
-#include "core/dom/EventQueue.h"
+#include "core/events/EventQueue.h"
 #include "wtf/HashMap.h"
 #include "wtf/HashSet.h"
 #include "wtf/PassOwnPtr.h"
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index e7dc7d8..f0ec554 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -34,8 +34,8 @@
 #include "bindings/v8/ScriptValue.h"
 #include "core/dom/ActiveDOMObject.h"
 #include "core/dom/ContextLifecycleNotifier.h"
-#include "core/dom/ErrorEvent.h"
-#include "core/dom/Event.h"
+#include "core/events/ErrorEvent.h"
+#include "core/events/Event.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/dom/MessagePort.h"
 #include "core/html/DOMURL.h"
diff --git a/Source/core/workers/WorkerGlobalScope.h b/Source/core/workers/WorkerGlobalScope.h
index 1aca7bb..7145f95 100644
--- a/Source/core/workers/WorkerGlobalScope.h
+++ b/Source/core/workers/WorkerGlobalScope.h
@@ -29,9 +29,9 @@
 
 #include "bindings/v8/ScriptWrappable.h"
 #include "bindings/v8/WorkerScriptController.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
-#include "core/dom/EventTarget.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
+#include "core/events/EventTarget.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/page/ContentSecurityPolicy.h"
 #include "core/workers/WorkerConsole.h"
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index 950ee3d..ecd4557 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -31,8 +31,8 @@
 
 #include "core/dom/CrossThreadTask.h"
 #include "core/dom/Document.h"
-#include "core/dom/ErrorEvent.h"
-#include "core/dom/MessageEvent.h"
+#include "core/events/ErrorEvent.h"
+#include "core/events/MessageEvent.h"
 #include "core/dom/ScriptExecutionContext.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/inspector/ScriptCallStack.h"
diff --git a/Source/core/xml/XMLHttpRequest.cpp b/Source/core/xml/XMLHttpRequest.cpp
index 4b5e89b..0264d80 100644
--- a/Source/core/xml/XMLHttpRequest.cpp
+++ b/Source/core/xml/XMLHttpRequest.cpp
@@ -29,9 +29,9 @@
 #include "bindings/v8/ExceptionState.h"
 #include "core/dom/ContextFeatures.h"
 #include "core/dom/DOMImplementation.h"
-#include "core/dom/Event.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/dom/ExceptionCode.h"
 #include "core/editing/markup.h"
 #include "core/fetch/CrossOriginAccessControl.h"
@@ -481,7 +481,9 @@
 
 void XMLHttpRequest::open(const String& method, const KURL& url, bool async, ExceptionState& es)
 {
-    internalAbort();
+    if (!internalAbort())
+        return;
+
     State previousState = m_state;
     m_state = UNSENT;
     m_error = false;
@@ -792,22 +794,16 @@
             // Neither this object nor the JavaScript wrapper should be deleted while
             // a request is in progress because we need to keep the listeners alive,
             // and they are referenced by the JavaScript wrapper.
-
-            // m_loader was null, so there should be no pending activity at this point.
-            ASSERT(!hasPendingActivity());
             setPendingActivity(this);
         }
     } else {
-        request.setPriority(ResourceLoadPriorityVeryHigh);
-        InspectorInstrumentation::willLoadXHRSynchronously(scriptExecutionContext());
         ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, *this, options);
-        InspectorInstrumentation::didLoadXHRSynchronously(scriptExecutionContext());
     }
 
     if (!m_exceptionCode && m_error)
         m_exceptionCode = NetworkError;
     if (m_exceptionCode)
-        es.throwDOMException(m_exceptionCode);
+        es.throwUninformativeAndGenericDOMException(m_exceptionCode);
 }
 
 void XMLHttpRequest::abort()
@@ -817,7 +813,8 @@
 
     bool sendFlag = m_loader;
 
-    internalAbort();
+    if (!internalAbort())
+        return;
 
     clearResponseBuffers();
 
@@ -840,7 +837,7 @@
     }
 }
 
-void XMLHttpRequest::internalAbort(DropProtection async)
+bool XMLHttpRequest::internalAbort(DropProtection async)
 {
     m_error = true;
 
@@ -854,15 +851,31 @@
         m_responseStream->abort();
 
     if (!m_loader)
-        return;
+        return true;
 
-    m_loader->cancel();
-    m_loader = 0;
+    // Cancelling the ThreadableLoader m_loader may result in calling
+    // window.onload synchronously. If such an onload handler contains open()
+    // call on the same XMLHttpRequest object, reentry happens. If m_loader
+    // is left to be non 0, internalAbort() call for the inner open() makes
+    // an extra dropProtection() call (when we're back to the outer open(),
+    // we'll call dropProtection()). To avoid that, clears m_loader before
+    // calling cancel.
+    //
+    // If, window.onload contains open() and send(), m_loader will be set to
+    // non 0 value. So, we cannot continue the outer open(). In such case,
+    // just abort the outer open() by returning false.
+    RefPtr<ThreadableLoader> loader = m_loader.release();
+    loader->cancel();
+
+    // Save to a local variable since we're going to drop protection.
+    bool newLoadStarted = m_loader;
 
     if (async == DropProtectionAsync)
         dropProtectionSoon();
     else
         dropProtection();
+
+    return !newLoadStarted;
 }
 
 void XMLHttpRequest::clearResponse()
@@ -889,36 +902,53 @@
     m_requestEntityBody = 0;
 }
 
-void XMLHttpRequest::genericError()
+void XMLHttpRequest::handleDidFailGeneric()
 {
     clearResponse();
     clearRequest();
-    m_error = true;
 
-    changeState(DONE);
+    m_error = true;
 }
 
-void XMLHttpRequest::networkError()
+void XMLHttpRequest::dispatchEventAndLoadEnd(const AtomicString& type)
 {
-    genericError();
     if (!m_uploadComplete) {
         m_uploadComplete = true;
         if (m_upload && m_uploadEventsAllowed)
-            m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
+            m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(type));
     }
-    m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().errorEvent));
+    m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(type));
+}
+
+void XMLHttpRequest::handleNetworkError()
+{
+    m_exceptionCode = NetworkError;
+
+    handleDidFailGeneric();
+
+    if (m_async) {
+        changeState(DONE);
+        dispatchEventAndLoadEnd(eventNames().errorEvent);
+    } else {
+        m_state = DONE;
+    }
+
     internalAbort();
 }
 
-void XMLHttpRequest::abortError()
+void XMLHttpRequest::handleDidCancel()
 {
-    genericError();
-    if (!m_uploadComplete) {
-        m_uploadComplete = true;
-        if (m_upload && m_uploadEventsAllowed)
-            m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+    m_exceptionCode = AbortError;
+
+    handleDidFailGeneric();
+
+    if (!m_async) {
+        m_state = DONE;
+        return;
     }
-    m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().abortEvent));
+    changeState(DONE);
+
+    dispatchEventAndLoadEnd(eventNames().abortEvent);
 }
 
 void XMLHttpRequest::dropProtectionSoon()
@@ -1086,19 +1116,17 @@
 
 void XMLHttpRequest::didFail(const ResourceError& error)
 {
-
     // If we are already in an error state, for instance we called abort(), bail out early.
     if (m_error)
         return;
 
     if (error.isCancellation()) {
-        m_exceptionCode = AbortError;
-        abortError();
+        handleDidCancel();
         return;
     }
 
     if (error.isTimeout()) {
-        didTimeout();
+        handleDidTimeout();
         return;
     }
 
@@ -1106,13 +1134,12 @@
     if (error.domain() == errorDomainWebKitInternal)
         logConsoleError(scriptExecutionContext(), "XMLHttpRequest cannot load " + error.failingURL() + ". " + error.localizedDescription());
 
-    m_exceptionCode = NetworkError;
-    networkError();
+    handleNetworkError();
 }
 
 void XMLHttpRequest::didFailRedirectCheck()
 {
-    networkError();
+    handleNetworkError();
 }
 
 void XMLHttpRequest::didFinishLoading(unsigned long identifier, double)
@@ -1236,32 +1263,25 @@
     }
 }
 
-void XMLHttpRequest::didTimeout()
+void XMLHttpRequest::handleDidTimeout()
 {
     // internalAbort() calls dropProtection(), which may release the last reference.
     RefPtr<XMLHttpRequest> protect(this);
-    internalAbort();
 
-    clearResponse();
-    clearRequest();
+    if (!internalAbort())
+        return;
 
-    m_error = true;
     m_exceptionCode = TimeoutError;
 
+    handleDidFailGeneric();
+
     if (!m_async) {
         m_state = DONE;
-        m_exceptionCode = TimeoutError;
         return;
     }
-
     changeState(DONE);
 
-    if (!m_uploadComplete) {
-        m_uploadComplete = true;
-        if (m_upload && m_uploadEventsAllowed)
-            m_upload->dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().timeoutEvent));
-    }
-    m_progressEventThrottle.dispatchEventAndLoadEnd(XMLHttpRequestProgressEvent::create(eventNames().timeoutEvent));
+    dispatchEventAndLoadEnd(eventNames().timeoutEvent);
 }
 
 bool XMLHttpRequest::canSuspend() const
diff --git a/Source/core/xml/XMLHttpRequest.h b/Source/core/xml/XMLHttpRequest.h
index ca6f921..56fe38b 100644
--- a/Source/core/xml/XMLHttpRequest.h
+++ b/Source/core/xml/XMLHttpRequest.h
@@ -25,8 +25,8 @@
 #include "bindings/v8/ScriptString.h"
 #include "bindings/v8/ScriptWrappable.h"
 #include "core/dom/ActiveDOMObject.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/loader/ThreadableLoaderClient.h"
 #include "core/platform/network/FormData.h"
 #include "core/platform/network/ResourceResponse.h"
@@ -83,7 +83,6 @@
     };
 
     virtual void contextDestroyed();
-    virtual void didTimeout();
     virtual bool canSuspend() const;
     virtual void suspend(ReasonForSuspension);
     virtual void resume();
@@ -173,20 +172,31 @@
     String getRequestHeader(const AtomicString& name) const;
     void setRequestHeaderInternal(const AtomicString& name, const String& value);
 
+    // Changes m_state and dispatches a readyStateChange event if new m_state
+    // value is different from last one.
     void changeState(State newState);
     void callReadyStateChangeListener();
     void dropProtectionSoon();
     void dropProtection(Timer<XMLHttpRequest>* = 0);
-    void internalAbort(DropProtection = DropProtectionSync);
+    // Returns false iff reentry happened and a new load is started.
+    bool internalAbort(DropProtection = DropProtectionSync);
     void clearResponse();
     void clearResponseBuffers();
     void clearRequest();
 
     void createRequest(ExceptionState&);
 
-    void genericError();
-    void networkError();
-    void abortError();
+    // Dispatches an event of the specified type to m_upload and
+    // m_progressEventThrottle.
+    void dispatchEventAndLoadEnd(const AtomicString&);
+    // Does clean up common for all kind of didFail() call.
+    void handleDidFailGeneric();
+    // Handles didFail() call not caused by cancellation or timeout.
+    void handleNetworkError();
+    // Handles didFail() call triggered by m_loader->cancel().
+    void handleDidCancel();
+    // Handles didFail() call for timeout.
+    void handleDidTimeout();
 
     OwnPtr<XMLHttpRequestUpload> m_upload;
 
@@ -228,6 +238,9 @@
 
     unsigned m_lastSendLineNumber;
     String m_lastSendURL;
+    // An exception to throw in synchronous mode. It's set when failure
+    // notification is received from m_loader and thrown at the end of send() if
+    // any.
     ExceptionCode m_exceptionCode;
 
     XMLHttpRequestProgressEventThrottle m_progressEventThrottle;
diff --git a/Source/core/xml/XMLHttpRequestEventTarget.h b/Source/core/xml/XMLHttpRequestEventTarget.h
index be91c5d..af81417 100644
--- a/Source/core/xml/XMLHttpRequestEventTarget.h
+++ b/Source/core/xml/XMLHttpRequestEventTarget.h
@@ -31,7 +31,7 @@
 #ifndef XMLHttpRequestEventTarget_h
 #define XMLHttpRequestEventTarget_h
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 
 namespace WebCore {
 
diff --git a/Source/core/xml/XMLHttpRequestProgressEvent.h b/Source/core/xml/XMLHttpRequestProgressEvent.h
index ddaf0bd..f742113 100644
--- a/Source/core/xml/XMLHttpRequestProgressEvent.h
+++ b/Source/core/xml/XMLHttpRequestProgressEvent.h
@@ -27,8 +27,8 @@
 #ifndef XMLHttpRequestProgressEvent_h
 #define XMLHttpRequestProgressEvent_h
 
-#include "core/dom/EventNames.h"
-#include "core/dom/ProgressEvent.h"
+#include "core/events/EventNames.h"
+#include "core/events/ProgressEvent.h"
 
 namespace WebCore {
 
diff --git a/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp b/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
index 339d575..39b5227 100644
--- a/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
+++ b/Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "core/xml/XMLHttpRequestProgressEventThrottle.h"
 
-#include "core/dom/EventTarget.h"
+#include "core/events/EventTarget.h"
 #include "core/xml/XMLHttpRequestProgressEvent.h"
 
 namespace WebCore {
diff --git a/Source/core/xml/XMLHttpRequestUpload.cpp b/Source/core/xml/XMLHttpRequestUpload.cpp
index 3e9f5cf..6ad56e5 100644
--- a/Source/core/xml/XMLHttpRequestUpload.cpp
+++ b/Source/core/xml/XMLHttpRequestUpload.cpp
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "core/xml/XMLHttpRequestUpload.h"
 
-#include "core/dom/Event.h"
-#include "core/dom/EventNames.h"
+#include "core/events/Event.h"
+#include "core/events/EventNames.h"
 #include "core/xml/XMLHttpRequest.h"
 #include "core/xml/XMLHttpRequestProgressEvent.h"
 #include "wtf/Assertions.h"
diff --git a/Source/core/xml/XMLHttpRequestUpload.h b/Source/core/xml/XMLHttpRequestUpload.h
index 408e379..2e9797d 100644
--- a/Source/core/xml/XMLHttpRequestUpload.h
+++ b/Source/core/xml/XMLHttpRequestUpload.h
@@ -27,8 +27,8 @@
 #define XMLHttpRequestUpload_h
 
 #include "bindings/v8/ScriptWrappable.h"
-#include "core/dom/EventListener.h"
-#include "core/dom/EventNames.h"
+#include "core/events/EventListener.h"
+#include "core/events/EventNames.h"
 #include "core/xml/XMLHttpRequest.h"
 #include "core/xml/XMLHttpRequestEventTarget.h"
 #include "wtf/Forward.h"
diff --git a/Source/core/xml/XPathEvaluator.cpp b/Source/core/xml/XPathEvaluator.cpp
index b9993e4..32dce9a 100644
--- a/Source/core/xml/XPathEvaluator.cpp
+++ b/Source/core/xml/XPathEvaluator.cpp
@@ -53,7 +53,7 @@
     XPathNSResolver* resolver, unsigned short type, XPathResult* result, ExceptionState& es)
 {
     if (!isValidContextNode(contextNode)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
diff --git a/Source/core/xml/XPathExpression.cpp b/Source/core/xml/XPathExpression.cpp
index 920f6c9..0c80a54 100644
--- a/Source/core/xml/XPathExpression.cpp
+++ b/Source/core/xml/XPathExpression.cpp
@@ -60,7 +60,7 @@
 PassRefPtr<XPathResult> XPathExpression::evaluate(Node* contextNode, unsigned short type, XPathResult*, ExceptionState& es)
 {
     if (!isValidContextNode(contextNode)) {
-        es.throwDOMException(NotSupportedError);
+        es.throwUninformativeAndGenericDOMException(NotSupportedError);
         return 0;
     }
 
@@ -74,7 +74,7 @@
 
     if (evaluationContext.hadTypeConversionError) {
         // It is not specified what to do if type conversion fails while evaluating an expression.
-        es.throwDOMException(SyntaxError);
+        es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
diff --git a/Source/core/xml/XPathFunctions.cpp b/Source/core/xml/XPathFunctions.cpp
index 94ddadd..55004df 100644
--- a/Source/core/xml/XPathFunctions.cpp
+++ b/Source/core/xml/XPathFunctions.cpp
@@ -478,7 +478,7 @@
 
     size_t i = s1.find(s2);
 
-    if (i == notFound)
+    if (i == kNotFound)
         return "";
 
     return s1.left(i);
@@ -490,7 +490,7 @@
     String s2 = arg(1)->evaluate().toString();
 
     size_t i = s1.find(s2);
-    if (i == notFound)
+    if (i == kNotFound)
         return "";
 
     return s1.substring(i + s2.length());
@@ -556,7 +556,7 @@
         UChar ch = s1[i1];
         size_t i2 = s2.find(ch);
 
-        if (i2 == notFound)
+        if (i2 == kNotFound)
             result.append(ch);
         else if (i2 < s3.length())
             result.append(s3[i2]);
@@ -607,7 +607,7 @@
 
         // Remove suffixes one by one.
         size_t index = langValue.reverseFind('-');
-        if (index == notFound)
+        if (index == kNotFound)
             break;
         langValue = langValue.left(index);
     }
diff --git a/Source/core/xml/XPathParser.cpp b/Source/core/xml/XPathParser.cpp
index 3fe9b35..2427539 100644
--- a/Source/core/xml/XPathParser.cpp
+++ b/Source/core/xml/XPathParser.cpp
@@ -451,7 +451,7 @@
 bool Parser::expandQName(const String& qName, String& localName, String& namespaceURI)
 {
     size_t colon = qName.find(':');
-    if (colon != notFound) {
+    if (colon != kNotFound) {
         if (!m_resolver)
             return false;
         namespaceURI = m_resolver->lookupNamespaceURI(qName.left(colon));
@@ -502,9 +502,9 @@
         m_topExpr = 0;
 
         if (m_gotNamespaceError)
-            es.throwDOMException(NamespaceError);
+            es.throwUninformativeAndGenericDOMException(NamespaceError);
         else
-            es.throwDOMException(SyntaxError);
+            es.throwUninformativeAndGenericDOMException(SyntaxError);
         return 0;
     }
 
diff --git a/Source/core/xml/XPathResult.cpp b/Source/core/xml/XPathResult.cpp
index 3647dec..cf2eac8 100644
--- a/Source/core/xml/XPathResult.cpp
+++ b/Source/core/xml/XPathResult.cpp
@@ -186,7 +186,7 @@
     }
 
     if (invalidIteratorState()) {
-        es.throwDOMException(InvalidStateError);
+        es.throwUninformativeAndGenericDOMException(InvalidStateError);
         return 0;
     }
 
diff --git a/Source/core/xml/XSLTProcessorLibxslt.cpp b/Source/core/xml/XSLTProcessorLibxslt.cpp
index 4ab991f..30b3151 100644
--- a/Source/core/xml/XSLTProcessorLibxslt.cpp
+++ b/Source/core/xml/XSLTProcessorLibxslt.cpp
@@ -23,13 +23,16 @@
 #include "config.h"
 #include "core/xml/XSLTProcessor.h"
 
+#include "FetchInitiatorTypeNames.h"
 #include "core/dom/Document.h"
 #include "core/dom/TransformSource.h"
 #include "core/editing/markup.h"
+#include "core/fetch/Resource.h"
 #include "core/fetch/ResourceFetcher.h"
 #include "core/page/Frame.h"
 #include "core/page/Page.h"
 #include "core/page/PageConsole.h"
+#include "core/platform/SharedBuffer.h"
 #include "core/platform/network/ResourceError.h"
 #include "core/platform/network/ResourceRequest.h"
 #include "core/platform/network/ResourceResponse.h"
@@ -97,20 +100,13 @@
         xmlChar* base = xmlNodeGetBase(context->document->doc, context->node);
         KURL url(KURL(ParsedURLString, reinterpret_cast<const char*>(base)), reinterpret_cast<const char*>(uri));
         xmlFree(base);
-        ResourceError error;
-        ResourceResponse response;
 
-        Vector<char> data;
-
-        bool requestAllowed = globalResourceFetcher->frame() && globalResourceFetcher->document()->securityOrigin()->canRequest(url);
-        if (requestAllowed) {
-            globalResourceFetcher->fetchSynchronously(url, AllowStoredCredentials, error, response, data);
-            requestAllowed = globalResourceFetcher->document()->securityOrigin()->canRequest(response.url());
-        }
-        if (!requestAllowed) {
-            data.clear();
-            globalResourceFetcher->printAccessDeniedMessage(url);
-        }
+        ResourceLoaderOptions fetchOptions(ResourceFetcher::defaultResourceOptions());
+        fetchOptions.requestOriginPolicy = RestrictToSameOrigin;
+        FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, fetchOptions);
+        ResourcePtr<Resource> resource = globalResourceFetcher->fetchSynchronously(request);
+        if (!resource || !globalProcessor)
+            return 0;
 
         PageConsole* console = 0;
         Frame* frame = globalProcessor->xslStylesheet()->ownerDocument()->frame();
@@ -121,7 +117,8 @@
 
         // We don't specify an encoding here. Neither Gecko nor WinIE respects
         // the encoding specified in the HTTP headers.
-        xmlDocPtr doc = xmlReadMemory(data.data(), data.size(), (const char*)uri, 0, options);
+        SharedBuffer* data = resource->resourceBuffer();
+        xmlDocPtr doc = data ? xmlReadMemory(data->data(), data->size(), (const char*)uri, 0, options) : 0;
 
         xmlSetStructuredErrorFunc(0, 0);
         xmlSetGenericErrorFunc(0, 0);
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index a06e969..98942d6 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "core/xml/parser/XMLDocumentParser.h"
 
+#include "FetchInitiatorTypeNames.h"
 #include "HTMLNames.h"
 #include "XMLNSNames.h"
 #include "bindings/v8/ExceptionState.h"
@@ -50,6 +51,7 @@
 #include "core/loader/ImageLoader.h"
 #include "core/page/Frame.h"
 #include "core/page/UseCounter.h"
+#include "core/platform/SharedBuffer.h"
 #include "core/platform/network/ResourceError.h"
 #include "core/platform/network/ResourceRequest.h"
 #include "core/platform/network/ResourceResponse.h"
@@ -641,23 +643,27 @@
     if (!shouldAllowExternalLoad(url))
         return &globalDescriptor;
 
-    ResourceError error;
-    ResourceResponse response;
+    KURL finalURL;
     Vector<char> data;
 
-
     {
         ResourceFetcher* fetcher = XMLDocumentParserScope::currentFetcher;
         XMLDocumentParserScope scope(0);
         // FIXME: We should restore the original global error handler as well.
 
-        if (fetcher->frame())
-            fetcher->fetchSynchronously(url, AllowStoredCredentials, error, response, data);
+        if (fetcher->frame()) {
+            FetchRequest request(ResourceRequest(url), FetchInitiatorTypeNames::xml, ResourceFetcher::defaultResourceOptions());
+            ResourcePtr<Resource> resource = fetcher->fetchSynchronously(request);
+            if (resource && !resource->errorOccurred()) {
+                resource->resourceBuffer()->moveTo(data);
+                finalURL = resource->response().url();
+            }
+        }
     }
 
     // We have to check the URL again after the load to catch redirects.
     // See <https://bugs.webkit.org/show_bug.cgi?id=21963>.
-    if (!shouldAllowExternalLoad(response.url()))
+    if (!shouldAllowExternalLoad(finalURL))
         return &globalDescriptor;
 
     return new OffsetBuffer(data);